Post by ianhaney50 » Mon Jun 30, 2025 6:57 pm

I'm using opencart 3.0.4.0 on a clients site I'm building/developing for them and the product price is 0.00 as the product has options so in a way the option prices become the products base price. I have managed to update the code for the cart to show the option price instead of the 0.00 and think it is half working as I select a option and add it to the cart and in the mini cart in the header it shows 1 item(s) - £0.00 and if I click on the cart button, it shows the correct price in the small dropdown but in the text on the button itself it don't show the option price but weird thing is when I refresh the page, it shows the option price so after I refresh the page/site, it shows 1 item(s) - £75.00

I'm not sure how to resolve the issue, I have tried different code to try and reload the mini cart after adding a product but it's not working, I'll be honest and I asked chatgpt to do the code for me, I know it's not 100% but thought it might give something pretty close but it's not working

Active Member

Posts

Joined
Fri Apr 29, 2016 4:21 am

Post by paulfeakins » Mon Jun 30, 2025 7:46 pm

ianhaney50 wrote:
Mon Jun 30, 2025 6:57 pm
I'll be honest and I asked chatgpt to do the code for me
Yeah luckily us web developers still have jobs at this point.

Anyway, why not just make the product price the price of the lowest option and make the other options the differences? That's how it's supposed to work.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by ianhaney50 » Mon Jun 30, 2025 7:53 pm

paulfeakins wrote:
Mon Jun 30, 2025 7:46 pm
Yeah luckily us web developers still have jobs at this point.

Anyway, why not just make the product price the price of the lowest option and make the other options the differences? That's how it's supposed to work.
I thought of that way and mentioned it a few times but the client is adamant they want it this way so need to work out a way on how to refresh the mini cart after a product is added

Active Member

Posts

Joined
Fri Apr 29, 2016 4:21 am

Post by paulfeakins » Mon Jun 30, 2025 8:04 pm

Well if a client is paying you to develop this you'd better learn to code it ;)

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by JNeuhoff » Mon Jun 30, 2025 9:00 pm

As paulfeakins suggested, set the product price to the lowest value option price, and the other option prices will show the higher price differences only. The mini cart always shows the calculated price correctly anyway. And there are extensions (such as our Instant Option Price Calculator) which instantly update the product price on the product page depending on the chosen option values.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member
Online

Posts

Joined
Wed Dec 05, 2007 3:38 am

Who is online

Users browsing this forum: lockiedownunder and 31 guests