This commit introduces a new index.php file in the googlemerchant XML module. The file contains headers to prevent caching and redirects users to the parent directory. This is part of the module's structure to ensure proper access control and user experience.
21 lines
876 B
PHP
21 lines
876 B
PHP
<?php
|
|
|
|
error_reporting(E_ALL);
|
|
ini_set('display_errors', 1);
|
|
|
|
define('_PRESTA_DIR_', dirname(dirname(dirname($_SERVER['SCRIPT_FILENAME']))));
|
|
|
|
require_once(_PRESTA_DIR_ . '/config/config.inc.php');
|
|
|
|
if (Configuration::get('X13_GOOGLEMERCHANT_CRON_TOKEN') && Tools::getValue('token') != Configuration::get('X13_GOOGLEMERCHANT_TOKEN')) {
|
|
echo 'Token error';
|
|
exit;
|
|
}
|
|
|
|
$x13googlemerchant = Module::getInstanceByName('x13googlemerchant');
|
|
|
|
$id_lang = (Tools::getIsset('id_lang')) ? (int)Tools::getValue('id_lang') : (int)Configuration::get('PS_DEFAULT_LANG');
|
|
$id_shop = (Tools::getIsset('id_shop')) ? (int)Tools::getValue('id_shop') : Context::getContext()->shop->id;
|
|
$id_currency = (Tools::getIsset('id_currency')) ? (int)Tools::getValue('id_currency') : (int)Configuration::get('PS_DEFAULT_CURRENCY');
|
|
$x13googlemerchant->createXml($id_lang, $id_shop, $id_currency, 1);
|