Merge branch 'frontend' of https://github.com/thelia/thelia into frontend

This commit is contained in:
touffies
2013-10-16 12:47:52 +02:00
4 changed files with 150 additions and 145 deletions

View File

@@ -102,6 +102,7 @@ class Cart extends BaseLoop
->set("TAXED_PRICE", $cartItem->getTaxedPrice($taxCountry))
->set("PROMO_TAXED_PRICE", $cartItem->getTaxedPromoPrice($taxCountry))
->set("IS_PROMO", $cartItem->getPromo() === 1 ? 1 : 0);
$loopResultRow->set("PRODUCT_SALE_ELEMENTS_ID", $productSaleElement->getId());
$result->addRow($loopResultRow);
}

View File

@@ -54,70 +54,73 @@
</thead>
<tbody>
{loop type="cart" name="cartloop"}
{nocache}
{loop type="cart" name="cartloop"}
<tr>
<td class="image">
<a href="{$PRODUCT_URL}" class="thumbnail">
{assign "cart_count" $LOOP_COUNT}
{ifloop rel='product-image'}
{loop type="image" name="product-image" product=$PRODUCT_ID limit="1" width="118" height="85" force_return="true"}
<img src="{$IMAGE_URL}" alt="Product #{$cart_count}"></a>
{/loop}
{/ifloop}
{elseloop rel="product-image"}
{images file='assets/img/product/1/118x85.png'}<img itemprop="image" src="{$asset_url}" alt="Product #{$cart_count}">{/images}
{/elseloop}
</td>
<td class="product" >
<h3 class="name"><a href="product-details.php">
Product #{$LOOP_COUNT}
</a></h3>
<div class="product-options">
<dl class="dl-horizontal">
<dt>{intl l="Available"} :</dt>
<dd>{intl l="In Stock"}</dd>
<dt>{intl l="No."}</dt>
<dd>{$REF}</dd>
{*<dt>Select Size</dt>
<dd>Large</dd>
<dt>Select Delivery Date</dt>
<dd>Jan 2, 2013</dd>
<dt>Additional Option</dt>
<dd>Option 1</dd>*}
</dl>
</div>
<a href="{url path="/cart/delete/{$ITEM_ID}"}" class="btn btn-remove">{intl l="Remove"}</a>
</td>
<td class="unitprice">
{if $IS_PROMO == 1}
{assign "real_price" $PROMO_TAXED_PRICE}
<div class="special-price"><span class="price">{currency attr="symbol"} {$PROMO_TAXED_PRICE}</span></div>
<small class="old-price">{intl l="instead of"} <span class="price">{currency attr="symbol"} {$TAXED_PRICE}</span></small>
{else}
{assign "real_price" $TAXED_PRICE}
<div class="special-price"><span class="price">{currency attr="symbol"} {$TAXED_PRICE}</span></div>
{/if}
</td>
<td class="qty">
<div class="form-group group-qty">
<form action="{url path="/cart/update"}" method="post" role="form">
<input type="hidden" name="cart_item" value="{$ITEM_ID}">
<select name="quantity" class="form-control js-update-quantity">
{for $will=1 to $STOCK}
<option {if $QUANTITY == $will}selected="selected"{/if}>{$will}</option>
{/for}
</select>
</form>
</div>
</td>
<td class="subprice">
<span class="price">{currency attr="symbol"} {$real_price * $QUANTITY}</span>
</td>
</tr>
{/loop}
<tr>
<td class="image">
<a href="{$PRODUCT_URL}" class="thumbnail">
{assign "cart_count" $LOOP_COUNT}
{ifloop rel='product-image'}
{loop type="image" name="product-image" product=$PRODUCT_ID limit="1" width="118" height="85" force_return="true"}
<img src="{$IMAGE_URL}" alt="Product #{$cart_count}"></a>
{/loop}
{/ifloop}
{elseloop rel="product-image"}
{images file='assets/img/product/1/118x85.png'}<img itemprop="image" src="{$asset_url}" alt="Product #{$cart_count}">{/images}
{/elseloop}
</td>
<td class="product" >
<h3 class="name"><a href="{$URL}">
{$TITLE}
</a></h3>
<div class="product-options">
<dl class="dl-horizontal">
<dt>{intl l="Available"} :</dt>
{if $STOCK > 0}
<dd>{intl l="In Stock"}</dd>
{else}
<dd>{intl l="Out of Stock"}</dd>
{/if}
<dt>{intl l="No."}</dt>
<dd>{$REF}</dd>
{loop type="attribute_combination" name="product_options" product_sale_elements="$PRODUCT_SALE_ELEMENTS_ID"}
<dt>{$ATTRIBUTE_TITLE}</dt>
<dd>{$ATTRIBUTE_AVAILABILITY_TITLE}</dd>
{/loop}
</dl>
</div>
<a href="{url path="/cart/delete/{$ITEM_ID}"}" class="btn btn-remove"><i class="icon-trash"></i> {intl l="Remove"}</a>
</td>
<td class="unitprice">
{if $IS_PROMO == 1}
{assign "real_price" $PROMO_TAXED_PRICE}
<div class="special-price"><span class="price">{currency attr="symbol"} {$PROMO_TAXED_PRICE}</span></div>
<small class="old-price">{intl l="instead of"} <span class="price">{currency attr="symbol"} {$TAXED_PRICE}</span></small>
{else}
{assign "real_price" $TAXED_PRICE}
<div class="special-price"><span class="price">{currency attr="symbol"} {$TAXED_PRICE}</span></div>
{/if}
</td>
<td class="qty">
<div class="form-group group-qty">
<form action="{url path="/cart/update"}" method="post" role="form">
<input type="hidden" name="cart_item" value="{$ITEM_ID}">
<select name="quantity" class="form-control js-update-quantity">
{for $will=1 to $STOCK}
<option {if $QUANTITY == $will}selected="selected"{/if}>{$will}</option>
{/for}
</select>
</form>
</div>
</td>
<td class="subprice">
<span class="price">{currency attr="symbol"} {$real_price * $QUANTITY}</span>
</td>
</tr>
{/loop}
{/nocache}
</tbody>
<tfoot>
<tr >
@@ -137,38 +140,34 @@
</article>
<aside id="products-upsell" role="complementary" aria-labelledby="products-upsell-label">
<div class="products-heading">
<h3 id="products-upsell-label">{intl l="Upsell Products"}</h3>
</div>
{ifloop rel="product_upsell"}
<aside id="products-upsell" role="complementary" aria-labelledby="products-upsell-label">
<div class="products-heading">
<h3 id="products-upsell-label">{intl l="Upsell Products"}</h3>
</div>
<div class="products-content">
<ul class="products-grid product-col-<?php echo $product_upsell; ?> hover-effect">
<?php
// Product Parameters
$has_description = false; // Product without description
$has_btn = false; // Product without button (Add to Cart)
<div class="products-content">
<ul class="products-grid product-col-5 hover-effect">
{loop name="product_upsell" type="product" promo="yes" limit="5"}
{include file="includes/single-product.html" product_id=$ID hasBtn=true hasDescription=true width="218" height="146"}
{/loop}
for ($count = 1; $count <= $product_upsell; $count++) { ?>
<li class="item">
<?php include('inc/inc-product.php') ?>
</li>
<?php } ?>
</ul>
</div>
</aside><!-- #products-upsell -->
</ul>
</div>
</aside><!-- #products-upsell -->
{/ifloop}
</div>
{/block}
{block name="javascript-initialization"}
<script type="text/javascript">
jQuery(function($cart) {
$cart('.js-update-quantity').on('change', function(e) {
var newQuantity = $cart(this).val();
<script type="text/javascript">
jQuery(function($cart) {
$cart('.js-update-quantity').on('change', function(e) {
var newQuantity = $cart(this).val();
$cart(this).parent().submit();
})
});
</script>
$cart(this).parent().submit();
})
});
</script>
{/block}

