From fbd9dafcacd4c6e7e06f27c51733645afac065d0 Mon Sep 17 00:00:00 2001 From: Marion Muszynski Date: Wed, 27 Jul 2016 17:42:44 +0200 Subject: [PATCH] modif url product --- modules/criteo_bbb/criteo_bbb.php | 7 ++++++- modules/criteo_bbb/cron_flux_catalogue.php | 12 ++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/modules/criteo_bbb/criteo_bbb.php b/modules/criteo_bbb/criteo_bbb.php index d81ae954..c8fb22ba 100644 --- a/modules/criteo_bbb/criteo_bbb.php +++ b/modules/criteo_bbb/criteo_bbb.php @@ -55,6 +55,7 @@ class Criteo_bbb extends Module Configuration::updateValue('WIC_CRITEO_SITE_TYPE', pSQL(Tools::getValue('site_type_criteo'))); Configuration::updateValue('WIC_CRITEO_CATEGORY', (Tools::getValue('category') ? implode(',', Tools::getValue('category')) : '')); Configuration::updateValue('WIC_CRITEO_DISPLAY_CAT', Tools::getValue('display_category_criteo')); + Configuration::updateValue('WIC_CRITEO_URL_MODE', pSQL(Tools::getValue('url_criteo_mode'))); return $this->displayConfirmation($this->l('Settings updated successfully')); } @@ -108,6 +109,10 @@ class Criteo_bbb extends Module   No       Yes +

+ +   No     +   Yes

'; @@ -558,7 +563,7 @@ class Criteo_bbb extends Module FROM `'._DB_PREFIX_.'product` p LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON p.`id_product` = cp.`id_product` WHERE cp.`id_category` = '.(int)Tools::getValue('id_category').' - AND p.`active` = 1 ORDER BY cp.`position` + AND p.`active` = 1 ORDER BY cp.`position` LIMIT 3 '); diff --git a/modules/criteo_bbb/cron_flux_catalogue.php b/modules/criteo_bbb/cron_flux_catalogue.php index 3df63747..580a5323 100644 --- a/modules/criteo_bbb/cron_flux_catalogue.php +++ b/modules/criteo_bbb/cron_flux_catalogue.php @@ -1,7 +1,7 @@ ExecuteS(' if (Pack::isPack((int)$row['id_product'])) { continue; } + $link = new Link(); $product = new Product((int)$row['id_product'], true); $s = $xml->addChildAuto('product'); $s->addAttribute("id",$row['id_product']); $s->addChildAuto('name', htmlentities($row['name'])); - $s->addChildAuto('producturl', 'http://www.bebeboutik.com/?utm_source=retargeting&utm_medium=cpc&utm_campaign=criteo&lp=criteo'); + if (!Configuration::get('WIC_CRITEO_URL_MODE')) { + $s->addChildAuto('producturl', 'http://www.bebeboutik.com/'); + } else { + $s->addChildAuto('producturl', $link->getProductLink((int)$product->id, $product->link_rewrite[$id_lang], $product->ean13).); + } /* Image Cover */ $cover = Product::getCover((int)$row['id_product']); - $link = new Link(); $smallimage = $link->getImageLink($row['link_rewrite'], (int)$cover['id_image'], 'small'); $bigimage = $link->getImageLink($row['link_rewrite'], (int)$cover['id_image'], 'thickbox'); $s->addChildAuto('smallimage', $smallimage);