Post by johnp » Thu Apr 25, 2024 5:10 am

Hi all,

Does any one know how to get around this problem.

I have an OC site selling event tickets. I have assigned an option to the ticket for the event attendees name. For each ticket that is added to the basket the name option must be filled in. The problem I'm having is sometimes the event ticket number is going up for the same attendee. Here's an example.

Ticket price £10 - Attendee name = Steve. This is correct.

If there are say two Steves on the same booking I should get this:

Ticket price £10 - Attendee name = Steve.
Ticket price £10 - Attendee name = Steve.

What I'm getting is:

Ticket price £10 - Attendee name = Steve with quantity of 2 in the cart @£20.

I have removed the quantity option from the product page. I have also removed it from the cart page. Still no luck. What I'm looking to do is have OC limit each ticket to the value of 1 each time. Each time another ticket is added it creates a new line in the cart for it and not double up on the original ticket.

I should be able to fix this but sadly I'm stuck. All help is appreciated.

OC 1.5.6.5. OC Bootstrap Pro theme. PHP 7.4

Opencart 1.5.6.5/OC Bootstrap Pro/VQMOD lover, user and geek.
Affordable Service £££ - Opencart Installs, Fixing, Development and Upgrades
Plus Ecommerce, Marketing, Mailing List Management and More
FREE Guidance and Advice at https://www.ecommerce-help.co.uk


User avatar
Active Member

Posts

Joined
Fri Mar 25, 2011 10:25 am
Location - Surrey, UK

Post by ADD Creative » Thu Apr 25, 2024 5:31 am

The bit of code you want to look at is in system/library/cart.php.
https://github.com/opencart/opencart/bl ... #L318-L340

The add function adds the option to the product ID and uses this as the key in the cart. You would need to somehow make the key unique without changing the data, such as maybe adding a time.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by johnp » Thu Apr 25, 2024 5:56 am

ADD Creative wrote:
Thu Apr 25, 2024 5:31 am
The bit of code you want to look at is in system/library/cart.php.
https://github.com/opencart/opencart/bl ... #L318-L340

The add function adds the option to the product ID and uses this as the key in the cart. You would need to somehow make the key unique without changing the data, such as maybe adding a time.
Many thanks. I'll take a look but I think that is a bit above me. I may have to post in the commercial forum. :)

Opencart 1.5.6.5/OC Bootstrap Pro/VQMOD lover, user and geek.
Affordable Service £££ - Opencart Installs, Fixing, Development and Upgrades
Plus Ecommerce, Marketing, Mailing List Management and More
FREE Guidance and Advice at https://www.ecommerce-help.co.uk


User avatar
Active Member

Posts

Joined
Fri Mar 25, 2011 10:25 am
Location - Surrey, UK

Post by johnp » Thu Apr 25, 2024 5:58 am

FYI this is the site:

https://alternativeview.co.uk

You'll see the problem if you add two of the same products to the cart with two attendee names the same.

Opencart 1.5.6.5/OC Bootstrap Pro/VQMOD lover, user and geek.
Affordable Service £££ - Opencart Installs, Fixing, Development and Upgrades
Plus Ecommerce, Marketing, Mailing List Management and More
FREE Guidance and Advice at https://www.ecommerce-help.co.uk


User avatar
Active Member

Posts

Joined
Fri Mar 25, 2011 10:25 am
Location - Surrey, UK
Who is online

Users browsing this forum: No registered users and 11 guests