From 7f304fc768d1dae11d89c7cc4c33dad617ece4da Mon Sep 17 00:00:00 2001 From: gRoussac Date: Tue, 26 Nov 2013 16:26:35 +0100 Subject: [PATCH] [-] FO : Merge of https://github.com/ldecoker/PrestaShop/commit/d3bf4d233005511e08554a7c283e0b992815e01a --- themes/default-bootstrap/shopping-cart.tpl | 18 +- themes/default/shopping-cart.tpl | 432 +++++++++++++++++++++ 2 files changed, 441 insertions(+), 9 deletions(-) create mode 100644 themes/default/shopping-cart.tpl diff --git a/themes/default-bootstrap/shopping-cart.tpl b/themes/default-bootstrap/shopping-cart.tpl index 99b5e5e37..13275edb7 100644 --- a/themes/default-bootstrap/shopping-cart.tpl +++ b/themes/default-bootstrap/shopping-cart.tpl @@ -451,17 +451,17 @@
  • {if $k eq 'invoice'}{l s='Invoice address'}{elseif $k eq 'delivery' && $delivery->id}{l s='Delivery address'}{/if}{if isset($address.object.alias)} ({$address.object.alias}){/if}

  • {foreach $address.ordered as $pattern} {assign var=addressKey value=" "|explode:$pattern} -
  • - {foreach $addressKey as $key} - - {if isset($address.formated[$key])} - {$address.formated[$key]|escape:'html':'UTF-8'} - {/if} - + {assign var=addedli value=false} + {foreach from=$addressKey item=key name=foo} + {if isset($address.formated[$key]) && !empty($address.formated[$key])} + {if (!$addedli)} + {$addedli = true} +
  • + {/if}{$address.formated[$key]|escape:'html':'UTF-8'}{/if}{if ($smarty.foreach.foo.last && $addedli)} +
  • {/if} {/foreach} - {/foreach} - + {/foreach} {/if} diff --git a/themes/default/shopping-cart.tpl b/themes/default/shopping-cart.tpl new file mode 100644 index 000000000..de6a05d62 --- /dev/null +++ b/themes/default/shopping-cart.tpl @@ -0,0 +1,432 @@ +{* +* 2007-2013 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 license@prestashop.com 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 +* @copyright 2007-2013 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{capture name=path}{l s='Your shopping cart'}{/capture} +{include file="$tpl_dir./breadcrumb.tpl"} + +

    {l s='Shopping-cart summary'}

    + +{if isset($account_created)} +

    + {l s='Your account has been created.'} +

    +{/if} +{assign var='current_step' value='summary'} +{include file="$tpl_dir./order-steps.tpl"} +{include file="$tpl_dir./errors.tpl"} + +{if isset($empty)} +

    {l s='Your shopping cart is empty.'}

    +{elseif $PS_CATALOG_MODE} +

    {l s='This store has not accepted your new order.'}

    +{else} + + +{if isset($lastProductAdded) AND $lastProductAdded} +
    +
    +
    {l s='Last product added'}
    +
    + {$lastProductAdded.name|escape:'html':'UTF-8'} +
    +

    {$lastProductAdded.name|escape:'html':'UTF-8'}

    + {if isset($lastProductAdded.attributes) && $lastProductAdded.attributes}{$lastProductAdded.attributes|escape:'html':'UTF-8'}{/if} +
    +
    +
    +{/if} +

    {l s='Your shopping cart contains:'} {$productNumber} {if $productNumber == 1}{l s='product'}{else}{l s='products'}{/if}

    +
    + + + + + + + + + + + + + + {if $use_taxes} + {if $priceDisplay} + + + + + {else} + + + + + {/if} + {else} + + + + + {/if} + + + + + {if $total_shipping_tax_exc <= 0 && !isset($virtualCart)} + + + + + {else} + {if $use_taxes && $total_shipping_tax_exc != $total_shipping} + {if $priceDisplay} + + + + + {else} + + + + + {/if} + {else} + + + + + {/if} + {/if} + + + + + {if $use_taxes && $show_taxes} + + + + + + + + + {/if} + + + {if $use_taxes} + + {else} + + {/if} + + + + {assign var='odd' value=0} + {foreach $products as $product} + {assign var='productId' value=$product.id_product} + {assign var='productAttributeId' value=$product.id_product_attribute} + {assign var='quantityDisplayed' value=0} + {assign var='odd' value=($odd+1)%2} + {assign var='ignoreProductLast' value=isset($customizedDatas.$productId.$productAttributeId) || count($gift_products)} + {* Display the product line *} + {include file="$tpl_dir./shopping-cart-product-line.tpl" productLast=$product@last productFirst=$product@first} + {* Then the customized datas ones*} + {if isset($customizedDatas.$productId.$productAttributeId)} + {foreach $customizedDatas.$productId.$productAttributeId[$product.id_address_delivery] as $id_customization=>$customization} + + + + + + + {assign var='quantityDisplayed' value=$quantityDisplayed+$customization.quantity} + {/foreach} + {* If it exists also some uncustomized products *} + {if $product.quantity-$quantityDisplayed > 0}{include file="$tpl_dir./shopping-cart-product-line.tpl" productLast=$product@last productFirst=$product@first}{/if} + {/if} + {/foreach} + {assign var='last_was_odd' value=$product@iteration%2} + {foreach $gift_products as $product} + {assign var='productId' value=$product.id_product} + {assign var='productAttributeId' value=$product.id_product_attribute} + {assign var='quantityDisplayed' value=0} + {assign var='odd' value=($product@iteration+$last_was_odd)%2} + {assign var='ignoreProductLast' value=isset($customizedDatas.$productId.$productAttributeId)} + {assign var='cannotModify' value=1} + {* Display the gift product line *} + {include file="$tpl_dir./shopping-cart-product-line.tpl" productLast=$product@last productFirst=$product@first} + {/foreach} + + {if sizeof($discounts)} + + {foreach $discounts as $discount} + + + + + + + + {/foreach} + + {/if} +
    {l s='Product'}{l s='Description'}{l s='Ref.'}{l s='Unit price'}{l s='Qty'}{l s='Total'} 
    {if $display_tax_label}{l s='Total products (tax excl.)'}{else}{l s='Total products'}{/if}{displayPrice price=$total_products}
    {if $display_tax_label}{l s='Total products (tax incl.)'}{else}{l s='Total products'}{/if}{displayPrice price=$total_products_wt}
    {l s='Total products'}{displayPrice price=$total_products}
    + {if $use_taxes} + {if $display_tax_label}{l s='Total gift wrapping (tax incl.):'}{else}{l s='Total gift-wrapping cost:'}{/if} + {else} + {l s='Total gift-wrapping cost:'} + {/if} + + {if $use_taxes} + {if $priceDisplay} + {displayPrice price=$total_wrapping_tax_exc} + {else} + {displayPrice price=$total_wrapping} + {/if} + {else} + {displayPrice price=$total_wrapping_tax_exc} + {/if} +
    {l s='Shipping'}{l s='Free Shipping!'}
    + {if $display_tax_label} + {if $use_taxes && $priceDisplay == 0} + {l s='Total vouchers (tax incl.):'} + {else} + {l s='Total vouchers (tax excl.)'} + {/if} + {else} + {l s='Total vouchers'} + {/if} + + {if $use_taxes && $priceDisplay == 0} + {assign var='total_discounts_negative' value=$total_discounts * -1} + {else} + {assign var='total_discounts_negative' value=$total_discounts_tax_exc * -1} + {/if} + {displayPrice price=$total_discounts_negative} +
    {l s='Total (tax excl.)'}{displayPrice price=$total_price_without_tax}
    {l s='Total tax'}{displayPrice price=$total_tax}
    + {if $voucherAllowed} + {if isset($errors_discount) && $errors_discount} +
      + {foreach $errors_discount as $k=>$error} +
    • {$error|escape:'html':'UTF-8'}
    • + {/foreach} +
    + {/if} +
    +
    +

    +

    + +

    +

    +
    +
    + {if $displayVouchers} +

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

    +
    + {foreach $displayVouchers as $voucher} + {if $voucher.code != ''}{$voucher.code} - {/if}{$voucher.name}
    + {/foreach} +
    + {/if} + {/if} +
    +

    {l s='Total'}

    + {displayPrice price=$total_price} +
    +

    {l s='Total'}

    + {displayPrice price=$total_price_without_tax} +
    + {foreach $customization.datas as $type => $custom_data} + {if $type == $CUSTOMIZE_FILE} +
    +
      + {foreach $custom_data as $picture} +
    • + {/foreach} +
    +
    + {elseif $type == $CUSTOMIZE_TEXTFIELD} +
      + {foreach $custom_data as $textField} +
    • + {if $textField.name} + {$textField.name} + {else} + {l s='Text #'}{$textField@index+1} + {/if} + {l s=':'} {$textField.value} +
    • + {/foreach} + +
    + {/if} + + {/foreach} +
    + {if isset($cannotModify) AND $cannotModify == 1} + {if $quantityDisplayed == 0 AND isset($customizedDatas.$productId.$productAttributeId)}{$customizedDatas.$productId.$productAttributeId|@count}{else}{$product.cart_quantity-$quantityDisplayed}{/if} + {else} +
    + {l s='Add'}
    + {if $product.minimal_quantity < ($customization.quantity -$quantityDisplayed) OR $product.minimal_quantity <= 1} + + {l s='Subtract'} + + {else} + + {l s='Subtract'} + + {/if} +
    + + + {/if} +
    + {if isset($cannotModify) AND $cannotModify == 1} + {else} + + {/if} +
    {$discount.name} + {if !$priceDisplay}{displayPrice price=$discount.value_real*-1}{else}{displayPrice price=$discount.value_tax_exc*-1}{/if} + 1 + {if !$priceDisplay}{displayPrice price=$discount.value_real*-1}{else}{displayPrice price=$discount.value_tax_exc*-1}{/if} + + {if strlen($discount.code)}{l s='Delete'}{/if} +
    +
    + +{if $show_option_allow_separate_package} +

    + allow_seperated_package}checked="checked"{/if} autocomplete="off"/> + +

    +{/if} +{if !$opc} + {if Configuration::get('PS_ALLOW_MULTISHIPPING')} +

    + + +

    + {/if} +{/if} + +
    {$HOOK_SHOPPING_CART}
    + +{* Define the style if it doesn't exist in the PrestaShop version*} +{* Will be deleted for 1.5 version and more *} +{if !isset($addresses_style)} + {$addresses_style.company = 'address_company'} + {$addresses_style.vat_number = 'address_company'} + {$addresses_style.firstname = 'address_name'} + {$addresses_style.lastname = 'address_name'} + {$addresses_style.address1 = 'address_address1'} + {$addresses_style.address2 = 'address_address2'} + {$addresses_style.city = 'address_city'} + {$addresses_style.country = 'address_country'} + {$addresses_style.phone = 'address_phone'} + {$addresses_style.phone_mobile = 'address_phone_mobile'} + {$addresses_style.alias = 'address_title'} +{/if} + +{if ((!empty($delivery_option) AND !isset($virtualCart)) OR $delivery->id OR $invoice->id) AND !$opc} +
    + {if !isset($formattedAddresses) || (count($formattedAddresses.invoice) == 0 && count($formattedAddresses.delivery) == 0) || (count($formattedAddresses.invoice.formated) == 0 && count($formattedAddresses.delivery.formated) == 0)} + {if $delivery->id} +
      +
    • {l s='Delivery address'} ({$delivery->alias})
    • + {if $delivery->company}
    • {$delivery->company|escape:'html':'UTF-8'}
    • {/if} +
    • {$delivery->firstname|escape:'html':'UTF-8'} {$delivery->lastname|escape:'html':'UTF-8'}
    • +
    • {$delivery->address1|escape:'html':'UTF-8'}
    • + {if $delivery->address2}
    • {$delivery->address2|escape:'html':'UTF-8'}
    • {/if} +
    • {$delivery->postcode|escape:'html':'UTF-8'} {$delivery->city|escape:'html':'UTF-8'}
    • +
    • {$delivery->country|escape:'html':'UTF-8'} {if $delivery_state}({$delivery_state|escape:'html':'UTF-8'}){/if}
    • +
    + {/if} + {if $invoice->id} +
      +
    • {l s='Invoice address'} ({$invoice->alias})
    • + {if $invoice->company}
    • {$invoice->company|escape:'html':'UTF-8'}
    • {/if} +
    • {$invoice->firstname|escape:'html':'UTF-8'} {$invoice->lastname|escape:'html':'UTF-8'}
    • +
    • {$invoice->address1|escape:'html':'UTF-8'}
    • + {if $invoice->address2}
    • {$invoice->address2|escape:'html':'UTF-8'}
    • {/if} +
    • {$invoice->postcode|escape:'html':'UTF-8'} {$invoice->city|escape:'html':'UTF-8'}
    • +
    • {$invoice->country|escape:'html':'UTF-8'} {if $invoice_state}({$invoice_state|escape:'html':'UTF-8'}){/if}
    • +
    + {/if} + {else} + {foreach from=$formattedAddresses key=k item=address} +
      +
    • {if $k eq 'invoice'}{l s='Invoice address'}{elseif $k eq 'delivery' && $delivery->id}{l s='Delivery address'}{/if}{if isset($address.object.alias)} ({$address.object.alias}){/if}
    • + {foreach $address.ordered as $pattern} + {assign var=addressKey value=" "|explode:$pattern} +
    • + {foreach $address.ordered as $pattern} + {assign var=addressKey value=" "|explode:$pattern} + {assign var=addedli value=false} + {foreach from=$addressKey item=key name=foo} + {if isset($address.formated[$key]) && !empty($address.formated[$key])} + {if (!$addedli)} + {$addedli = true} +
    • + {/if}{$address.formated[$key]|escape:'html':'UTF-8'}{/if}{if ($smarty.foreach.foo.last && $addedli)} +
    • {/if} + {/foreach} + {/foreach} +
    + {/foreach} +
    + {/if} +
    +{/if} +

    + {if !$opc} + {l s='Next'} » + {if Configuration::get('PS_ALLOW_MULTISHIPPING')} + {l s='Next'} » + {/if} + {/if} + « {l s='Continue shopping'} +

    + {if !empty($HOOK_SHOPPING_CART_EXTRA)} +
    +
    +
    {$HOOK_SHOPPING_CART_EXTRA}
    +
    + {/if} +{/if} +