fix undefined variables, wrong objects in tpls

This commit is contained in:
Rodney Figaro 2017-02-24 16:04:42 +01:00
parent 5c40834db0
commit e4e250bacc
6 changed files with 15 additions and 8 deletions

View File

@ -37,7 +37,7 @@
// End editable part
</script>
<noscript>
<img src="https://clic.reussissonsensemble.fr/TrackOrder.aspx?site=15580&event=sale&net_price={$total_paid_wt_ws}&order_id={$id_order}&rate_number=1&program_subid1={$status}&program_subid2={$payment}&voucher_code={$ids_discount}" />
<img src="https://clic.reussissonsensemble.fr/TrackOrder.aspx?site=15580&event=sale&net_price={$order->total_paid_tax_excl - $order->total_shipping_tax_excl}&order_id={$order->id}&rate_number=1&program_subid1={$customer_status}&program_subid2={$order->payment}&voucher_code={$ids_discount}" />
</noscript>
{assign var=total_quantity value=0}
@ -70,10 +70,10 @@
shipping_type: '',
payment_type: '{$order->payment}',
products: [
{foreach from=$order->products item=product}
{foreach from=$order->getProducts() item=product}
{
product_id: '{$product.id_product}',
product_name: '{$product.name}',
product_name: '',
product_price: {$product.price},
product_quantity: {$product.quantity}
},

View File

@ -85,8 +85,8 @@
"nameDescription": "{$discount.name|cat:' : '|cat:$discount.description|truncate:18:'...'|addslashes|replace:'\\\'':'\''}",
"code": "{$discount.code}",
"link": "{$link->getPageLink("$order_process", true, NULL, "deleteDiscount={$discount.id_discount}")|escape:'html'}",
"price": "{if $priceDisplay == 1}{convertPrice|html_entity_decode:2:'UTF-8' price=$discount.value_tax_exc}{else}{convertPrice|html_entity_decode:2:'UTF-8' price=$discount.value_real}{/if}",
"price_float": "{if $priceDisplay == 1}{$discount.value_tax_exc}{else}{$discount.value_real}{/if}"
"price": "{if $priceDisplay == 1}{convertPrice|html_entity_decode:2:'UTF-8' price=$discount.value_tax_exc}{else}{if isset($discount.value_real)}{convertPrice|html_entity_decode:2:'UTF-8' price=$discount.value_real}{/if}{/if}",
"price_float": "{if $priceDisplay == 1}{$discount.value_tax_exc}{else}{if isset($discount.value_real)}{$discount.value_real}{/if}{/if}"
{rdelim}
{if !$smarty.foreach.discounts.last},{/if}
{/foreach}{/if}

View File

@ -243,7 +243,6 @@ class BlockCart extends Module
if (is_array($res) && $id_product = Tools::getValue('id_product'))
{
$this->smarty->assign('orderProducts', OrderDetail::getCrossSells($id_product, $this->context->language->id, Configuration::get('PS_BLOCK_CART_XSELL_LIMIT')));
$products = $this->getProductsInSale((int)$id_product, $this->context->language->id) ;
$this->smarty->assign(
array(
'otherProducts' => $this->getProductsInSale($params, (int)$id_product, $this->context->language->id),

View File

@ -253,6 +253,11 @@ class ProductController extends ProductControllerCore
$link_back = false;
}
// antadis fix : set undefined variable
if (!isset($link_back_category)) {
$link_back_category = false;
}
$sale = SaleCore::loadSaleFromCategoryId($this->category->id);
$categories_name = array_column(Db::getInstance()->executeS('

View File

@ -78,7 +78,7 @@
product_category: [{foreach from=$categories_name item=cat_name}'{$cat_name}',{/foreach}],
product_brand: '{$product_manufacturer->name}',
product_rating: '0',
product_in_stock: '{if $product->getQuantity() > 0}true{else}false{/if}',
product_in_stock: '{if Product::getQuantity($product->id) > 0}true{else}false{/if}',
product_on_sale: '{if $product->on_sale == 1}true{else}false{/if}',
product_accessory: 'false',
product_img_url: '',

View File

@ -119,9 +119,12 @@
</h5>
<div class="shape-red"></div>
{if isset($product.description_short)}
<p class="product-desc" itemprop="description">
{$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'}
</p>
{/if}
{if $cookie->logged}
{if (!$PS_CATALOG_MODE AND ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))}
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer" class="content_price">
@ -150,7 +153,7 @@
{elseif $priceDisplay == 1}
{assign var='productPrice' value=$product.price_tax_exc}
{/if}
{if $product.unit_price_ratio > 0.000000}
{if isset($product.unit_price_ratio) && $product.unit_price_ratio > 0.000000}
{math equation="pprice / punit_price" pprice=$productPrice punit_price=$product.unit_price_ratio assign=unit_price}
<p class="unit_price">{l s='soit'} {convertPrice price=$unit_price} {l s='l\'unité'}</p>
{/if}