Option Price and Main Price - can it be combined

  • Posts: 301
  • Thank you received: 1
12 years 5 months ago #52944

Website product page doesn't look that great when a product has options as I get 2 prices showing - Price including the chosen option then the Main product price below it.

Prestashop and many others only show one price and this just changes if options are chosen.

Is there a a way I can do this in Hika?

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

  • Posts: 13201
  • Thank you received: 2322
12 years 5 months ago #52986

Hi Huski,

In HikaShop, by default only one price is displayed.
Do you set the options with characteristics, HikaShop > Products > Characteristics ?

When you manage variants, you can change the price, an then only one price is displayed, the default price OR the variant price.

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

  • Posts: 301
  • Thank you received: 1
12 years 5 months ago #53029

I am getting both the total price with options showing and the main price here. www.ecomad.com.au/ecomadBamboo/shop-cate...gory_pathway-47.html

If you see the 2 option boxes, the default option values don't have price assigned to them. The other options all have prices assigned as is needed but not sure you can.

1. I have created the main product page with price
2. I created characterstics for this product (x 2)
3. I created 2 products for the options in an unpublished category and then assigned the characteristics to them
4. I managed the characteristics for each of these "option" products and set prices on those variants which need them
5. Then back to the main product where I added these 2 option products.

It all works ok on the front end but it shows 2 price lines as you see.

I only want to see one price at any time and this price just changes accordingly.

Is it possible to also have the word "from" in product listings for any product that does have options (with prices) but only then. It should not show if there is only one price for that product and no variants at all.

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

  • Posts: 13201
  • Thank you received: 2322
12 years 5 months ago #53111

Hi,

You can hide the normal price when your product have options.
Edit the view: HikaShop > Display > Views, product / show_default.php

And replace:

	<span id="hikashop_product_price_main" class="hikashop_product_price_main">
		<?php
		if ($this->params->get('show_price')) {
			$this->row = & $this->element;
			$this->setLayout('listing_price');
			echo $this->loadTemplate();
		}

By:
	<?php if(empty($this->row->options)){?>
	<span id="hikashop_product_price_main" class="hikashop_product_price_main">
		<?php
		if ($this->params->get('show_price')) {
			$this->row = & $this->element;
			$this->setLayout('listing_price');
			echo $this->loadTemplate();
		}
	}?>

Last edit: 12 years 5 months ago by Xavier.

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

  • Posts: 301
  • Thank you received: 1
12 years 5 months ago #53420

Doesn't seem to work. I am replacing this:

<span id="hikashop_product_price_main" class="hikashop_product_price_main">
<?php
if ($this->params->get('show_price')) {
$this->row = & $this->element;
$this->setLayout('listing_price');
echo $this->loadTemplate();
}
$this->setLayout('show_block_dimensions');
echo $this->loadTemplate();
?>
</span>


WITH



<?php if(empty($this->row->options)){?>
<span id="hikashop_product_price_main" class="hikashop_product_price_main">
<?php
if ($this->params->get('show_price')) {
$this->row = & $this->element;
$this->setLayout('listing_price');
echo $this->loadTemplate();
}
}?>
</span>


And both prices are still showing up.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 5 months ago #53505

You should hide it with CSS:

#hikashop_product_price_main{display:none;}

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

  • Posts: 301
  • Thank you received: 1
12 years 5 months ago #53558

Thanks - if I use css to hide the main price - what about those products which dont have options and will need to show the main price?

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 5 months ago #53628

Then in that case CSS won't do.

The solution proposed by Xavier will be better. Just make sure that you're editing the view file for the correct template you're using on your front end.

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

  • Posts: 301
  • Thank you received: 1
12 years 5 months ago #53739

I thought that would be the case.

I have tried Xaviers recommendation but I can't seem to get it to work.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 5 months ago #53826

It should work though...

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

  • Posts: 301
  • Thank you received: 1
12 years 5 months ago #53879

This is the code in my product/show_default file (for front end) as it is now.

