Jump to content

Price dont change in product page in combinations (but when add to cart price is ok)


Recommended Posts

Hi, i have a little problem with product.tpl file of my theme, if I replace for the default product.tpl of Prestashop, product page shows correctly the price in combinations, however the design of product page is bad, so I think that the problem could be solved changing 1 or 2 lines of html code, but I can't found the wrong code.

 

You can see the example here http://www.tiendaesp.../capacidad-8_gb

 

When I select 8 gb the price dont change, but if I add to cart, the price is correct, I would be very happy if anyone could help me with this problem and say me which could be the problem, this is the html code of my product.tpl.

 

Thanks

 

{* * 2007-2012 PrestaShop * * NOTICE OF LICENSE * * This source file is subject to the Academic Free License (AFL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/afl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to [email protected] so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA * @copyright 2007-2012 PrestaShop SA * @version Release: $Revision: 6625 $ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA *} {include file="$tpl_dir./errors.tpl"} {if $errors|@count == 0} {include file="$tpl_dir./breadcrumb.tpl"}
{if isset($adminActionDisplay) && $adminActionDisplay}
{l s='This product is not visible to your customers.'}  

{/if} {if isset($confirmation) && $confirmation}
{$confirmation}
{/if}
{if $have_image}  {l s='View full size'} {else}  {l s='View full size'} {/if}
{if isset($images) && count($images) > 0}
{if isset($images) && count($images) > 3}{l s='Previous'}{/if}
{if isset($images)} {foreach from=$images item=image name=thumbnails} {assign var=imageIds value="`$product->id`-`$image.id_image`"}
{/foreach} {/if}
{if isset($images) && count($images) > 3}{l s='Next'}{/if}
{/if} {if isset($images) && count($images) > 1}
{l s='Display all pictures'}
{/if}
{if $HOOK_EXTRA_LEFT}{$HOOK_EXTRA_LEFT}{/if}
{l s='Print'} {if $have_image && !$jqZoomEnabled} {/if}
{$product->name|escape:'htmlall':'UTF-8'}
{*{if isset($colors) && $colors}
{l s='Pick a color:' js=1}
{foreach from=$colors key='id_attribute' item='color'}
{if file_exists($col_img_dir|cat:$id_attribute|cat:'.jpg')}{/if} {/foreach}
{/if}*} {if ($product->show_price AND !isset($restricted_country_mode)) OR isset($groups) OR $product->reference OR (isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS)}
quantity > 0}class="hidden"{/if} action="{$link->getPageLink('cart')}" method="post">
{if $product->show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE} {if !$priceDisplay || $priceDisplay == 2} {assign var='productPrice' value=$product->getPrice(true, $smarty.const.NULL, $priceDisplayPrecision)} {assign var='productPriceWithoutReduction' value=$product->getPriceWithoutReduct(false, $smarty.const.NULL)} {elseif $priceDisplay == 1} {assign var='productPrice' value=$product->getPrice(false, $smarty.const.NULL, $priceDisplayPrecision)} {assign var='productPriceWithoutReduction' value=$product->getPriceWithoutReduct(true, $smarty.const.NULL)} {/if}
{if $priceDisplay >= 0 && $priceDisplay <= 2} {convertPrice price=$productPrice} {/if} {if (!$allow_oosp && $product->quantity <= 0) OR !$product->available_for_order OR (isset($restricted_country_mode) AND $restricted_country_mode) OR $PS_CATALOG_MODE} {l s='Add to cart'} {else}
{l s='Add to cart'}
{/if}
quantity <= 0) OR $virtual OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}> minimal_quantity > 1}onkeyup="checkMinimalQuantity({$product->minimal_quantity});"{/if} /> {l s='Quantity:'}
{if $product->on_sale} {l s='On sale!'} {elseif $product->specificPrice AND $product->specificPrice.reduction AND $productPriceWithoutReduction > $productPrice} {l s='Reduced price!'} {/if} {if $product->online_only}
{l s='Online only'}
{/if}
specificPrice OR $product->specificPrice.reduction_type != 'percentage'} style="display:none;"{/if}>{if $product->specificPrice AND $product->specificPrice.reduction_type == 'percentage'}-{$product->specificPrice.reduction*100}%{/if}
specificPrice OR $product->specificPrice.reduction_type != 'amount' && $product->specificPrice.reduction|intval ==0} style="display:none"{/if}>{if $product->specificPrice AND $product->specificPrice.reduction_type == 'amount' && $product->specificPrice.reduction|intval !=0}-{convertPrice price=$product->specificPrice.reduction|floatval}{/if}
{if $product->specificPrice AND $product->specificPrice.reduction}
{if $priceDisplay >= 0 && $priceDisplay <= 2} {if $productPriceWithoutReduction > $productPrice} {convertPrice price=$productPriceWithoutReduction} {/if} {/if}
{/if}
{if $priceDisplay == 2} {convertPrice price=$product->getPrice(false, $smarty.const.NULL)} {l s='tax excl.'} {/if} {if $packItems|@count && $productPrice < $product->getNoPackPrice()}
{l s='instead of'} {convertPrice price=$product->getNoPackPrice()}
{/if} {if $product->ecotax != 0}
{l s='include'} {if $priceDisplay == 2}{$ecotax_tax_exc|convertAndFormatPrice}{else}{$ecotax_tax_inc|convertAndFormatPrice}{/if} {l s='for green tax'} {if $product->specificPrice AND $product->specificPrice.reduction}
{l s='(not impacted by the discount)'} {/if}
{/if} {if !empty($product->unity) && $product->unit_price_ratio > 0.000000} {math equation="pprice / punit_price" pprice=$productPrice punit_price=$product->unit_price_ratio assign=unit_price}
{convertPrice price=$unit_price} {l s='per'} {$product->unity|escape:'htmlall':'UTF-8'}
{/if}
{*close if for show price*} {/if} {if isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS}{$HOOK_PRODUCT_ACTIONS}{/if}

