- Posts: 447
- Thank you received: 20
Show main Price
-- Joomla version -- : 3.9.18
Hi
I have products with variants and use the dropdown to select the price options. I would like to display the main price at the top of the product description, ideally below the ETA field as per the attachment.
Thanks
Dave
Please Log in or Create an account to join the conversation.
For this I see 2 solutions :
1. Directly add the main price in the description part, and if needed some html tag
=> This solution will be enough IF there are for all you customers the same price, I mean not location specific taxes from different area.
2. The other solution is create an override view, this will required html & php knowledge.
=> See this tutorial , and in details you will have to find the part that manage the main price, and duplicate it to add it where you need it, before description part.
Hope this will help you to get what you need.
Regards
Please Log in or Create an account to join the conversation.
I had found that code already. However copying it to the another position displays the deposit price which is the first characteristic. I need the full price displayed only at the top. The site is live and has a fairly large inventory so adding it as part of the description is not really an option.
Thanks
Dave
Please Log in or Create an account to join the conversation.
I'm not sure to follow you can you what do you mean by the first characteristics price ? And the difference in your mind with the full price ?
But I will details the override process in order to guide you.
1. Have a look from Main HikaShop Configuration, in Advanced tab, and in first Advanced settings part
This option will add on the frontend view reference that display each part.
2. From this in the show_default view you will have some code that call the view listing_price view, the idea is to add this "view call" to have the main price display, by main I mean default product variant but I'm awaiting news from you to better understand this point.
Hope this will help you to progress on your subject.
Regards
Please Log in or Create an account to join the conversation.
I have this code but when adding it to the default show it displays the lower price as this is set as the default in the characteristics.
The full price would be £19.99 for instance the default characteristics price is £0.01 which is what is displayed if I add the code.
Thanks
Dave
Please Log in or Create an account to join the conversation.
In product / show.php $this->row is likely the last variant of the product.
While the main product information is in $this->element->main (if the product has variants), or $this->element (without variants).
So I think you want to adapt that variable in your custom code.
Please Log in or Create an account to join the conversation.
yes the products have a variant. The variant lower price is the default. The main price is £79.99 for instance this is what I would like to display at the top of the description.
Thanks
David
Please Log in or Create an account to join the conversation.
I think you can just use this code then:
Please Log in or Create an account to join the conversation.
sorry but that code displays the deposit amount which is what I am trying to avoid. Please see the screenshot.
Basically the code like others I have tried displays the lowest price variant price where as I need to show the full price.
Thanks
David
Please Log in or Create an account to join the conversation.
The code I gave displays the price of the default variant.
If the full price is in the main product (which I'm guessing from your messages), then you can use this code instead:
Please Log in or Create an account to join the conversation.
thanks very much for the code, spot on!!
David
Please Log in or Create an account to join the conversation.
sorry the code hasn't quite fixed it for me. If there are no variants then the price shows as 0. Please see attached screenshot. Would appreciate your help?
Thanks
David
Please Log in or Create an account to join the conversation.
Maybe you can add a check condition in order to adapt the code to display from current product configuration :
if (isset($variants)) {
=> Use custom code
}
else {
=> Use default code
}
Hope this will help you.
Regards
Please Log in or Create an account to join the conversation.
Can you please provide a full code as I cannot see how this can be implemented?
Thanks
David
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
all seems to be working now as expected. Thanks very much for your help with this
Dave
Please Log in or Create an account to join the conversation.