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("TAXED_PRICE", $cartItem->getTaxedPrice($taxCountry))
->set("PROMO_TAXED_PRICE", $cartItem->getTaxedPromoPrice($taxCountry)) ->set("PROMO_TAXED_PRICE", $cartItem->getTaxedPromoPrice($taxCountry))
->set("IS_PROMO", $cartItem->getPromo() === 1 ? 1 : 0); ->set("IS_PROMO", $cartItem->getPromo() === 1 ? 1 : 0);
$loopResultRow->set("PRODUCT_SALE_ELEMENTS_ID", $productSaleElement->getId());
$result->addRow($loopResultRow); $result->addRow($loopResultRow);
} }

View File

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