quantity <= 0 && !$product->available_later && $allow_oosp) OR ($product->quantity > 0 && !$product->available_now) OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}> {l s='Availability:'} quantity <= 0} class="warning_inline"{/if}> {if $product->quantity <= 0}{if $allow_oosp}{$product->available_later}{else}{l s='This product is no longer in stock'}{/if}{else}{$product->available_now}{/if}
{if ($display_qties == 1 && !$PS_CATALOG_MODE && $product->available_for_order)}
quantity <= 0} style="display: none;"{/if}> {$product->quantity|intval} quantity > 1} style="display: none;"{/if} id="quantityAvailableTxt">{l s='item in stock'} quantity == 1} style="display: none;"{/if} id="quantityAvailableTxtMultiple">{l s='items in stock'}
{/if}
minimal_quantity <= 1 OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}> {l s='This product is not sold individually. You must select at least'} {$product->minimal_quantity} {l s='quantity for this product.'}
{if $product->minimal_quantity > 1} {/if}
quantity > $last_qties OR $product->quantity <= 0) OR $allow_oosp OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none"{/if} >{l s='Warning: Last items in stock!'}
{if isset($groups)}
{foreach from=$groups key=id_attribute_group item=group} {if $group.attributes|@count}  {/if} {/foreach}
{/if}
reference}style="display: none;"{/if}> {l s='Reference:'} {$product->reference|escape:'htmlall':'UTF-8'}
{if $product->description_short OR $packItems|@count > 0}
{if $product->description_short}
{$product->description_short}
{/if} {if $product->description}
{l s='More details'}
{/if} {if $packItems|@count > 0}
{l s='Pack content'}
{foreach from=$packItems item=packItem}
{$packItem.pack_quantity} x {$packItem.name|escape:'htmlall':'UTF-8'}
{$packItem.description_short}
{/foreach}
{/if}
{/if}
quantity > 0} style="display: none;"{/if}> {$HOOK_PRODUCT_OOS}
-->

