Price with options

  • Posts: 46
  • Thank you received: 1
11 years 6 months ago #68607

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.

  • Posts: 2334
  • Thank you received: 403
11 years 6 months ago #68632

Hi there,

You just have to edit the show_default view (in Display>Views) for product and replace these lines:

<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:
<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):
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.

  • Posts: 4
  • Thank you received: 0
8 years 8 months ago #211364

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!

Attachments:

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

  • Posts: 12953
  • Thank you received: 1778
8 years 8 months ago #211367

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.

  • Posts: 4
  • Thank you received: 0
8 years 8 months ago #211427

Hello Mohamed,

thank you for your answer.

Please kindly visit http://irodaszekfutar.hu/termekek/forgoszekek/product/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.

  • Posts: 4
  • Thank you received: 0
8 years 8 months ago #211437

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.

  • Posts: 20
  • Thank you received: 0
  • Hikashop Business
5 years 7 months ago #297359

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.

  • Posts: 81484
  • Thank you received: 13062
  • MODERATOR
5 years 7 months ago #297365

Hi,

The main price is now displayed by that 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.

  • Posts: 20
  • Thank you received: 0
  • Hikashop Business
5 years 7 months ago #297428

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.

  • Posts: 81484
  • Thank you received: 13062
  • MODERATOR
5 years 7 months ago #297431

Hi,

You can leave the other code yes.

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

  • Posts: 20
  • Thank you received: 0
  • Hikashop Business
5 years 7 months ago #298028

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.113 seconds
Powered by Kunena Forum