fixed issue for product page when there is only 1 PSE

This commit is contained in:
Julien Chanseaume
2014-07-31 06:07:44 +02:00
parent cab99af210
commit 867944f06c
2 changed files with 48 additions and 43 deletions

View File

@@ -55,6 +55,10 @@ var pseManager = (function($){
combinationValue = null, combinationValue = null,
combinationValueId = null; combinationValueId = null;
// initialization for the first default pse
$pse.pseId = $pse.id.val();
if (PSE_COUNT > 1) {
// get the select for options // get the select for options
$("#pse-options .pse-option").each(function(){ $("#pse-options .pse-option").each(function(){
var $option = $(this); var $option = $(this);
@@ -75,9 +79,6 @@ var pseManager = (function($){
+ combinationValue[0] + "</option>"); + combinationValue[0] + "</option>");
} }
// initialization for the first default pse
$pse.pseId = $pse.id.val();
if (PSE_COUNT > 1) {
setPseForm(); setPseForm();
} }
} }

View File

@@ -32,24 +32,28 @@
{block name="main-content"} {block name="main-content"}
{$product_id={product attr="id"}} {$product_id={product attr="id"}}
{$pse_count={count type="product_sale_elements" product="$product_id"}} {$pse_count=1}
{$check_availability={config key="check-available-stock" default="1"}} {$check_availability={config key="check-available-stock" default="1"}}
<div class="main"> <div class="main">
{loop name="product.details" type="product" id="{product attr="id"}" limit="1" with_prev_next_info="1"} {loop name="product.details" type="product" id="{product attr="id"}" limit="1" with_prev_next_info="1"}
<article id="product" class="col-main" role="main" itemscope itemtype="http://schema.org/Product"> <article id="product" class="col-main" role="main" itemscope itemtype="http://schema.org/Product">
{$pse_count=$PSE_COUNT}
<!-- Use the meta tag to specify content that is not visible on the page in any way --> <!-- Use the meta tag to specify content that is not visible on the page in any way -->
{loop name="brand.feature" type="brand" product="{$ID}"} {loop name="brand.feature" type="brand" product="{$ID}"}
<meta itemprop="brand" content="{$TITLE}"> <meta itemprop="brand" content="{$TITLE}">
{/loop} {/loop}
{*
{loop name="isbn.feature" type="feature" product="{$ID}" title="isbn"} {loop name="isbn.feature" type="feature" product="{$ID}" title="isbn"}
{loop name="isbn.value" type="feature_value" feature="{$ID}" product="{product attr="id"}"} {loop name="isbn.value" type="feature_value" feature="{$ID}" product="{product attr="id"}"}
<meta itemprop="productID" content="isbn:{$TITLE}"> <meta itemprop="productID" content="isbn:{$TITLE}">
{/loop} {/loop}
{/loop} {/loop}
*}
<section id="product-gallery"> <section id="product-gallery">
{ifloop rel="image.main"} {ifloop rel="image.main"}
<figure class="product-image"> <figure class="product-image">