{/if} {if isset($HOOK_EXTRA_RIGHT) && $HOOK_EXTRA_RIGHT}{$HOOK_EXTRA_RIGHT}{/if}
{if (isset($quantity_discounts) && count($quantity_discounts) > 0)}
{l s='Quantity discount'}
{l s='product'}
{l s='from (qty)'}
{l s='discount'}
{foreach from=$quantity_discounts item='quantity_discount' name='quantity_discounts'}
{if (isset($quantity_discount.attributes) && ($quantity_discount.attributes))} {$product->getProductName($quantity_discount.id_product, $quantity_discount.id_product_attribute)} {else} {$product->getProductName($quantity_discount.id_product)} {/if}
{$quantity_discount.quantity|intval}
{if $quantity_discount.price >= 0 OR $quantity_discount.reduction_type == 'amount'} -{convertPrice price=$quantity_discount.real_value|floatval} {else} -{$quantity_discount.real_value|floatval}% {/if}
{/foreach}
{/if} {if isset($HOOK_PRODUCT_FOOTER) && $HOOK_PRODUCT_FOOTER}{$HOOK_PRODUCT_FOOTER}{/if} {if (isset($product) && $product->description) || (isset($features) && $features) || (isset($accessories) && $accessories) || (isset($HOOK_PRODUCT_TAB) && $HOOK_PRODUCT_TAB) || (isset($attachments) && $attachments) || isset($product) && $product->customizable}
{if $product->description}
{l s='More info'}{/if} {if $features}
{l s='Data sheet'}{/if} {if $attachments}
{l s='Download'}{/if} {if isset($accessories) AND $accessories}
{l s='Accessories'}{/if} {if isset($product) && $product->customizable}
{l s='Product customization'}{/if} {$HOOK_PRODUCT_TAB}
{if isset($product) && $product->description}
{$product->description}
{/if} {if isset($features) && $features}
{foreach from=$features item=feature} {if isset($feature.value)}
{$feature.name|escape:'htmlall':'UTF-8'} {$feature.value|escape:'htmlall':'UTF-8'} {/if} {/foreach}
{/if} {if isset($attachments) && $attachments}
{foreach from=$attachments item=attachment}
{$attachment.name|escape:'htmlall':'UTF-8'}
{$attachment.description|escape:'htmlall':'UTF-8'} {/foreach}
{/if} {if isset($accessories) AND $accessories}
{foreach from=$accessories item=accessory name=accessories_list} {if ($accessory.allow_oosp || $accessory.quantity > 0) AND $accessory.available_for_order AND !isset($restricted_country_mode)} {assign var='accessoryLink' value=$link->getProductLink($accessory.id_product, $accessory.link_rewrite, $accessory.category)}

{$accessory.name|escape:'htmlall':'UTF-8'}
{$accessory.description_short|strip_tags|truncate:400:'...'}
{if $accessory.show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE} {if $priceDisplay != 1}{displayWtPrice p=$accessory.price}{else}{displayWtPrice p=$accessory.price_tax_exc}{/if}{/if} {if !$PS_CATALOG_MODE} {l s='Add to cart'} {/if}
{/if} {/foreach}
{/if} {if isset($product) && $product->customizable}
{l s='After saving your customized product, remember to add it to your cart.'} {if $product->uploadable_files}
{l s='Allowed file formats are: GIF, JPG, PNG'}{/if}
{if $product->uploadable_files|intval}
{l s='Pictures'}
{counter start=0 assign='customizationField'} {foreach from=$customizationFields item='field' name='customizationFields'} {if $field.type == 0}
{assign var='key' value='pictures_'|cat:$product->id|cat:'_'|cat:$field.id_customization_field} {if isset($pictures.$key)}

{/if}
{if !empty($field.name)}{$field.name}{else}{l s='Please select an image file from your hard drive'}{/if}{if $field.required}*{/if}
{counter} {/if} {/foreach}
{/if} {if $product->text_fields|intval}
{l s='Text'}
{counter start=0 assign='customizationField'} {foreach from=$customizationFields item='field' name='customizationFields'} {if $field.type == 1}
{assign var='key' value='textFields_'|cat:$product->id|cat:'_'|cat:$field.id_customization_field} {if !empty($field.name)}{$field.name}{/if}{if $field.required}*{/if}  {counter} {/if} {/foreach}
{/if}

* {l s='required fields'}
{/if} {if isset($HOOK_PRODUCT_TAB_CONTENT) && $HOOK_PRODUCT_TAB_CONTENT}{$HOOK_PRODUCT_TAB_CONTENT}{/if}
{/if} {if isset($packItems) && $packItems|@count > 0}
{l s='Pack content'}
{include file="$tpl_dir./product-list.tpl" products=$packItems}
{/if} {/if}

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

I have the same issue, and I'm working on it right now. Which other product.tpl file are you using? Where are you getting it from? That way I can look for a solution too! My prices show 0.00 instead of the same. I have three protein shakes with three different flavors and the price should remain the same, but instead it shows $0.00. I'm going to try to add prices individually and see how it works.

 

See mine here http://www.wellnessisbeauty.com/es/batidas/19-metabolic-protein.html

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...
  • 4 weeks later...
  • 3 weeks later...
  • 5 months later...
  • 1 year later...

Solution is to make DIFF it is mean discover the difference between original file and what you have. And change this.

 

If you have custom and not default theme so you need to contact with developer to fix this.

 

The easiest way its just change whole theme folder.

 

Another theoretical problem its javascript errors what is block to execute code correctly.

To discover press f12 in Chrome and look at console messages to see what is wrong if any.

 

I hope its point all of you to right direction.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...