
danielle85
Members-
Posts
7 -
Joined
-
Last visited
Profile Information
-
Activity
Freelancer
danielle85's Achievements
Newbie (1/14)
0
Reputation
-
[SOLVED] Trackingcode affiliate Tradetracker plaatsen Prestashop 1.4
danielle85 replied to danielle85's topic in Algemeen
Bedankt, de error is in ieder geval weg! -
Graag wil ik tradetracker gaan gebruiken op mijn prestashop-site, versie 1.4.7. Ik krijg alleen de trackingcode niet goed. In OrderconfirmationController.php heb ik nu: public function displayContent() { $order = new Order($this->id_order); $cart = new Cart($order->id_cart); $description=""; foreach ($cart->getProducts() AS $k=>$v){ $description.=$v['name']."X".$v['quantity']; } $description=urlencode($description); $this->context->smarty->assign(array('total_products'=>$order->total_products_wt, 'description'=>$description )); parent::displayContent(); self::$smarty->display(_PS_THEME_DIR_.'order-confirmation.tpl'); } } En in order-confirmation.tpl staat de pixel: <img src="http://www.site.nl/kleding/conversion.php?campaignID=14519&productID=21572&conversionType=sales&https=0&transactionID={Tools::getvalue('id_order')}_formatted&transactionAmount='{$total_to_pay}'&email=email&descrMerchant={$description}&descrAffiliate={$description}" width="1" height="1" border="0" alt="" /> Echter als ik dit zo online zet komt er een witte pagina, als ik error-reporting aan zet krijg ik deze error: Fatal error: Call to a member function assign() on a non-object in/home/ufiqlaxk/domains/site.nl/public_html/controllers/OrderConfirmationController.php on line 93 Dat is de regel '($this->context->smarty->assign(array( ) ' Weet iemand wat er precies mis gaat?
-
[Solved] Affiliate Tracking Code
danielle85 replied to Larry Baldwin's topic in Ecommerce x PrestaShop [ARCHIVE BOARD]
Hi, after long time searching I found this topic. I use Prestashop 1.4.7 and want to place a conversion pixel. but get a white page as order-confirmation-page In OrderconfirmationController.php I have: { $order = new Order($this->id_order); $cart = new Cart($order->id_cart); $description=""; foreach ($cart->getProducts() AS $k=>$v){ $description.=$v['name']."X".$v['quantity']; } $description=urlencode($description); $this->context->smarty->assign(array('total_products'=>$order->total_products_wt, 'description'=>$description )); parent::displayContent(); self::$smarty->display(_PS_THEME_DIR_.'order-confirmation.tpl'); } } And in order-confirmation.tpl I have the pixel and variables <img src="http://www.site.nl/kleding/conversion.php?campaignID=14519&productID=21572&conversionType=sales&https=0&transactionID={Tools::getvalue('id_order')}_formatted&transactionAmount='{$total_to_pay}'&email=email&descrMerchant={$description}&descrAffiliate={$description}" width="1" height="1" border="0" alt="" /> But when I make an order, I get a blank page instead of the last step of the orderproces (order-confirmation.php). The error I get when I turn on error-reporting: Fatal error: Call to a member function assign() on a non-object in/home/ufiqlaxk/domains/site.nl/public_html/controllers/OrderConfirmationController.php on line 93 Probably not only the code I placed on line 93 ($this->context->smarty->assign(array( ) isn't right, also the conversion image variables may not be right I guess. Can you help me out?- 145 replies
-
- iframe
- tracking code
-
(and 1 more)
Tagged with:
-
Maybe I have to amke a connection with table "ps_category_lang"? The category is already named in the deeplink in the feed, but I can't display it in the feed, same for the subcategory. I use Prestashop 1.4.7.3.
-
Moet ik nog verbinding maken met de tabel ps_category_lang? De categorie staat wel in de deeplink, dus het moet niet moeilijk zijn. Ik krijg het alleen niet voor elkaar om hem normaal weer te geven in de feed, evenals de subcategorie. Ik heb Prestashop 1.4.7.3.
-
I would like to insert the category and subcategory of my products in the feed, but I can't figure out how to do it. This is the current code I use in rss.php: <?php /* * 2007-2011 PrestaShop * * NOTICE OF LICENSE * * This source file is subject to the Academic Free License (AFL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/afl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to [email protected] so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA <[email protected]> * @copyright 2007-2011 PrestaShop SA * @version Release: $Revision: 1.4 $ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ include(dirname(__FILE__).'/../../config/config.inc.php'); require_once(dirname(__FILE__).'/../../init.php'); // Get data $number = ((int)(Tools::getValue('n')) ? (int)(Tools::getValue('n')) : 10); $orderByValues = array(0 => 'name', 1 => 'price', 2 => 'date_add', 3 => 'date_upd', 4 => 'position', 5 => 'manufacturer_name', 6 => 'quantity'); $orderWayValues = array(0 => 'ASC', 1 => 'DESC'); $orderBy = Tools::strtolower(Tools::getValue('orderby', $orderByValues[(int)(Configuration::get('PS_PRODUCTS_ORDER_BY'))])); $orderWay = Tools::strtoupper(Tools::getValue('orderway', $orderWayValues[(int)(Configuration::get('PS_PRODUCTS_ORDER_WAY'))])); if (!in_array($orderBy, $orderByValues)) $orderBy = $orderByValues[0]; if (!in_array($orderWay, $orderWayValues)) $orderWay = $orderWayValues[0]; $id_category = ((int)(Tools::getValue('id_category')) ? (int)(Tools::getValue('id_category')) : 1); $products = Product::getProducts((int)($cookie->id_lang), 0, NULL, 'id_product', 'ASC'); $currency = new Currency((int)($cookie->id_currency)); $affiliate = (Tools::getValue('ac') ? '?ac='.(int)(Tools::getValue('ac')) : ''); $id_category = ((int)(Tools::getValue('id_category')) ? (int)(Tools::getValue('id_category')) : 1); // Send feed header("Content-Type:text/xml; charset=utf-8"); echo '<?xml version="1.0" encoding="UTF-8"?>'."\n"; ?> <catalogus> <?php foreach ($products AS $product) { if ($product['active'] == 1){ $image = Image::getImages((int)($cookie->id_lang), $product['id_product']); echo "\t\t<product>\n"; // & in titel naar & omzetten echo "\t\t\t<Title>".str_replace("&", "&" , $product['name'])."</Title>\n"; echo "\t\t\t<Beschrijving>".str_replace("&", "&" , $product['description'])."</Beschrijving>\n"; echo "\t\t\t<Prijs>".html_entity_decode(Tools::displayPrice(Product::getPriceStatic($product['id_product']), $currency), ENT_COMPAT, 'UTF-8')."</Prijs>\n"; echo "\t\t\t<Categorie>"; $cats = Product::getProductCategories($product['id_product']); foreach ($cats AS $cat) { //home category niet tonen if($cat != 1){ $catnames = Category::getSimpleCategories($cookie->id_lang); foreach ($catnames as $catname){ if ($catname['id_category'] == $cat) echo $catname['name']; [spam-filter]} echo "</Categorie>\n"; echo "\t\t\t<Image-locatie>"; $cdata = true; if (is_array($image) AND sizeof($image)) { echo _PS_BASE_URL_.__PS_BASE_URI__."img/p/".$image[0]['id_product']."-".$image[0]['id_image']."-home.jpg"; $cdata = false; } echo "</Image-locatie>\n"; echo "\t\t\t<Portokosten>"; echo "0"; echo "</Portokosten>\n"; echo "\t\t\t<Levertijd>"; echo "1-2 werkdagen"; echo "</Levertijd>\n"; echo "\t\t\t<Winkelproductcode>"; echo $product['id_product']; echo "</Winkelproductcode>\n"; echo "\t\t\t<Deeplink>".htmlspecialchars($link->getproductLink($product['id_product'], $product['link_rewrite'], Category::getLinkRewrite((int)($product['id_category_default']), $cookie->id_lang))).$affiliate."</Deeplink>\n"; echo "\t\t\t<Geslacht>"; echo "Dames"; echo "</Geslacht>\n"; echo "\t\t</product>\n"; } } ?> </catalogus> But there is something wrong with the category-part. I get the following error: This page contains the following errors: error on line 7 at column 27: xmlParseEntityRef: no name Below is a rendering of the page up to the first error. Can somebody help me out to show the (sub)category in the feed? Thanks!
-
Graag wil ik de categorie en subcategorie in de feed hebben, maar dit krijg ik niet voor elkaar. Kan iemand mij helpen? Ik heb nu in rss.php: <?php /* * 2007-2011 PrestaShop * * NOTICE OF LICENSE * * This source file is subject to the Academic Free License (AFL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/afl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to [email protected] so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA <[email protected]> * @copyright 2007-2011 PrestaShop SA * @version Release: $Revision: 1.4 $ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ include(dirname(__FILE__).'/../../config/config.inc.php'); require_once(dirname(__FILE__).'/../../init.php'); // Get data $number = ((int)(Tools::getValue('n')) ? (int)(Tools::getValue('n')) : 10); $orderByValues = array(0 => 'name', 1 => 'price', 2 => 'date_add', 3 => 'date_upd', 4 => 'position', 5 => 'manufacturer_name', 6 => 'quantity'); $orderWayValues = array(0 => 'ASC', 1 => 'DESC'); $orderBy = Tools::strtolower(Tools::getValue('orderby', $orderByValues[(int)(Configuration::get('PS_PRODUCTS_ORDER_BY'))])); $orderWay = Tools::strtoupper(Tools::getValue('orderway', $orderWayValues[(int)(Configuration::get('PS_PRODUCTS_ORDER_WAY'))])); if (!in_array($orderBy, $orderByValues)) $orderBy = $orderByValues[0]; if (!in_array($orderWay, $orderWayValues)) $orderWay = $orderWayValues[0]; $id_category = ((int)(Tools::getValue('id_category')) ? (int)(Tools::getValue('id_category')) : 1); $products = Product::getProducts((int)($cookie->id_lang), 0, NULL, 'id_product', 'ASC'); $currency = new Currency((int)($cookie->id_currency)); $affiliate = (Tools::getValue('ac') ? '?ac='.(int)(Tools::getValue('ac')) : ''); $id_category = ((int)(Tools::getValue('id_category')) ? (int)(Tools::getValue('id_category')) : 1); // Send feed header("Content-Type:text/xml; charset=utf-8"); echo '<?xml version="1.0" encoding="UTF-8"?>'."\n"; ?> <catalogus> <?php foreach ($products AS $product) { if ($product['active'] == 1){ $image = Image::getImages((int)($cookie->id_lang), $product['id_product']); echo "\t\t<product>\n"; // & in titel naar & omzetten echo "\t\t\t<Title>".str_replace("&", "&" , $product['name'])."</Title>\n"; echo "\t\t\t<Beschrijving>".str_replace("&", "&" , $product['description'])."</Beschrijving>\n"; echo "\t\t\t<Prijs>".html_entity_decode(Tools::displayPrice(Product::getPriceStatic($product['id_product']), $currency), ENT_COMPAT, 'UTF-8')."</Prijs>\n"; echo "\t\t\t<Categorie>"; $cats = Product::getProductCategories($product['id_product']); foreach ($cats AS $cat) { //home category niet tonen if($cat != 1){ $catnames = Category::getSimpleCategories($cookie->id_lang); foreach ($catnames as $catname){ if ($catname['id_category'] == $cat) echo $catname['name']; [spam-filter]} echo "</Categorie>\n"; echo "\t\t\t<Image-locatie>"; $cdata = true; if (is_array($image) AND sizeof($image)) { echo _PS_BASE_URL_.__PS_BASE_URI__."img/p/".$image[0]['id_product']."-".$image[0]['id_image']."-home.jpg"; $cdata = false; } echo "</Image-locatie>\n"; echo "\t\t\t<Portokosten>"; echo "0"; echo "</Portokosten>\n"; echo "\t\t\t<Levertijd>"; echo "1-2 werkdagen"; echo "</Levertijd>\n"; echo "\t\t\t<Winkelproductcode>"; echo $product['id_product']; echo "</Winkelproductcode>\n"; echo "\t\t\t<Deeplink>".htmlspecialchars($link->getproductLink($product['id_product'], $product['link_rewrite'], Category::getLinkRewrite((int)($product['id_category_default']), $cookie->id_lang))).$affiliate."</Deeplink>\n"; echo "\t\t\t<Geslacht>"; echo "Dames"; echo "</Geslacht>\n"; echo "\t\t</product>\n"; } } ?> </catalogus> Maar als ik dit gebruik krijg ik de foutmelding: This page contains the following errors:error on line 7 at column 27: xmlParseEntityRef: no name Below is a rendering of the page up to the first error. Weet iemand hoe ik de categorie en subcategorie kan weergeven in een feed? Alvast bednakt.