[*] Mobile : Shopping cart displays gifts

This commit is contained in:
François Gaillard
2013-03-15 17:24:00 +01:00
parent 4c704c97c4
commit e5e6e8c29c
4 changed files with 81 additions and 3 deletions

View File

@@ -29,6 +29,10 @@
clear:both;
}
.width-15 {
width:15%;
}
.width-20 {
width:20%;
}
@@ -37,6 +41,10 @@
width:40%;
}
.width-60 {
width:60%;
}
.width-70 {
width:70%;
}

View File

@@ -39,9 +39,9 @@
{if $HOOK_PAYMENT}
{if !$opc}
<div id="order-detail-content" class="table_block">
<table id="cart_summary" class="std ui-responsive table-stroke" data-role="table" data-mode="reflow">
<table id="cart_summary" data-role="table" class="ui-body-d ui-shadow ui-responsive table-stroke" data-mode="reflow">
<thead>
<tr>
<tr class="ui-bar-a">
<th class="cart_product first_item">{l s='Product'}</th>
<th class="cart_description item">{l s='Description'}</th>
<th class="cart_availability item">{l s='Avail.'}</th>

View File

@@ -0,0 +1,53 @@
{*
* 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 <contact@prestashop.com>
* @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
*}
<input type="hidden" name="cart_product_id[]" value="{$product.id_product}"/>
<input type="hidden" id="cart_product_attribute_id_{$product.id_product}" value="{$product.id_product_attribute|intval}"/>
<input type="hidden" id="cart_product_address_delivery_id_{$product.id_product}" value="{$product.id_address_delivery}"/>
<div class="fl width-20">
<img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'small_default')}" class="img_product_cart" />
</div>
<div class="fl width-60 padding-left-5px">
<h3>{$product.name}</h3>
{if $product.reference}<p>{l s='Ref:'} {$product.reference}</p>{/if}
<p>{$product.description_short}</p>
</div>
<div class="fl width-15" style="text-align:right">
<p class="price" id="product_price_{$product.id_product}_{$product.id_product_attribute}_{$product.id_address_delivery|intval}{if !empty($product.gift)}_gift{/if}" style="padding-top:20px">
{if !empty($product.gift)}
<h3 class="gift-icon" style="background-color:#0088CC;color:white;display:inline;padding:2px 14px;-webkit-border-radius:6px;border-radius:6px;font-weight:normal">{l s='Gift!'}</h3>
{else}
{if isset($product.is_discounted) && $product.is_discounted}
<span style="text-decoration:line-through;">{convertPrice price=$product.price_without_specific_price}</span><br />
{/if}
{if !$priceDisplay}
{convertPrice price=$product.price_wt}
{else}
{convertPrice price=$product.price}
{/if}
{/if}
</p>
</div>

View File

@@ -12,6 +12,7 @@
<h2>{l s='List of products'}</h2>
{if isset($products)}
<ul data-role="listview" data-inset="true" data-split-theme="d" data-split-icon="delete">
{debug}
{foreach $products as $product}
<li id="element_product_{$product.id_product}">
<a>
@@ -22,7 +23,7 @@
<div class="fl width-20">
<img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'small_default')}" class="img_product_cart" />
</div>
<div class="fl width-70 padding-left-5px">
<div class="fl width-60 padding-left-5px">
<h3>{$product.name}</h3>
{if $product.reference}<p>{l s='Ref:'} {$product.reference}</p>{/if}
<p>{$product.description_short}</p>
@@ -61,6 +62,22 @@
<a rel="nofollow" class="cart_quantity_delete" id="{$product.id_product}_{$product.id_product_attribute}_0_{$product.id_address_delivery|intval}" href="{$link->getPageLink('cart', true, NULL, "delete=1&amp;id_product={$product.id_product|intval}&amp;ipa={$product.id_product_attribute|intval}&amp;id_address_delivery={$product.id_address_delivery|intval}&amp;token={$token_cart}")}" data-ajax="false">{l s='Delete'}</a>
</li>
{/foreach}
{assign var='last_was_odd' value=$product@iteration%2}
{foreach $gift_products as $product}
<li id="element_product_{$product.id_product}">
<a style="padding-right:10px">
{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="./shopping-cart-gift-line.tpl" productLast=$product@last productFirst=$product@first}
</a>
<a rel="nofollow" class="cart_quantity_delete" id="{$product.id_product}_{$product.id_product_attribute}_0_{$product.id_address_delivery|intval}" href="{$link->getPageLink('cart', true, NULL, "delete=1&amp;id_product={$product.id_product|intval}&amp;ipa={$product.id_product_attribute|intval}&amp;id_address_delivery={$product.id_address_delivery|intval}&amp;token={$token_cart}")}" data-ajax="false" style="display:none">{l s='Delete'}</a>
</li>
{/foreach}
</ul>
{/if}
{if sizeof($discounts)}