Gareth Gillman
Gareth Gillman

Reputation: 353

Opencart not adding product options to cart

I have an opencart site developed for a client and 99% works fine except one annoying bug which is driving my client nuts, if a customer adds a product to the cart, it doesn't send the product option e.g. colour. and this then doesn't appear on the order in the admin, and my client has to ring the customer to get the order details.

My first thought was a server issue (max_vars etc) but this isn't the issue, I added another theme and it works fine.

I have checked my code and it's identical to the default theme (which works fine) and the only errors in the OC errors.txt is a category_id which shouldn't affect the cart system.

The website is http://goo.gl/2naK6n if you go to cycle and select the 3rd item in the top row.

Any help would be appreciated

Upvotes: 0

Views: 1654

Answers (1)

Jonid Bendo
Jonid Bendo

Reputation: 880

Lets see i can not seem to find the exact error, and it really is a hustle to check the whole code so i will make a suggestion hoping it will fix it :), you should try and change the ajax code in the $('#button-cart').bind('click', function() { by replacing:

data: $('input[type=\'text\'], input[type=\'hidden\'], input[type=radio]:checked, input[type=checkbox]:checked, select, textarea'),

with

data: $('.product-info input[type=\'text\'], .product-info input[type=\'hidden\'], .product-info input[type=\'radio\']:checked, .product-info input[type=\'checkbox\']:checked, .product-info select, .product-info textarea'),

with this approach you specify in more accurate way the relation between products and options,

hope it solves your problem.

Upvotes: 1

Related Questions