<span id="hikashop_product_price_main" class="hikashop_product_price_main">
<?php
if ($this->params->get('show_price')) {
$this->row = & $this->element;
$this->setLayout('listing_price');
echo $this->loadTemplate();
}
$this->setLayout('show_block_dimensions');
echo $this->loadTemplate();
?>
</span>


If I copy of this part as Xavier says

<span id="hikashop_product_price_main" class="hikashop_product_price_main">
<?php
if ($this->params->get('show_price')) {
$this->row = & $this->element;
$this->setLayout('listing_price');
echo $this->loadTemplate();
}

With this:

<?php if(empty($this->row->options)){?>
<span id="hikashop_product_price_main" class="hikashop_product_price_main">
<?php
if ($this->params->get('show_price')) {
$this->row = & $this->element;
$this->setLayout('listing_price');
echo $this->loadTemplate();
}
}?>

Then it doesn't work which I guess is due to the code:

$this->setLayout('show_block_dimensions');
echo $this->loadTemplate();
?>

I'm not a coder - should I just delete the above 3 lines - says show_block_dimensions - not sure if this is required for anything?

This is all the code between the spans - what might I be doing wrong when changing this?

<span id="hikashop_product_price_main" class="hikashop_product_price_main">
<?php
if ($this->params->get('show_price')) {
$this->row = & $this->element;
$this->setLayout('listing_price');
echo $this->loadTemplate();
}
$this->setLayout('show_block_dimensions');
echo $this->loadTemplate();
?>
</span>

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 5 months ago #53952

Of course, you need to keep the <?php and ?> tags and the span.
You should have that:
<?php if(empty($this->row->options)){?>
<span id="hikashop_product_price_main" class="hikashop_product_price_main">
<?php
if ($this->params->get('show_price')) {
$this->row = & $this->element;
$this->setLayout('listing_price');
echo $this->loadTemplate();
}
$this->setLayout('show_block_dimensions');
echo $this->loadTemplate();
?>
</span>
<?php } ?>

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

  • Posts: 301
  • Thank you received: 1
12 years 4 months ago #55268

None of this is working for me - I get a Parse Error when I change the code. See me previous post - thats what I am doing but nothing works. Have attached the entire show_default code as it is now if that helps.
See this product and notice there is $85 (which is main price) and then above it is the price with option. Don't want the $85.00 to appear if there are options.
www.ecomad.com.au/ecomadBamboo/shop-cate...gory_pathway-35.html

Attachments:

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 4 months ago #55353

Hi,

Your show_default file does not have the modification I talked about in my last message which will do what you want.

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

  • Posts: 301
  • Thank you received: 1
12 years 4 months ago #55472

Have attached the show_default again with the code. I replace what you mentioned but I get parse error.

Attachments:

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 4 months ago #55558

That is not possible:
}?>
$this->setLayout('show_block_dimensions');
echo $this->loadTemplate();
?>

it should be:
}
$this->setLayout('show_block_dimensions');
echo $this->loadTemplate();
?>

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

  • Posts: 301
  • Thank you received: 1
12 years 4 months ago #55585

Thanks
I tried again and am not getting an error at all but the 2 prices are still showing - the product main price shouldn't be showing at all if there is an options price - code attached.

Attachments:
Last edit: 12 years 4 months ago by Huski.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 4 months ago #55653

Ah yes, try to change the line:
<?php if(empty($this->row->options)){?>

to:
<?php if(empty($this->element->options)){?>

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

  • Posts: 301
  • Thank you received: 1
12 years 4 months ago #55753

Perfecto - that did it
Thanks

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

  • Posts: 301
  • Thank you received: 1
9 years 9 months ago #190931

Hi this is an old post from a few years ago but I have the same question again but with the latest Hikashop Essentials and latest Joomla 3 version.

I can't copy my old VIEWS from Joomla 2.5 site to this one as the code seems quite a lot different.

How do I combine the Main Price and Option price so only one price ever shows?

THanks

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

Time to create page: 0.085 seconds
Powered by Kunena Forum