Post by computerrivo » Tue Jun 04, 2024 4:40 pm

Good morning,
I use version 3.0.3.8
I tried using the opencart API but currently the only functions they have are those of consultation.
I would need to insert and modify products, attributes and categories via the API.
Has anyone had experience with this and can give me some advice?

Thank you

Newbie

Posts

Joined
Thu Feb 16, 2023 10:53 pm

Post by JNeuhoff » Tue Jun 04, 2024 5:37 pm

computerrivo wrote:
Tue Jun 04, 2024 4:40 pm
Good morning,
I use version 3.0.3.8
I tried using the opencart API but currently the only functions they have are those of consultation.
I would need to insert and modify products, attributes and categories via the API.
Has anyone had experience with this and can give me some advice?

Thank you
These features don't exist in the OpenCart API. If you want them you may have to search the OpenCart marketplace for a suitable extension, and if there isn't one, then find a professional developer on the Commercial Support section of this forum, to create one for you.

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


User avatar
Guru Member
Online

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by paulfeakins » Tue Jun 04, 2024 7:47 pm

computerrivo wrote:
Tue Jun 04, 2024 4:40 pm
Has anyone had experience with this and can give me some advice?
Better to avoid the API and write code that adds them using models.

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


User avatar
Legendary Member

Posts

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

Post by computerrivo » Wed Jun 05, 2024 1:05 am

So you're talking about creating a controller external to opencart, which then uses the opencart model to insert data into the database?
or is it better to copy the public function addProduct and use it to directly insert the data into the database?

but at that point I wonder, knowing which table the data should be inserted into, could we directly write a class in PHP that inserts the data into the db.

Could something like this work?
paulfeakins wrote:
Tue Jun 04, 2024 7:47 pm
computerrivo wrote:
Tue Jun 04, 2024 4:40 pm
Has anyone had experience with this and can give me some advice?
Better to avoid the API and write code that adds them using models.

Newbie

Posts

Joined
Thu Feb 16, 2023 10:53 pm

Post by JNeuhoff » Wed Jun 05, 2024 4:55 am

Why do you event want to use the OpenCart API for adding products in the first place? You can do it more easily via the OC admin backend, and for bulk imports you could use something like the Export/Import tool.

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


User avatar
Guru Member
Online

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by computerrivo » Wed Jun 05, 2024 3:50 pm

First of all, thanks for the replies and the advice,
I would like to use the API to provide an automated service and have the ability to use variables for product placement.
For example, a CRM that connects to the manufacturer's API, makes a series of changes to the product and, at regular intervals, checks the quantities available and quantities sold. at that point, for example, update the quantities on opencart. automatically.

Or, again by way of example, the manufacturer modifies the title or description of a new product and the CRM automatically, via the API, modifies the title.

doing this manually on a few products is doable. on many products this becomes impossible.

ecommerce currently has around 70,000 products.
at 8-hour intervals, the different producers change their stocks. (Dropshipping type)
every day they add or remove at least 3 products.

through the CRM we manage the changes.

from here, the CRM currently creates a CSV which we upload and OpenCart carries out the import.

Through the insertion and/or modification APIs, this operation could be done automatically and in a simpler way and with the possibility of better monitoring the changes and the progress of the modifications.

all this, done via CSV, takes much more time than a post API call and also in terms of resources, CSV is much more expensive.

I have currently duplicated the opencart model within the CRM and it seems to work quite well.
unlike CSVs, I no longer have timeout problems or anything similar.
but I wonder if it's the right way

Newbie

Posts

Joined
Thu Feb 16, 2023 10:53 pm

Post by paulfeakins » Wed Jun 05, 2024 7:44 pm

computerrivo wrote:
Wed Jun 05, 2024 3:50 pm
I would like to use the API to provide an automated service
Great, but don't use the OpenCart API, have some code that sits on OC and runs the relevant code when calling the supplier API. Contact us if you want paid help with it as we do this all the time.

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


User avatar
Legendary Member

Posts

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

Post by JNeuhoff » Wed Jun 05, 2024 8:27 pm

You could it implement as a cron-task on the OpenCart server, where the OC server could call the supplier's API for relevant products update and then put it into the OC database. Send me a PM if you need help, to get it done as a commercial job.

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


User avatar
Guru Member
Online

Posts

Joined
Wed Dec 05, 2007 3:38 am

Who is online

Users browsing this forum: No registered users and 20 guests