View File

@@ -0,0 +1,61 @@
{ifloop rel="cartloop"}
<div class="dropdown-menu cart-content">
<form id="form-cart-mini" action="{url path="/order/delivery"}" method="post" role="form">
<table class="table table-cart-mini">
<colgroup>
<col width="70">
<col>
<col width="100">
</colgroup>
<tbody>
{assign "total_price" 0}
{loop type="cart" name="cartloop"}
<tr>
<td class="image">
{ifloop rel="product-image"}
{loop type="image" name="product-image" product=$PRODUCT_ID limit="1" width="118" height="60"}
<img src="{$IMAGE_URL}" alt="{$TITLE}">
{/loop}
{/ifloop}
</td>
<td class="product">
<h3 class="name" style="margin:0"><a href="{$URL}">
{$TITLE}
</a></h3>
<a href="{url path="/cart/delete/{$ITEM_ID}"}" class="btn btn-remove" data-tip="tooltip" data-title="Delete" data-original-title=""><i class="icon-trash"></i> <span>Remove</span></a>
</td>
<td class="unitprice text-center">
{if $IS_PROMO == 1}
{assign "real_price" $PROMO_TAXED_PRICE}
{else}
{assign "real_price" $TAXED_PRICE}
{/if}
<span class="qty">{$QUANTITY}</span> X <span class="price" style="font-size:1em;">{currency attr="symbol"}{$real_price}</span></div>
{assign "total_price" $total_price + ($QUANTITY * $real_price)}
</td>
</tr>
{/loop}
</tbody>
<tfoot>
<tr>
<td colspan="2" class="empty">
<a href="{url path="/cart"}" role="button" class="btn btn-default btn-sm"><span>View Cart</span></a>
<button type="submit" name="checkout" class="btn btn-warning btn-sm"><span>Checkout</span></button>
</td>
<td class="total">
<div class="total-price">
<span class="price">{currency attr="symbol"}{$total_price}</span>
</div>
</td>
</tr>
</tfoot>
</table>
</form>
</div>
{/ifloop}
{elseloop rel="cartloop"}
<div class="dropdown-menu cart-content">
<p>You have no items in your shopping cart.</p>
</div>
{/elseloop}

