[Front office] Modifying upsell products

Fixing $ID in some loops
This commit is contained in:
Emmanuel Nurit
2014-02-13 16:40:03 +01:00
parent bc7cfe7f79
commit 5a9dcb3e44

View File

@@ -1,68 +1,62 @@
<li class="item"> {assign var="hasSubmit" value = false}
{assign var="hasSubmit" value = false} <article itemscope itemtype="http://schema.org/Product">
{assign var="productTitle" value="{$TITLE}"} {if not $product_id}
{if not $product_id} {assign var="$product_id" value=$ID}
{assign var="$product_id" value=$ID} {/if}
{/if} <!-- Use the meta tag to specify content that is not visible on the page in any way -->
<article itemscope itemtype="http://schema.org/Product"> {loop name="brand.feature" type="feature" product=$product_id title="brand"}
<!-- Use the meta tag to specify content that is not visible on the page in any way --> {loop name="brand.value" type="feature_value" feature=$ID product=$product_id}
{loop name="brand.feature" type="feature" product=$product_id title="brand"}
{loop name="brand.value" type="feature_value" feature=$product_id product=$product_id}
<meta itemprop="brand" content="{$TITLE}"> <meta itemprop="brand" content="{$TITLE}">
{/loop} {/loop}
{/loop} {/loop}
{loop name="brand.feature" type="feature" product=$product_id title="isbn"} {loop name="brand.feature" type="feature" product=$product_id title="isbn"}
{loop name="brand.value" type="feature_value" feature=$ID product=$product_id} {loop name="brand.value" type="feature_value" feature=$ID product=$product_id}
<meta itemprop="productID" content="isbn:{$TITLE}"> <meta itemprop="productID" content="isbn:{$TITLE}">
{/loop} {/loop}
{/loop}
<div class="product-image">
{loop name="product_thumbnail" type="image" product="$product_id" width="{$width}" height="{$height}" resize_mode="borders" limit="1"}
<img itemprop="image" src="{$IMAGE_URL}" alt="Product #{$LOOP_COUNT}">
{/loop} {/loop}
<span class="mask">
<div class="product-btn">
<a class="product-link-btn" href="{$URL}">{intl l="More details"}</a>
<a href="{$URL}" itemprop="url" tabindex="-1" class="product-image"> </div>
{loop name="product_thumbnail" type="image" product=$product_id width="{$width}" height="{$height}" resize_mode="borders" limit="1"} </span>
<img itemprop="image" src="{$IMAGE_URL}" alt="{$productTitle}"> </div>
{/loop}
{elseloop rel="product_thumbnail"}
{images file='../assets/img/218x146.png'}<img itemprop="image" src="{$asset_url}" alt="{$productTitle}">{/images}
{/elseloop}
<span class="mask"></span>
</a>
<div class="product-info"> <div class="product-info">
<h3 class="name"><a href="{$URL}"><span itemprop="name">{$productTitle}</span></a></h3> <h3 class="name"><a href="{$URL}"><span itemprop="name">{$TITLE}</span></a></h3>
{if $hasDescription} {if $hasDescription}
<div class="description" itemprop="description"> <div class="description" itemprop="description">
<p>{$DESCRIPTION}</p> <p>{$DESCRIPTION}</p>
</div> </div>
{/if}
</div>
<div class="product-price">
<div class="price-container" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<meta itemprop="category" content="{category attr="title"}">
<meta itemprop="itemCondition" itemscope itemtype="http://schema.org/NewCondition"> <!-- List of condition : NewCondition, DamagedCondition, UsedCondition, RefurbishedCondition -->
<meta itemprop="priceCurrency" content="{currency attr="symbol"}"> <!-- List of currency : The currency used to describe the product price, in three-letter ISO format. -->
<link itemprop="availability" href="http://schema.org/InStock" content="in_stock" />
{if $IS_PROMO }
{loop name="productSaleElements_promo" type="product_sale_elements" product=$product_id limit="1" order="min_price"}
{assign var="default_product_sale_elements" value=$ID}
<span class="special-price"><span class="price">{format_number number=$TAXED_PROMO_PRICE} {currency attr="symbol"}</span>
<span class="old-price"><span class="price">{format_number number=$TAXED_PRICE} {currency attr="symbol"}</span>
{/loop}
{else}
<span class="regular-price">{format_number number=$BEST_TAXED_PRICE} {currency attr="symbol"}</span>
{/if} {/if}
</div> </div>
{if $hasBtn == true}
<div class="product-price">
<div class="price-container" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<meta itemprop="category" content="{category attr="title"}">
<meta itemprop="itemCondition" itemscope itemtype="http://schema.org/NewCondition"> <!-- List of condition : NewCondition, DamagedCondition, UsedCondition, RefurbishedCondition -->
<meta itemprop="priceCurrency" content="{currency attr="symbol"}"> <!-- List of currency : The currency used to describe the product price, in three-letter ISO format. -->
<link itemprop="availability" href="http://schema.org/InStock" content="in_stock" />
<!-- List of availibility :
out_of_stock : http://schema.org/OutOfStock
in_stock : http://schema.org/InStock
instore_only : http://schema.org/InStoreOnly
preorder : http://schema.org/PreOrder
online_only : http://schema.org/OnlineOnly
-->
{if $IS_PROMO }
{loop name="productSaleElements_promo" type="product_sale_elements" product=$product_id limit="1" order="min_price"}
{assign var="default_product_sale_elements" value=$product_id}
<span class="special-price"><span itemprop="price" class="price-label">{intl l="Special Price:"} </span><span class="price">{format_number number=$TAXED_PROMO_PRICE} {currency attr="symbol"}</span></span>
<span class="old-price"><span class="price-label">{intl l="Regular Price:"} </span><span class="price">{format_number number=$TAXED_PRICE} {currency attr="symbol"}</span></span>
{/loop}
{else}
<span class="regular-price"><span itemprop="price" class="price">{format_number number=$BEST_TAXED_PRICE} {currency attr="symbol"}</span></span>
{/if}
</div>
{if $hasBtn == true}
{form name="thelia.cart.add" } {form name="thelia.cart.add" }
<form id="form-product-details" action="{url path="/cart/add" }" method="post" class="form-product"> <form id="form-product-details" action="{url path="/cart/add" }" method="post" role="form" class="form-product">
{form_hidden_fields form=$form} {form_hidden_fields form=$form}
<input type="hidden" name="view" value="product"> <input type="hidden" name="view" value="product">
<input type="hidden" name="product_id" value="{$product_id}"> <input type="hidden" name="product_id" value="{$product_id}">
@@ -132,7 +126,6 @@
</fieldset> </fieldset>
</form> </form>
{/form} {/form}
{/if} {/if}
</div> </div>
</article><!-- /product --> </article><!-- /product -->
</li>