Post by 3zzy » Tue Aug 30, 2016 6:46 pm

Hi,

I've been looking at the architecture to create an extension that connects to both Opencart and my other database (MongoDB) that has the most up-to-date quantity and price information, and syncs data at an interval.

However, I was wondering if instead of an extension what if I modify the Opencart DB directly, would it cause any issues in the backend or with any modules etc? Just wanted to be sure before I go ahead.

To reiterate, is OK to add and/or update products or product details directly from the DB?

Thanks!

Newbie

Posts

Joined
Thu Aug 11, 2016 12:56 pm

Post by sarthakinfotech » Tue Aug 30, 2016 7:25 pm

hi
i dont think there will be any issue doing this as far as all relevant details in database is maintained.

Good Day,
Jagruti
opencart tips and tricks ,
opencart blogs , opencart extensions/themes , custom development.


User avatar
Active Member

Posts

Joined
Tue Aug 05, 2014 1:12 am
Location - india

Post by 3zzy » Tue Aug 30, 2016 7:39 pm

Ah glad to hear that.

Can someone confirm with certainty that its alright to add/update products directly from DB?

Thanks!

Newbie

Posts

Joined
Thu Aug 11, 2016 12:56 pm

Post by artcore » Tue Aug 30, 2016 8:09 pm

No problem at all but make sure you maintain relations across tables as OC doesn't have a foreign key check.
And please do a backup before each sync!

Are you planning to use a database sync tool?

It would be best imho if you can access the mongoDB via an interface/api so you could use php to update all related records by id.

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands

Post by 3zzy » Tue Aug 30, 2016 8:14 pm

Ah great, thanks for the confirmation!

No the two databases are not identical. mongodb has tons of other fields, I'm just going to use MPN as the common index between the two and update only price and quantity once the products are in OC, hope that should work without any issues?

Newbie

Posts

Joined
Thu Aug 11, 2016 12:56 pm

Post by artcore » Tue Aug 30, 2016 11:54 pm

Sounds good to me!
So out of curiosity, what are you using to sync them?

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands

Post by 3zzy » Thu Sep 01, 2016 9:03 pm

So I added a few Manufacturers directly to DB and although it shows the name fine in the Admin, but the image doesn't show up, not does it show in the frontend:

Error:
Brand not found!

... whereas manufacturers added via admin shows up fine. Am I missing something here?

Thanks

Newbie

Posts

Joined
Thu Aug 11, 2016 12:56 pm

Post by fido-x » Thu Sep 01, 2016 9:09 pm

Did you set the status to "Enabled"? If so, try clearing your cache (probably a good idea to do that anyway).

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by 3zzy » Thu Sep 01, 2016 9:14 pm

Manufacturer doesn't have enabled, but it turned out I didn't relate any manufacturer to the store in the manufacturer_to_store table. Done that and all good now, thanks though!

Newbie

Posts

Joined
Thu Aug 11, 2016 12:56 pm
Who is online

Users browsing this forum: No registered users and 8 guests