- Posts: 424
- Thank you received: 11
like to have the price with option on top in show_default template
- BluepointWebdesign
-
Topic Author
- Offline
Less
More
4 years 11 months ago #337018
by BluepointWebdesign
like to have the price with option on top in show_default template was created by BluepointWebdesign
-- HikaShop version -- : 4..1.1
-- Joomla version -- : 3.10.2
-- PHP version -- : 7.4.x
Hello,
In the view of the show default template, we now have the price of the product or the product variant on top. In the bottom we get the full price with options. We would like to show the full price on top as well.. how can i accomplish that???
Hope you can help..
Thanks,
Mark
-- Joomla version -- : 3.10.2
-- PHP version -- : 7.4.x
Hello,
In the view of the show default template, we now have the price of the product or the product variant on top. In the bottom we get the full price with options. We would like to show the full price on top as well.. how can i accomplish that???
Hope you can help..
Thanks,
Mark
Please Log in or Create an account to join the conversation.
4 years 11 months ago #337020
by nicolas
Replied by nicolas on topic like to have the price with option on top in show_default template
Hi,
Moving the display of that price elsewhere in the interface is quite easy, you just have to move the "price with option" zone with the layout drag&drop interface when you're editing your show_default view file.
And if you don't have the interface because you've made too many modifications, you can move its code directly:
Duplicating it is more complex since you can only have one element with the same ID in HTML.
You would have to duplicate that code and change the ID in it, which means that you'll also have to edit the file option.php to add custom javascript code to handle that new ID.
For example, you could duplicate the code:
That would lead to the AJAX request to get the price with options being done twice instead of once each time, so it's not that nice, but it's way easier than modifying the code to copy the data after the AJAX request.
Moving the display of that price elsewhere in the interface is quite easy, you just have to move the "price with option" zone with the layout drag&drop interface when you're editing your show_default view file.
And if you don't have the interface because you've made too many modifications, you can move its code directly:
Code:
<!-- PRICE WITH OPTIONS -->
<?php
if($this->params->get('show_price')) {
?>
<span id="hikashop_product_price_with_options_main" class="hikashop_product_price_with_options_main">
</span>
<?php
}
?>
<!-- EO PRICE WITH OPTIONS -->
You would have to duplicate that code and change the ID in it, which means that you'll also have to edit the file option.php to add custom javascript code to handle that new ID.
For example, you could duplicate the code:
Code:
var target = d.getElementById("hikashop_product_price_with_options_main");
if(target)
o.xRequest("'.hikashop_completeLink('product&task=price'.$url_itemid,true,true).'", {mode:"POST",data:"price="+price_with_options.value,update:target});
Please Log in or Create an account to join the conversation.
- BluepointWebdesign
-
Topic Author
- Offline
Less
More
- Posts: 424
- Thank you received: 11
4 years 11 months ago #337064
by BluepointWebdesign
Replied by BluepointWebdesign on topic like to have the price with option on top in show_default template
Thanks,
This works fine..
Super!!
This works fine..
Super!!
Please Log in or Create an account to join the conversation.
- BluepointWebdesign
-
Topic Author
- Offline
Less
More
- Posts: 424
- Thank you received: 11
4 years 11 months ago #337148
by BluepointWebdesign
Replied by BluepointWebdesign on topic like to have the price with option on top in show_default template
Please Log in or Create an account to join the conversation.
4 years 11 months ago #337156
by nicolas
Replied by nicolas on topic like to have the price with option on top in show_default template
Hi,
Well, HikaShop displays the price by default.
So there is nothing to do normally.
Which means that you've removed the display of the default price to only display the price with options. And of course, the price with options doesn't display when there are no options.
The system isn't made to display the price with options when there are no options. That would require complex changes.
I would rather recommand that you display the normal price displayed by HikaShop by default. And then, if you only want to display it when there are no options that's quite easy. You can just have that code like that:
Well, HikaShop displays the price by default.
So there is nothing to do normally.
Which means that you've removed the display of the default price to only display the price with options. And of course, the price with options doesn't display when there are no options.
The system isn't made to display the price with options when there are no options. That would require complex changes.
I would rather recommand that you display the normal price displayed by HikaShop by default. And then, if you only want to display it when there are no options that's quite easy. You can just have that code like that:
Code:
if(empty($this->element->options)) {
// default code of HikaShop to display the price without the options
}
Please Log in or Create an account to join the conversation.
- BluepointWebdesign
-
Topic Author
- Offline
Less
More
- Posts: 424
- Thank you received: 11
4 years 11 months ago #337222
by BluepointWebdesign
Replied by BluepointWebdesign on topic like to have the price with option on top in show_default template
Hi Nicolas,
Thanks for the reply. In which file do i need to have this code?
In the view -> product/options.php or the show_default?
Tried both,
but can not get the main price to show up..
Hope you can help a little more..
Thanks.
Thanks for the reply. In which file do i need to have this code?
In the view -> product/options.php or the show_default?
Tried both,
but can not get the main price to show up..
Hope you can help a little more..
Thanks.
Please Log in or Create an account to join the conversation.
- BluepointWebdesign
-
Topic Author
- Offline
Less
More
- Posts: 424
- Thank you received: 11
4 years 11 months ago #337227
by BluepointWebdesign
Replied by BluepointWebdesign on topic like to have the price with option on top in show_default template
Hey Nicolas,
Thanks.. I think i figure it out.. and now it seems like it goes the way we want to have it..
I will check on multiple products to see ..
I am allready happy so far..
Thanks.. I think i figure it out.. and now it seems like it goes the way we want to have it..
I will check on multiple products to see ..
I am allready happy so far..
Please Log in or Create an account to join the conversation.
Time to create page: 0.131 seconds