Page 1 of 1

Upgrade Item Quantity in Cart fails [SOLVED]

Posted: Tue Oct 13, 2020 4:19 am
by DaveRiba
Not sure if this is a bug or a setting
In the cart, if you try to change the quantity of an item, eg from 1 to 2, when you click the Refesh button, the page flashes and repaints with the original quantity.
Changing quantity in the cart does not seem to work.
Is there a setting that I missed? a configuration option? or is this a bug?

Thanks for all your help

Re: Upgrade Item Quantity in Cart fails

Posted: Tue Oct 13, 2020 4:25 am
by by mona

Re: Upgrade Item Quantity in Cart fails

Posted: Tue Oct 13, 2020 5:55 am
by straightlight
- Error / server access logs?
- .htaccess?
- config.php?
- admin/config.php?

Re: Upgrade Item Quantity in Cart fails

Posted: Fri Oct 16, 2020 7:28 am
by DaveRiba
Works in test, does not work in production
The offending line is 82 in default/template/checkout/cart.twig:
<button type="button" data-toggle="tooltip" title="{{ button_remove }}" class="btn btn-danger" onclick="voucher.remove('{{ voucher.key }}');"><i class="fa fa-times-circle"></i></button>

Looks like it is voucher.remove('{{ voucher.key }}');
Nothing in the logs.

OC 3.0.3.6
Default Theme
https://harbor-sales.com/index.php

Re: Upgrade Item Quantity in Cart fails

Posted: Fri Oct 16, 2020 8:34 am
by straightlight
DaveRiba wrote:
Fri Oct 16, 2020 7:28 am
Works in test, does not work in production
The offending line is 82 in default/template/checkout/cart.twig:
<button type="button" data-toggle="tooltip" title="{{ button_remove }}" class="btn btn-danger" onclick="voucher.remove('{{ voucher.key }}');"><i class="fa fa-times-circle"></i></button>

Looks like it is voucher.remove('{{ voucher.key }}');
Nothing in the logs.

OC 3.0.3.6
Default Theme
https://harbor-sales.com/index.php
These functions won't appear in the logs. Use the Developers Tool > Console tab to see the output.

Re: Upgrade Item Quantity in Cart fails

Posted: Fri Oct 16, 2020 11:58 am
by sw!tch
Your .htaccess or config isn't setup properly.

In your config - Ensure your HTTP_SERVER and HTTPS_SERVER are properly setup.

Looks like you have mismatched config (eg. http://www.domain.com and https://domain.com

Re: Upgrade Item Quantity in Cart fails

Posted: Fri Oct 16, 2020 2:13 pm
by letxobnav
I think the problem is in your checkout/cart/edit function.

Re: Upgrade Item Quantity in Cart fails

Posted: Fri Oct 16, 2020 2:56 pm
by xxvirusxx
It is a CORS issue.
Fix the issue with https and will work just fine.

Re: Upgrade Item Quantity in Cart fails

Posted: Fri Oct 16, 2020 3:56 pm
by letxobnav
yes, that makes sense with:
<form action="https://harbor-sales.com/index.php?rout ... /cart/edit" method="post" enctype="multipart/form-data">
from http and www

still, I see no CORS errors reported in the console.

Re: Upgrade Item Quantity in Cart fails

Posted: Fri Oct 16, 2020 9:14 pm
by xxvirusxx
Yes. my bad.

It is just redirection issue to https or bad config

Re: Upgrade Item Quantity in Cart fails

Posted: Fri Oct 16, 2020 9:39 pm
by DaveRiba
That was it.
HTTP and HTTPS in config.php need to point the same.
Solved the problem.
Thank you for the help

Re: Upgrade Item Quantity in Cart fails

Posted: Fri Oct 16, 2020 10:08 pm
by xxvirusxx
Edit the title and add [ Solved] before.