Post by webit » Fri Jun 23, 2023 8:51 pm

In my payment method that I'm testing on OC4021 I have a condition to be available only above a certain order total. However when changing the content of a shopping cart to a lower value, the payment method is not reloaded and checked again. In this case the payment module is still available while it should not be. Is there are way to re-check the payment conditions after a cart update?

Newbie

Posts

Joined
Thu Jan 05, 2012 7:02 pm

Post by ADD Creative » Fri Jun 23, 2023 10:38 pm

How are you changing the cart contents? All the add, edit and remove methods in catalog/controller/checkout/cart.php clear the payment methods.

www.add-creative.co.uk


Guru Member

Posts

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

Post by webit » Sat Jun 24, 2023 12:59 am

I remove the item in the checkout from the cart popup, afterwards payment method and shipping method remain unchanged and are not checked for their conditions.

Image

Image

Newbie

Posts

Joined
Thu Jan 05, 2012 7:02 pm

Post by ADD Creative » Sat Jun 24, 2023 3:47 pm

I see what you mean. OpenCart 3.0.x used to redirect to the cart page if anything was removed from the cart at checkout. It seems OpenCart 4.0.2.1 does not. It won't let you checkout afterwards, but it's not very user friendly.

You could check if it's been reported on GitHub.

www.add-creative.co.uk


Guru Member

Posts

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

Post by webit » Sat Jun 24, 2023 7:12 pm

Thanks for your reply, with the previous versions of OC4 I did not experience this problem. Also I am able to proceed with the checkout after the cart change.

Newbie

Posts

Joined
Thu Jan 05, 2012 7:02 pm

Post by ADD Creative » Sat Jun 24, 2023 9:15 pm

If you can checkout, do you have a check for the $this->session->data['payment_method'] in your confirm method?

Such as this one.
https://github.com/opencart/opencart/bl ... hp#L23-L25

www.add-creative.co.uk


Guru Member

Posts

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

Post by webit » Tue Jun 27, 2023 4:45 pm

As I do not use the confirm function in my payment method I am not able to use this check, it would mean that I would have to re-code the entire extension to adapt. For now I regard this a bug in this latest version from OpenCart as also the payment totals are not updated using the default shipping/payment methods when making a cart change.

Image

Image

Newbie

Posts

Joined
Thu Jan 05, 2012 7:02 pm
Who is online

Users browsing this forum: No registered users and 3 guests