display a message when a combination does not exist
This commit is contained in:
committed by
Julien Chanseaume
parent
bd5dd4a172
commit
d105879fa1
@@ -36,6 +36,7 @@ var pseManager = (function($){
|
|||||||
"ref": $("#pse-ref"),
|
"ref": $("#pse-ref"),
|
||||||
"ean": $("#pse-ean"),
|
"ean": $("#pse-ean"),
|
||||||
"availability": $("#pse-availability"),
|
"availability": $("#pse-availability"),
|
||||||
|
"validity": $("#pse-validity"),
|
||||||
"quantity": $("#quantity"),
|
"quantity": $("#quantity"),
|
||||||
"promo": $("#pse-promo"),
|
"promo": $("#pse-promo"),
|
||||||
"new": $("#pse-new"),
|
"new": $("#pse-new"),
|
||||||
@@ -105,8 +106,10 @@ var pseManager = (function($){
|
|||||||
|
|
||||||
if ( ! pseId ) {
|
if ( ! pseId ) {
|
||||||
// not exists, revert
|
// not exists, revert
|
||||||
|
displayNotice();
|
||||||
setPseForm();
|
setPseForm();
|
||||||
} else {
|
} else {
|
||||||
|
$pse.validity.hide();
|
||||||
$pse.id.val(pseId);
|
$pse.id.val(pseId);
|
||||||
$pse.pseId = pseId;
|
$pse.pseId = pseId;
|
||||||
}
|
}
|
||||||
@@ -116,6 +119,15 @@ var pseManager = (function($){
|
|||||||
updateProductUI();
|
updateProductUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function displayNotice() {
|
||||||
|
var $validity = $pse.validity;
|
||||||
|
$validity.show('fast', function(){
|
||||||
|
setTimeout(function(){
|
||||||
|
$validity.hide('fast');
|
||||||
|
}, 3000);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function updateProductUI() {
|
function updateProductUI() {
|
||||||
var pse = PSE[$pse.pseId],
|
var pse = PSE[$pse.pseId],
|
||||||
name = [],
|
name = [],
|
||||||
|
|||||||
@@ -38,17 +38,17 @@
|
|||||||
<div class="product-price">
|
<div class="product-price">
|
||||||
<div class="price-container" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
|
<div class="price-container" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
|
||||||
<meta itemprop="category" content="{category attr="title"}">
|
<meta itemprop="category" content="{category attr="title"}">
|
||||||
<meta itemprop="itemCondition" itemscope itemtype="http://schema.org/NewCondition"> <!-- List of condition : NewCondition, DamagedCondition, UsedCondition, RefurbishedCondition -->
|
{* 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. -->
|
<meta itemprop="itemCondition" itemscope itemtype="http://schema.org/NewCondition">
|
||||||
|
{* List of currency : The currency used to describe the product price, in three-letter ISO format. *}
|
||||||
|
<meta itemprop="priceCurrency" content="{currency attr="symbol"}">
|
||||||
<link itemprop="availability" href="{$current_stock_href}" content="{$current_stock_content}" />
|
<link itemprop="availability" href="{$current_stock_href}" content="{$current_stock_content}" />
|
||||||
|
|
||||||
{if $IS_PROMO }
|
{if $IS_PROMO }
|
||||||
<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="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>
|
<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>
|
||||||
{else}
|
{else}
|
||||||
<span class="regular-price"><span itemprop="price" class="price">{format_number number=$BEST_TAXED_PRICE} {currency attr="symbol"}</span></span>
|
<span class="regular-price"><span itemprop="price" class="price">{format_number number=$BEST_TAXED_PRICE} {currency attr="symbol"}</span></span>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{if $hasBtn == true}
|
{if $hasBtn == true}
|
||||||
@@ -80,16 +80,11 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
{/form_field}
|
{/form_field}
|
||||||
|
|
||||||
<div class="form-group group-btn">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div>
|
<div>
|
||||||
<div class="product-btn">
|
<div class="product-btn">
|
||||||
<button type="submit" class="btn btn-cart">{intl l="Add to cart"}</button>
|
<button type="submit" class="btn btn-cart">{intl l="Add to cart"}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
{/form}
|
{/form}
|
||||||
|
|||||||
@@ -136,6 +136,11 @@
|
|||||||
<span class="old-price"><span class="price-label">{intl l="Regular Price:"} </span><span id="pse-price-old" class="price">{format_number number="{$TAXED_PRICE}"} {currency attr="symbol"}</span></span>
|
<span class="old-price"><span class="price-label">{intl l="Regular Price:"} </span><span id="pse-price-old" class="price">{format_number number="{$TAXED_PRICE}"} {currency attr="symbol"}</span></span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div id="pse-validity" class="validity alert alert-warning" style="display: none;" >
|
||||||
|
{intl l="Sorry but this combination does not exist."}
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{form name="thelia.cart.add" }
|
{form name="thelia.cart.add" }
|
||||||
|
|||||||
Reference in New Issue
Block a user