Skip to main content

Price with options

14 years 1 month ago #68607 by ponygirl
Price with options was created by ponygirl
Hi

When i add an option with a price to a product it displays two prices on the product page

One the orignal price and the other price with options

Is there a way only to display the one price in the original price position with the new price?

Thanks

Please Log in or Create an account to join the conversation.

14 years 1 month ago #68632 by Eliot
Replied by Eliot on topic Re: Price with options
Hi there,

You just have to edit the show_default view (in Display>Views) for product and replace these lines:
Code:
<span id="hikashop_product_price_main" class="hikashop_product_price_main"> <?php //LAYOUT listing_price if ($this->params->get('show_price')) { $this->row = & $this->element; $this->setLayout('listing_price'); echo $this->loadTemplate(); } ?> </span>

with these ones:
Code:
<span id="hikashop_product_price_with_options_main" class="hikashop_product_price_with_options_main"> </span>

then remove this code (to avoid two display of the price):
Code:
if($this->params->get('show_price')){ ?> <span id="hikashop_product_price_with_options_main" class="hikashop_product_price_with_options_main"> </span> <?php } ?>
The following user(s) said Thank You: ponygirl

Please Log in or Create an account to join the conversation.

11 years 3 months ago #211364 by Ibrahim
Replied by Ibrahim on topic Re: Price with options
Hi there,

we would like to show price AND price with options also. It was alright for a while, but it has been disappeared and can not bring it back.
We use now the default "show_default.php" (as we think it should have shown the price with options by default).

Any js problem maybe?
Or alternatively we need simply to add some code like:

if($this->params->get('show_price')){ ?>
<span id="hikashop_product_price_with_options_main" class="hikashop_product_price_with_options_main">
</span>

It hasn't been working so far.

Alternatively we can get access to our site.

Thanks in advance!

Please Log in or Create an account to join the conversation.

11 years 3 months ago #211367 by Mohamed Thelji
Hello,
It's working fine on my end, if you correctly have that code on you "show_default" file, your issue can be coming from :
- Your JS
- The fact that you have set the "Display Price" option to NO via "Hikashop->System->Configuration->System->Display"
The following user(s) said Thank You: Ibrahim

Please Log in or Create an account to join the conversation.

11 years 3 months ago #211427 by Ibrahim
Replied by Ibrahim on topic Re: Price with options
Hello Mohamed,

thank you for your answer.

Please kindly visit irodaszekfutar.hu/termekek/forgoszekek/p...t/693-corvus-nf-8802 and you can see if I add an option from dropdown, the price is not changing at all and / or the price with options line is missing.

Can you please let us know which codesnippet has to be modified in "show_default" to see both PRICE and PRICE WITH OPTIONS?

Thanks a lot in advance!

Please Log in or Create an account to join the conversation.

11 years 3 months ago #211437 by Ibrahim
Replied by Ibrahim on topic Re: Price with options
Hi there,

we succesfully updated HikaShop to the latest version and it works fine now.

Thanks!

Please Log in or Create an account to join the conversation.

8 years 2 months ago #297359 by TwoFatFingers
Replied by TwoFatFingers on topic Price with options

ponygirl wrote: Hi

When i add an option with a price to a product it displays two prices on the product page

One the orignal price and the other price with options

Is there a way only to display the one price in the original price position with the new price?

Thanks


I would like to remove the second price as well please. (Am on Essential version 3.4.0). - the code has changed since this last entry and I did not see a button for it.
Looking forward to your reply.

Please Log in or Create an account to join the conversation.

8 years 2 months ago #297365 by nicolas
Replied by nicolas on topic Price with options
Hi,

The main price is now displayed by that code:
Code:
<span id="hikashop_product_price_main" class="hikashop_product_price_main" itemprop="offers" itemscope itemtype="https://schema.org/Offer"> <?php $main =& $this->element; if(!empty($this->element->main)) $main =& $this->element->main; if(!empty($main->product_condition)){ ?> <meta itemprop="itemCondition" itemtype="https://schema.org/OfferItemCondition" content="https://schema.org/<?php echo $main->product_condition; ?>" /> <?php } // LAYOUT listing_price if($this->params->get('show_price') && (empty($this->displayVariants['prices']) || $this->params->get('characteristic_display') != 'list')) { $this->row =& $this->element; $this->setLayout('listing_price'); echo $this->loadTemplate(); ?> <meta itemprop="availability" content="https://schema.org/<?php echo ($this->row->product_quantity != 0) ? 'InStock' : 'OutOfstock' ;?>" /> <meta itemprop="priceCurrency" content="<?php echo $this->currency->currency_code; ?>" /> <?php } ?> </span>
The other piece of code for the option price is still the same.

Please Log in or Create an account to join the conversation.

8 years 2 months ago #297428 by TwoFatFingers
Replied by TwoFatFingers on topic Price with options
Thank you for your reply.

So I replace that new code you supplied with:

<span id="hikashop_product_price_with_options_main" class="hikashop_product_price_with_options_main">
</span>

and then remove this code (to avoid two display of the price):

if($this->params->get('show_price')){ ?>
<span id="hikashop_product_price_with_options_main" class="hikashop_product_price_with_options_main">
</span>
<?php }

//there is other code here in newer version. Do I leave it?

?>

Please Log in or Create an account to join the conversation.

8 years 2 months ago #297431 by nicolas
Replied by nicolas on topic Price with options
Hi,

You can leave the other code yes.

Please Log in or Create an account to join the conversation.

8 years 1 month ago #298028 by TwoFatFingers
Replied by TwoFatFingers on topic Price with options
That's great, thanks! This actually removed the original price and only showed the price with options text, but by leaving everything and only removing the last bit that shows the duplicate, I achieved the result I want.

Thanks again!

Please Log in or Create an account to join the conversation.

Time to create page: 0.094 seconds
Powered by Kunena Forum