View File

@@ -104,63 +104,7 @@ URL: http://www.thelia.net
<a href="{url path="/cart"}" rel="nofollow" class="cart">
Cart <span class="badge">{cart attr="count_item"}</span>
</a>
<div class="dropdown-menu cart-content">
<p>You have no items in your shopping cart.</p>
</div>
<div class="dropdown-menu cart-content">
<form id="form-cart-mini" action="cart-step2.php" method="post" role="form">
<table class="table table-cart-mini">
<colgroup>
<col width="70">
<col>
<col width="100">
</colgroup>
<tbody>
<tr>
<td class="image">
<a href="product-details.php" class="thumbnail"><img src="img/product/1/118x85.png" alt="Product #1"></a>
</td>
<td class="product">
<h3 class="name" style="margin:0"><a href="product-details.php">
Product #1
</a></h3>
<a href="?item=1&amp;qty=0" class="btn btn-remove" data-tip="tooltip" data-title="Delete" data-original-title=""><i class="icon-trash"></i> <span>Remove</span></a>
</td>
<td class="unitprice text-center">
<span class=="qty">2</span> X <span class="price" style="font-size:1em;">$50.00</span></div>
</td>
</tr>
<tr>
<td class="image">
<a href="product-details.php" class="thumbnail"><img src="img/product/1/118x85.png" alt="Product #2"></a>
</td>
<td class="product">
<h3 class="name" style="margin:0"><a href="product-details.php">
Product with very long name #2
</a></h3>
<a href="?item=1&amp;qty=0" class="btn btn-remove" data-tip="tooltip" data-title="Delete" data-original-title=""><i class="icon-trash"></i> <span>Remove</span></a>
</td>
<td class="unitprice text-center">
<span class=="qty">2</span> X <span class="price" style="font-size:1em;">$50.00</span></div>
</td>
</tr>
</tbody>
<tfoot>
<tr >
<td colspan="2" class="empty">
<a href="cart.php" role="button" class="btn btn-default btn-sm"><span>View Cart</span></a>
<button type="submit" name="checkout" class="btn btn-warning btn-sm"><span>Checkout</span></button>
</td>
<td class="total">
<div class="total-price">
<span class="price">$200.00</span>
</div>
</td>
</tr>
</tfoot>
</table>
</form>
</div>
{include file="includes/mini-cart.html"}
</li>
</ul>
<ul class="nav navbar-nav navbar-categories">