- Posts: 301
- Thank you received: 1
Option Price and Main Price - can it be combined
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.
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.
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.
You can hide the normal price when your product have options.
Edit the view: HikaShop > Display > Views, product / show_default.php
And replace:
By:
Please Log in or Create an account to join the conversation.
<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.
#hikashop_product_price_main{display:none;}
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
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.
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.
Please Log in or Create an account to join the conversation.
<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.
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.
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
Please Log in or Create an account to join the conversation.
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.
Please Log in or Create an account to join the conversation.
}?>
$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.
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.
Please Log in or Create an account to join the conversation.
<?php if(empty($this->row->options)){?>
to:
<?php if(empty($this->element->options)){?>
Please Log in or Create an account to join the conversation.
Thanks
Please Log in or Create an account to join the conversation.
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.