Post by open_user » Sat Dec 01, 2018 7:12 am

Hi,
I have my prices in the options, so the price displayed is always 0. The option is mandatory and it is a radio button.
How can I display the first option checked by default? (when I open the page). I only checked the product.twig, and there is not where I should look...
How can I display, instead of the price of the product, the price of the selected price? I am using opencart 3.0.2, and there the product.twig has the arrays with the options prices, but I am new and I don't know how to trick it...

Any help is welcome.

Newbie

Posts

Joined
Wed Jun 06, 2018 10:10 am

Post by synapseindia » Sat Dec 01, 2018 2:01 pm

You can play with javascript to make it possible .
On load you can set first option selected for all option uisng each function of jquery.
Also, for price changes you can use recalculate price after option selected . below is the extension link -
https://www.opencart.com/index.php?rout ... n_id=28909

Thanks

User avatar
Active Member

Posts

Joined
Thu Apr 05, 2018 2:27 pm

Post by open_user » Sun Dec 02, 2018 8:57 am

Thanks a lot!
I will translate it into 3.0.2.
Thanks again.

Newbie

Posts

Joined
Wed Jun 06, 2018 10:10 am

Post by open_user » Sun Dec 02, 2018 8:58 am

synapseindia wrote:
Sat Dec 01, 2018 2:01 pm
You can play with javascript to make it possible .
On load you can set first option selected for all option uisng each function of jquery.
Also, for price changes you can use recalculate price after option selected . below is the extension link -
https://www.opencart.com/index.php?rout ... n_id=28909

Thanks
Thanks a lot!
I will translate it into 3.0.2.
Thanks again.

Newbie

Posts

Joined
Wed Jun 06, 2018 10:10 am

Post by synapseindia » Mon Dec 03, 2018 2:58 pm

Great (y)

User avatar
Active Member

Posts

Joined
Thu Apr 05, 2018 2:27 pm

Post by open_user » Sat Dec 15, 2018 5:00 pm

synapseindia wrote:
Mon Dec 03, 2018 2:58 pm
Great (y)
Just for the record, I've found a free extension, live options (called Ajax live options) that work with Opencart 3.x, after a few modifications.
1 - In config.php, change the HTTP definition's url to https
2 - Manually modify all the steps in the install.xml, because if not it goes to the cache, and the moment you touch your product.twig, it will stop working.

Newbie

Posts

Joined
Wed Jun 06, 2018 10:10 am

Post by synapseindia » Tue Dec 18, 2018 2:57 pm

Its better to use OCMOD instead manual customization.

User avatar
Active Member

Posts

Joined
Thu Apr 05, 2018 2:27 pm

Post by Sadhik Hussain » Wed Feb 13, 2019 3:02 pm

Hello @open_user

once you checked the first checkbox option by default you can use this java script code to update the price by default .

$(window).load(function(){
if ($('#checkbox_id').is(':checked') == true) {
changePrice();
}
});


Posts

Joined
Tue Sep 25, 2018 5:31 pm
Who is online

Users browsing this forum: Anthony101990Jones and 178 guests