-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with cart edit method. #3045
Comments
Hey, |
The right place to post your issue is here: http://forum.opencart.com Greetings! |
Okay thanks. |
Yes, this is the right place for posting bugs, but your issues is closed because Daniel considers it is not a bug...that's all :) |
I am not sure you have checked my explanation or not. This is surely bug. You can try update method and pass quantity as integer and you will get error. I am using latest version of opencart. |
Hi,
I was working on project and for that I need custom cart page. SO to update cart item I used cart.update method which is located in common.js file
This function is passing data like this:
Line no 178 in common.js
data: 'key=' + key + '&quantity=' + (typeof(quantity) != 'undefined' ? quantity : 1),
Means it is passing integer or string quantity value.
Now look at controller.
In controller checkout/cart.php file you can find public function edit() { at line no 391
Function is something like this:
This function assume quantity value as array and running foreach loop. But in common.js update method, it is passing string or integer.
So error generates Invalid argument to supplied to foreach.
So I think in this function need to check if value is array or not.
I am little bit familiar with opencart structure but this is just my second opencart project.
So if I am doing wrong here. Please point me. I am not sure common.js is common or it is based on theme.
Let me know if any questions.
Thanks.
The text was updated successfully, but these errors were encountered: