Post by haydent » Thu Jun 06, 2024 3:32 pm

when using api cart functions for existing customer does it create a new cart, or will it be the existing one the customer may have going ?

User avatar
Active Member

Posts

Joined
Wed Nov 09, 2011 9:50 am
Location - Sydney, Australia

Post by paulfeakins » Thu Jun 06, 2024 7:58 pm

haydent wrote:
Thu Jun 06, 2024 3:32 pm
when using api cart functions for existing customer does it create a new cart, or will it be the existing one the customer may have going ?
Why not try it and find out?

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by haydent » Fri Jun 07, 2024 6:13 am

im guessing this means you dont know :) i didnt think i could test it as it seems common opinion here that past versions of oc it didnt work or was complete,
but i noticed i think the admin add order feature uses it, and i was looking at the code and it seems a customers does have separate carts, one for themself and one for each api user.

User avatar
Active Member

Posts

Joined
Wed Nov 09, 2011 9:50 am
Location - Sydney, Australia

Post by JNeuhoff » Fri Jun 07, 2024 6:12 pm

It should use the customer's existing cart, see also the DB table oc_cart which contains both the api_id and customer_id.
However, there are some known issues with the usage of the API in OC 4.0.2.3, so you shouldn't rely on the API. Or use a stable OpenCart 3.0.3.9 or 3.0.4.0 version for a live website, or wait for the upcoming 4.1.0.0 or later.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by haydent » Sun Jun 09, 2024 4:05 pm

Hey thanks for the feedback, i was looking at that table and the models that work with it. Im already running 4.0.1.1 live, will upgrade some day but just exploring the existing state of the api in my version. From what i can see each api user would create their own version of a customers cart.

User avatar
Active Member

Posts

Joined
Wed Nov 09, 2011 9:50 am
Location - Sydney, Australia

Post by straightlight » Tue Jun 11, 2024 8:03 am

haydent wrote:
Sun Jun 09, 2024 4:05 pm
Hey thanks for the feedback, i was looking at that table and the models that work with it. Im already running 4.0.1.1 live, will upgrade some day but just exploring the existing state of the api in my version. From what i can see each api user would create their own version of a customers cart.
I would still await for at least OC v4.1.0.0+ before using the API due to the so many changes that were involved over the years. By using the built-in store instance as a model, you could take a look in the core on how it has been developed as part of the existing state. One specific location where you could also take a look would be in the catalog/controller/api/order.php file for more information.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by haydent » Mon Jul 01, 2024 6:12 pm

I did some more testing and i was a bit off, so each api user has thier own cart, separate from each customers cart,

User avatar
Active Member

Posts

Joined
Wed Nov 09, 2011 9:50 am
Location - Sydney, Australia
Who is online

Users browsing this forum: No registered users and 3 guests