trucate DB table in magento - mysql

Magento itself provides some kind of API Structure (like the API System inside Laravel Nova) for all kind of requests, we need to extend that endpoints to provide a functionality to just truncate the inventory table in DB
the reason for that: products and stocks coming from an external Software and will be placed inside magento, and because of that we ran into stock count problems between magento and external Software
there is still no official solution for that problem from Adobe so the workaround is to empty that specific table in DB everytime we import the new stocks

Related

I want to create a service that allows my company's products to move pages only for the products that customers have

This article was written using a translator.
There are many products in my company.
Like Atlasian, I want to create a service that allows my company's products to move pages only for the products that customers have.
In order to do so, you need to know the products of each customer, and I need to make sure that only those products can be clicked, but can you not use the database?
Using the database makes it so complicated that I want to implement it as simple as possible.
You need to know a programming language/ framework that allows you to create a service/api.
There are various ones available.
Search on the internet.
The architecture of a service is slightly different from directly having a data entry form that stores into a database.
Most apis'/ service entails you creating classes to do CRUD operations(i.e create,read,update and delete operations) by coding classes and then consuming the API into the application.
So yes you can have within the API classes that can be called and then used to store information that the customer has installed into a database, and also retrieve product values specific to a specific customer.
See API as mid layer between front end,and database

Google App Maker - Reference multiple tables from External MySql Database

I recently began using Google App Maker and in order to reference multiple tables from an external MySql Database, do I have to create multiple Data Models for each table or do I have to create multiple datasources inside one Data Model and adding all the fields in it? The database has 15 tables in total.
You need to create model per table.
You can connect your existing database to App Maker (in application settings) and import tables as models (create model -> existing model). So you don't need to re-create fields.
Please be aware that as you change models in App Maker the database from application settings changes accordingly. So I would recommend use prototype database in application settings and production one in production deployment.

Manually input orders in woocommerce databases?

I have a question about manually inputting information in a MySQL databases (specifically in meaning Woocommerce order databases). I have some orders, that I get from another database and have to input them in in a Woocommerce database, which by now I found out that it consists out of several different ones, and not from just one. The Woocommerce is a plugin in Wordpress. Does anybody have any idea on how that could be done?
Some additional information: I am working with Wordpress 4.4.2 and Woocommerce 2.5.5.
I would not try to directly insert data into woocommerce's database because this method is not really documented and would require intricate knowledge of woocommerce's database.
I would rather use woocommerce's rest api to create the orders. The documentation has examples for various programming languages. There is another bulk creation api as well, but found no examples on how exactly to use that one, since the example in the documentation is on bulk updates only.

Move data from one prestashop version to another

I have a client website that is running on Prestashop v1.4
Because it has been "maintained" by a previous developer who modified core files and generally made a big mess, the upgrade module no longer works properly. Given that the client is handing over the project to me, and wants a new theme implemented, I am moving straight to Prestashop 1.6 and using the Compass/Boostrap 3 default theme as a base.
Obviously, the important thing is that the clients data should be migrated. So my question is, is it possible to make a clean export from Prestashop 1.4 of only the actual sales and website access data, skipping anything like module configs etc, in order to reimport it all to Prestashop 1.6?
This way, my client can keep his order data, access data, products, payments etc, and I can build a new theme without having to fight with an old installation or theme that have hardcoded rubbish in it.
This module provides an automated method migrate products, customers, orders, categories, customers password and other data from Prestashop to Prestashop.
http://addons.prestashop.com/en/8934-prestashop-to-prestashop-migration-tool.html
I think you can choose many migrate module to do your request.
If you only want to upgrade the current site to 1.6 (or the latest version). you can create a new site and transfer all of the data from the current site to the live site.
After you had set up the live site completely, you just re-transfer data from the new site to the live site. you can use a module many times with the site that has been granted a license.
If you want to transfer Product, categories and customer, you just use the Upgrade PrestaShop 1.6 to 1.7 free
If you want to transfer all of the data (products, customer, categories, order, cms, message, shipping,...) you should purchase the premium version module: 1 CLICK to migrate

How to synchronize product inventory stock in 2 databases. Mysql and MSSQL real time

i have Magento e-commerce system with Mysql and windows based POS system written .net with MSSQL Database,
what's the best way to manage the stock in real time ?
Solution 1
to write a cron job to export transaction to xml file then send the data, also to read the update data from the POS via ftp.
and on the POS system to create widows server to read the xml file to update database and after export xml to update Magento when ever there is sales or manually changes into the stock.
Solution 2
can i create a web service to update stock on both ends?
Thanks in advance.
Real time is almost always a tricky beast to tackle.
What I would do is utilize the Magento API to get and set the information you need regarding the stock. You may find that the Magento API is a little slow. Alan Storm has some good articles explaining the ins and outs of the API at his blog at alanstorm.com. I would look there if you want to know more.
Alan Storm also has released his own API called MercuryAPI. This could possibly help you.
Otherwise you could just create your own API endpoints for what you need to handle. I have found that sometimes this is your best bet. The one thing you have to remember is that you alone are going to be responsible for securing anything you make on your own (just be careful). In your case, you probably will be dealing with the Stock Item models of Magento. You don't necessarily need to handle the entire product model to just update stock levels.