// Remove useless prefix in blockcart json template

This commit is contained in:
rMalie
2011-12-06 09:16:58 +00:00
parent db6d4db8e1
commit b83886bd10
+15 -15
View File
@@ -26,8 +26,8 @@
{ldelim}
"products": [
{if $blockcart_products}
{foreach from=$blockcart_products item=product name='products'}
{if $products}
{foreach from=$products item=product name='products'}
{assign var='productId' value=$product.id_product}
{assign var='productAttributeId' value=$product.id_product_attribute}
{ldelim}
@@ -44,11 +44,11 @@
{else}
"hasAttributes": false,
{/if}
"hasCustomizedDatas": {if isset($blockcart_customizedDatas.$productId.$productAttributeId)}true{else}false{/if},
"hasCustomizedDatas": {if isset($customizedDatas.$productId.$productAttributeId)}true{else}false{/if},
"customizedDatas":[
{if isset($blockcart_customizedDatas.$productId.$productAttributeId)}
{foreach from=$blockcart_customizedDatas.$productId.$productAttributeId[$product.id_address_delivery] key='id_customization' item='customization' name='customizedDatas'}{ldelim}
{if isset($customizedDatas.$productId.$productAttributeId)}
{foreach from=$customizedDatas.$productId.$productAttributeId[$product.id_address_delivery] key='id_customization' item='customization' name='customizedDatas'}{ldelim}
{* This empty line was made in purpose (product addition debug), please leave it here *}
"customizationId": {$id_customization},
@@ -80,7 +80,7 @@
],
"discounts": [
{if $blockcart_discounts}{foreach from=$blockcart_discounts item=discount name='discounts'}
{if $discounts}{foreach from=$discounts item=discount name='discounts'}
{ldelim}
"id": "{$discount.id_discount}",
"name": "{$discount.name|cat:' : '|cat:$discount.description|truncate:18:'...'|addslashes|replace:'\\\'':'\''}",
@@ -93,19 +93,19 @@
{/foreach}{/if}
],
"shippingCost": "{$blockcart_shipping_cost|html_entity_decode:2:'UTF-8'}",
{if isset($blockcart_tax_cost)}
"taxCost": "{$blockcart_tax_cost|html_entity_decode:2:'UTF-8'}",
"shippingCost": "{$shipping_cost|html_entity_decode:2:'UTF-8'}",
{if isset($tax_cost)}
"taxCost": "{$tax_cost|html_entity_decode:2:'UTF-8'}",
{/if}
"wrappingCost": "{$blockcart_wrapping_cost|html_entity_decode:2:'UTF-8'}",
"nbTotalProducts": "{$blockcart_nb_total_products}",
"total": "{$blockcart_total|html_entity_decode:2:'UTF-8'}",
"productTotal": "{$blockcart_product_total|html_entity_decode:2:'UTF-8'}",
"wrappingCost": "{$wrapping_cost|html_entity_decode:2:'UTF-8'}",
"nbTotalProducts": "{$nb_total_products}",
"total": "{$total|html_entity_decode:2:'UTF-8'}",
"productTotal": "{$product_total|html_entity_decode:2:'UTF-8'}",
{if isset($blockcart_errors) && $blockcart_errors}
{if isset($errors) && $errors}
"hasError" : true,
"errors" : [
{foreach from=$blockcart_errors key=k item=error name='errors'}
{foreach from=$errors key=k item=error name='errors'}
"{$error|addslashes|html_entity_decode:2:'UTF-8'}"
{if !$smarty.foreach.errors.last},{/if}
{/foreach}