From 3fda89d7c4765e5de627a183d73784abb2ace6a5 Mon Sep 17 00:00:00 2001 From: jBreux Date: Tue, 20 Dec 2011 16:42:21 +0000 Subject: [PATCH] // Smarty 3 standardize git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11427 b9a71923-0436-4b27-9f14-aed3839534dd --- themes/default/scenes.tpl | 10 +++++----- themes/default/shopping-cart.tpl | 32 ++++++++++++++++---------------- themes/default/sitemap.tpl | 6 +++--- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/themes/default/scenes.tpl b/themes/default/scenes.tpl index 941eb1ce9..b69733103 100644 --- a/themes/default/scenes.tpl +++ b/themes/default/scenes.tpl @@ -37,9 +37,9 @@ $(function () {ldelim}
- {foreach from=$scenes key='scene_key' item='scene' name='scenes'} -
- {foreach from=$scene->products key='product_key' item='product'} + {foreach $scenes as $scene_key=>$scene} +
+ {foreach $scene->products as $product_key=>$product} {assign var=imageIds value="`$product.id_product`-`$product.id_image`"}   @@ -71,8 +71,8 @@ $(function () {ldelim}
    - {foreach from=$scenes item='scene' name='scenes_list'} -
  • + {foreach $scenes as $scene} +
  • {$scene->name|escape:'htmlall':'UTF-8'} diff --git a/themes/default/shopping-cart.tpl b/themes/default/shopping-cart.tpl index 07526dda3..504785154 100644 --- a/themes/default/shopping-cart.tpl +++ b/themes/default/shopping-cart.tpl @@ -180,7 +180,7 @@ {if $voucherAllowed} {if isset($errors_discount) && $errors_discount}
      - {foreach from=$errors_discount key=k item=error} + {foreach $errors_discount as $k=>$error}
    • {$error|escape:'htmlall':'UTF-8'}
    • {/foreach}
    @@ -195,7 +195,7 @@ {if $displayVouchers}

    {l s='Take advantage of our offers:'}

    - {foreach from=$displayVouchers item=voucher} + {foreach $displayVouchers as $voucher} {$voucher.name} - {$voucher.description}
    {/foreach}
    @@ -218,33 +218,33 @@ - {foreach from=$products item=product name=productLoop} + {foreach $products as $product} {assign var='productId' value=$product.id_product} {assign var='productAttributeId' value=$product.id_product_attribute} {assign var='quantityDisplayed' value=0} {* Display the product line *} - {include file="./shopping-cart-product-line.tpl" productLast=$smarty.foreach.productLoop.last productFirst=$smarty.foreach.productLoop.first} + {include file="./shopping-cart-product-line.tpl" productLast=$product@last productFirst=$product@first} {* Then the customized datas ones*} {if isset($customizedDatas.$productId.$productAttributeId)} - {foreach from=$customizedDatas.$productId.$productAttributeId[$product.id_address_delivery] key=id_customization item=customization} + {foreach $customizedDatas.$productId.$productAttributeId[$product.id_address_delivery] as $id_customization=>$customization} - {foreach from=$customization.datas key=type item=custom_data} + {foreach $customization.datas as $type=>$custom_data} {if $type == $CUSTOMIZE_FILE}
      - {foreach from=$datas item=picture}
    • {/foreach} + {foreach $datas as $picture}
    • {/foreach}
    {elseif $type == $CUSTOMIZE_TEXTFIELD}
      - {foreach from=$custom_data item=textField name=typedText} + {foreach $custom_data as $textField}
    • {if $textField.name} {$textField.name} {else} - {l s='Text #'}{$smarty.foreach.typedText.index+1} + {l s='Text #'}{$textField@index+1} {/if} {l s=':'} {$textField.value}
    • @@ -283,14 +283,14 @@ {assign var='quantityDisplayed' value=$quantityDisplayed+$customization.quantity} {/foreach} {* If it exists also some uncustomized products *} - {if $product.quantity-$quantityDisplayed > 0}{include file="./shopping-cart-product-line.tpl" productLast=$smarty.foreach.productLoop.last productFirst=$smarty.foreach.productLoop.first}{/if} + {if $product.quantity-$quantityDisplayed > 0}{include file="./shopping-cart-product-line.tpl" productLast=$product@last productFirst=$product@first}{/if} {/if} {/foreach} {if sizeof($discounts)} - {foreach from=$discounts item=discount name=discountLoop} - + {foreach $discounts as $discount} + {$discount.name} {if !$priceDisplay}{displayPrice price=$discount.value_real*-1}{else}{displayPrice price=$discount.value_tax_exc*-1}{/if} @@ -368,13 +368,13 @@
    {/if} {else} - {foreach from=$formattedAddresses item=address name=myLoop} -
      + {foreach $formattedAddresses as $address} +
      • {$address.object.alias}
      • - {foreach from=$address.ordered name=adr_loop item=pattern} + {foreach $address.ordered as $pattern} {assign var=addressKey value=" "|explode:$pattern}
      • - {foreach from=$addressKey item=key name="word_loop"} + {foreach $addressKey as $key} {$address.formated[$key]|escape:'htmlall':'UTF-8'} diff --git a/themes/default/sitemap.tpl b/themes/default/sitemap.tpl index d0d6a9618..e40f8bf0c 100644 --- a/themes/default/sitemap.tpl +++ b/themes/default/sitemap.tpl @@ -59,8 +59,8 @@
          {if isset($categoriesTree.children)} - {foreach from=$categoriesTree.children item=child name=sitemapTree} - {if $smarty.foreach.sitemapTree.last} + {foreach $categoriesTree.children as $child} + {if $child@last} {include file="$tpl_dir./category-tree-branch.tpl" node=$child last='true'} {else} {include file="$tpl_dir./category-tree-branch.tpl" node=$child} @@ -74,7 +74,7 @@
            {if isset($categoriescmsTree.children)} - {foreach from=$categoriescmsTree.children item=child name=sitemapCmsTree} + {foreach $categoriescmsTree.children as $child} {if (isset($child.children) && $child.children|@count > 0) || $child.cms|@count > 0} {include file="$tpl_dir./category-cms-tree-branch.tpl" node=$child} {/if}