Jump to content

[SOLVED]Old price($productPriceWithoutReduction) with combination is not changed...


Recommended Posts

Hello!

I'm constructing new shop with prestashop 1.6.0.8 (latest).

When I set the combination to product and reduction,

The product price is shown correctly but the "old price(price before reduction)" is not changed by selecting another attribute type.

 

For example

 

 

Product A (size S) = 10 euro

Product A (size L) = 12 euro

 

After setting the reduction(10% off)

 

Product A (size S) = 9 euro (10euro) 10% OFF !

Product A (size L) = 10.8 euro (10euro) 10% OFF !

 

I changed the template file a lot so I don't understand this is some bug or my misstake of setting...

Here is my code of  product.tpl

 

<p class="our_price_display" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
    <link itemprop="availability" {if $product->
    quantity <= 0}href="http://schema.org/OutOfStock"{else}href="http://schema.org/InStock"{/if}>
<p id="old_price"{if (!$product->specificPrice || !$product->specificPrice.reduction) && $group_reduction == 1} class="hidden"{/if}>
    {if $priceDisplay >= 0 && $priceDisplay <= 2}
    {if $productPriceWithoutReduction > $productPrice}{convertPrice price=$productPriceWithoutReduction}{/if}
    <!-- {if $tax_enabled && $display_tax_label == 1}{if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}{/if} -->
    {/if} </p>
{if $priceDisplay >= 0 && $priceDisplay <= 2} <span id="our_price_display" itemprop="price">{convertPrice price=$productPrice} </span>
<!--{if $tax_enabled  && ((isset($display_tax_label) && $display_tax_label == 1) || !isset($display_tax_label))}
                                            {if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}
                                        {/if}-->
<meta itemprop="priceCurrency" content="{$currency->iso_code}" />
{/if}
</p>

Give me some advice please!
 

Edited by tatamimi (see edit history)
Link to comment
Share on other sites

I have the same problem :)

 

Im just need show the price of atributes and price reduction.

 

Just use this to show 2 prices in ProductController.php

$groups[$row['id_attribute_group']]['name_price'][$row['id_attribute']] = array('name' => $row['attribute_name'],'price' => Product::getPriceStatic((int)$this->product->id, false, $row['id_product_attribute'], 6, null, false, true, 1, false, null, null, null, $combination_specific_price), 'name' => $row['attribute_name'],'price2' => Product::getPriceWithoutReduct((int)$this->product->id, false, $row['id_product_attribute'], 6, null, false, true, 1, false, null, null, null, $combination_specific_price));

and product.tpl put this

{foreach from=$group.name_price key=id_attribute item=group_attribute}

									<li>

									<!--<input type="radio" class="attribute_radio" name="{$groupName}" value="{$id_attribute}" {if ($group.default == $id_attribute)} checked="checked"{/if} onclick="findCombination();getProductAttribute();" />-->
									<input atrib='1' type="radio" class="attribute_radio" name="{$groupName}" value="{$id_attribute}" onclick="findCombination();getProductAttribute();" />

									<span>{$group_attribute.name|escape:'htmlall':'UTF-8'}</span>

									<span style="float:right;"><strong><!--{$currencySign|html_entity_decode:2:"UTF-8"}--> 
									{convertPrice price=$group_attribute.price} - 
									{convertPrice price=$group_attribute.price2}</strong></span>

									</li>
								{/foreach}

But the function getPriceWithoutReduct doesnt work

  • Like 1
Link to comment
Share on other sites

I solved my case!

 

Referenced here.

http://www.prestashop.com/forums/topic/306932-solved-producttpl-display-the-price-2-times-with-attribute-price-changes-supported/

 

To show 2 prices with attribution (reduced price also) in 1 page, We have to fixed 2 different ID name to contain each price codes.

 

Sorry for my bad english...  I hope you will solve the same type of problem.

Edited by tatamimi (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...