gabrielchiron Posted December 22, 2014 Share Posted December 22, 2014 Buenas no se que ocurre que ciertos productos tienen un descuento fantasma del 0%. No se si es que tengo puesto mal el condicional para sacar el descuento o que el productos por lo que sea tiene un descuento pero me saca esto por ejemplo: ¿Sabeis que puede ser? Un saludo! Link to comment Share on other sites More sharing options...
galindogadea Posted December 22, 2014 Share Posted December 22, 2014 (edited) Buenas no se que ocurre que ciertos productos tienen un descuento fantasma del 0%. No se si es que tengo puesto mal el condicional para sacar el descuento o que el productos por lo que sea tiene un descuento pero me saca esto por ejemplo: ¿Sabeis que puede ser? Un saludo! ¿Y has comprobado si con la plantilla por defecto, o en caso de que hayas modifcado la plantilla, con la plantilla original te pasa lo mismo? Edito: ¿Tu has añadido codigo en el tpl? ¿Qué codigo has añadido? (Lo digo para verlo..) Edited December 22, 2014 by galindogadea (see edit history) Link to comment Share on other sites More sharing options...
gabrielchiron Posted December 22, 2014 Author Share Posted December 22, 2014 Lo tengo muy editado. Esto es lo que le tengo puesto: <p id="ref-cart" class="ref"> {l s='Reference:'} {$product->reference|escape:'htmlall':'UTF-8'} </p> {if $product->specificPrice AND $product->specificPrice.reduction} <p id="old_price"><span> {if $priceDisplay >= 0 && $priceDisplay <= 2} {if $productPriceWithoutRedution > $productPrice} <span id="old_price_display">{convertPrice price=$productPriceWithoutRedution}</span> <!-- {if $tax_enabled && $display_tax_label == 1} {if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if} {/if} --> {/if} {/if} </span> </p> {/if} <p id="reduction_percent" {if !$product->specificPrice OR $product->specificPrice.reduction_type != 'percentage'} style="display:none;"{/if}><span id="reduction_percent_display">{if $product->specificPrice AND $product->specificPrice.reduction_type == 'percentage'}-{$product->specificPrice.reduction*100}%{/if}</span></p> <h2> {if !$priceDisplay || $priceDisplay == 2} {assign var='productPrice' value=$product->getPrice(true, $smarty.const.NULL, $priceDisplayPrecision)} {assign var='productPriceWithoutRedution' value=$product->getPriceWithoutReduct(false, $smarty.const.NULL)} {elseif $priceDisplay == 1} {assign var='productPrice' value=$product->getPrice(false, $smarty.const.NULL, $priceDisplayPrecision)} {assign var='productPriceWithoutRedution' value=$product->getPriceWithoutReduct(true, $smarty.const.NULL)} {/if} {if $priceDisplay >= 0 && $priceDisplay <= 2} {convertPrice price=$productPrice} {/if} </h2> <div> Link to comment Share on other sites More sharing options...
galindogadea Posted December 22, 2014 Share Posted December 22, 2014 Esto es el listado de productos u otra cosa¿? Viendo el fichero: /themes/default-bootstrap/product-list.tpl Viene algo asi: {if (!$PS_CATALOG_MODE AND ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))} <div class="content_price" itemprop="offers" itemscope itemtype="http://schema.org/Offer"> {if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)} <span itemprop="price" class="price product-price"> {if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if} </span> <meta itemprop="priceCurrency" content="{$currency->iso_code}" /> {if isset($product.specific_prices) && $product.specific_prices && isset($product.specific_prices.reduction) && $product.specific_prices.reduction > 0} {hook h="displayProductPriceBlock" product=$product type="old_price"} <span class="old-price product-price"> {displayWtPrice p=$product.price_without_reduction} </span> {if $product.specific_prices.reduction_type == 'percentage'} <span class="price-percent-reduction">-{$product.specific_prices.reduction * 100}%</span> {/if} {/if} {hook h="displayProductPriceBlock" product=$product type="price"} {hook h="displayProductPriceBlock" product=$product type="unit_price"} {/if} </div> {/if} Donde supongo que esto: {if isset($product.specific_prices) && $product.specific_prices && isset($product.specific_prices.reduction) && $product.specific_prices.reduction > 0} {hook h="displayProductPriceBlock" product=$product type="old_price"} <span class="old-price product-price"> {displayWtPrice p=$product.price_without_reduction} </span> {if $product.specific_prices.reduction_type == 'percentage'} <span class="price-percent-reduction">-{$product.specific_prices.reduction * 100}%</span> {/if} {/if} es el codigo clave de ese momento.. (creo*, ahora mismo no estoy seguro) Hablo de la 1.6 Link to comment Share on other sites More sharing options...
galindogadea Posted December 22, 2014 Share Posted December 22, 2014 Esto es el listado de productos u otra cosa¿? Viendo el fichero: /themes/default-bootstrap/product-list.tpl Viene algo asi: {if (!$PS_CATALOG_MODE AND ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))} <div class="content_price" itemprop="offers" itemscope itemtype="http://schema.org/Offer"> {if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)} <span itemprop="price" class="price product-price"> {if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if} </span> <meta itemprop="priceCurrency" content="{$currency->iso_code}" /> {if isset($product.specific_prices) && $product.specific_prices && isset($product.specific_prices.reduction) && $product.specific_prices.reduction > 0} {hook h="displayProductPriceBlock" product=$product type="old_price"} <span class="old-price product-price"> {displayWtPrice p=$product.price_without_reduction} </span> {if $product.specific_prices.reduction_type == 'percentage'} <span class="price-percent-reduction">-{$product.specific_prices.reduction * 100}%</span> {/if} {/if} {hook h="displayProductPriceBlock" product=$product type="price"} {hook h="displayProductPriceBlock" product=$product type="unit_price"} {/if} </div> {/if} Donde supongo que esto: {if isset($product.specific_prices) && $product.specific_prices && isset($product.specific_prices.reduction) && $product.specific_prices.reduction > 0} {hook h="displayProductPriceBlock" product=$product type="old_price"} <span class="old-price product-price"> {displayWtPrice p=$product.price_without_reduction} </span> {if $product.specific_prices.reduction_type == 'percentage'} <span class="price-percent-reduction">-{$product.specific_prices.reduction * 100}%</span> {/if} {/if} es el codigo clave de ese momento.. (creo*, ahora mismo no estoy seguro) Hablo de la 1.6 Eso del listado del productos, lo que es para la ficha del producto (product.tpl) veo esto: <p id="reduction_percent" {if !$product->specificPrice || $product->specificPrice.reduction_type != 'percentage'} style="display:none;"{/if}> <span id="reduction_percent_display"> {if $product->specificPrice && $product->specificPrice.reduction_type == 'percentage'}-{$product->specificPrice.reduction*100}%{/if} </span> </p> <p id="reduction_amount" {if !$product->specificPrice || $product->specificPrice.reduction_type != 'amount' || $product->specificPrice.reduction|floatval ==0} style="display:none"{/if}> <span id="reduction_amount_display"> {if $product->specificPrice && $product->specificPrice.reduction_type == 'amount' && $product->specificPrice.reduction|floatval !=0} -{convertPrice price=$productPriceWithoutReduction-$productPrice|floatval} {/if} </span> </p> <p id="old_price"{if (!$product->specificPrice || !$product->specificPrice.reduction) && $group_reduction == 0} class="hidden"{/if}> {if $priceDisplay >= 0 && $priceDisplay <= 2} {hook h="displayProductPriceBlock" product=$product type="old_price"} <span id="old_price_display">{if $productPriceWithoutReduction > $productPrice}{convertPrice price=$productPriceWithoutReduction}{if $tax_enabled && $display_tax_label == 1}{if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}{/if}{/if}</span> {/if} </p> Link to comment Share on other sites More sharing options...
gabrielchiron Posted December 22, 2014 Author Share Posted December 22, 2014 En mi caso es la 1.5 Link to comment Share on other sites More sharing options...
galindogadea Posted December 22, 2014 Share Posted December 22, 2014 En mi caso es la 1.5 En la 1.5.6.2, en la default viene este codigo para el product.tpl <p id="reduction_percent" {if !$product->specificPrice OR $product->specificPrice.reduction_type != 'percentage'} style="display:none;"{/if}><span id="reduction_percent_display">{if $product->specificPrice AND $product->specificPrice.reduction_type == 'percentage'}-{$product->specificPrice.reduction*100}%{/if}</span></p> <p id="reduction_amount" {if !$product->specificPrice OR $product->specificPrice.reduction_type != 'amount' || $product->specificPrice.reduction|intval ==0} style="display:none"{/if}> <span id="reduction_amount_display"> {if $product->specificPrice AND $product->specificPrice.reduction_type == 'amount' AND $product->specificPrice.reduction|intval !=0} -{convertPrice price=$productPriceWithoutReduction-$productPrice|floatval} {/if} </span> </p> <p id="old_price"{if !$product->specificPrice || !$product->specificPrice.reduction} class="hidden"{/if}> {if $priceDisplay >= 0 && $priceDisplay <= 2} <span id="old_price_display">{if $productPriceWithoutReduction > $productPrice}{convertPrice price=$productPriceWithoutReduction}{/if}</span> <!-- {if $tax_enabled && $display_tax_label == 1}{if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}{/if} --> {/if} </p> Link to comment Share on other sites More sharing options...
Recommended Posts