Copy the data(products,prices,stock,categories) to aimeos using native sql requests

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
mahmoud
Posts: 27
Joined: 27 Mar 2020, 22:01

Copy the data(products,prices,stock,categories) to aimeos using native sql requests

Post by mahmoud » 27 Mar 2020, 22:34

Hello,
"aimeos/aimeos-laravel": "~2019.10"
windows 10: 64
Laravel Framework 6.18.3

I use stock management software which uses a database, I try to copy the data(products,prices,stock,categories) directly from the software to the aimeos database.
I copied the following tables using native sql requests:
/// nId_produit_mshop_product : foreign key table id mshop_product

mshop_product,
//// ajouter un mshop_product
mshop_product.siteid=1
mshop_product.dataset=""
mshop_product.type="default"
mshop_product.code=Produit.Code_Produit
mshop_product.label=Produit.Description
mshop_product.config="[]"
mshop_product.start=DateSys()
mshop_product.end=""
mshop_product.status=1
mshop_product.mtime=DateSys()
mshop_product.ctime=DateSys()
mshop_product.editor=COMBO_Combo..ValeurAffichée
mshop_product.target=""


//// add un mshop_product_list
mshop_product_list.parentid=nId_produit_mshop_product /// id de table mshop_product
mshop_product_list.siteid=1
mshop_product_list.key="attribute|default|1"
mshop_product_list.type="default"
mshop_product_list.domain="attribute"
mshop_product_list.refid=1
mshop_product_list.start=DateHeureSys()
mshop_product_list.config="[]"
mshop_product_list.pos=0
mshop_product_list.status=1
mshop_product_list.mtime=DateHeureSys()
mshop_product_list.ctime=DateHeureSys()
mshop_product_list.editor="contact@email.com"
HAdd(mshop_product_list)

// ADD mshop_index_text
mshop_index_text.prodid = nId_produit_mshop_product
mshop_index_text.prodid=nId_produit_mshop_product
mshop_index_text.siteid=1
mshop_index_text.langid="fr"
mshop_index_text.url=Produit.Description
mshop_index_text.name=Produit.Description
mshop_index_text.content=Produit.Description
mshop_index_text.mtime=DateHeureSys()
HAdd(mshop_index_text)


// ADD mshop_index_catalog
mshop_index_catalog.prodid=mshop_product.id
mshop_index_catalog.siteid=1
mshop_index_catalog.catid=1
mshop_index_catalog.listtype="default"
mshop_index_catalog.pos=0
mshop_index_catalog.mtime=DateHeureSys()
IF HAdd(mshop_index_catalog) THEN
END

// ADD mshop_stock
mshop_stock.siteid=1
mshop_stock.type="default"
mshop_stock.productcode=Produit.Code_Produit
//mshop_stock.stocklevel
//mshop_stock.backdate
//mshop_stock.timeframe
mshop_stock.mtime=DateHeureSys()
mshop_stock.ctime=DateHeureSys()
mshop_stock.editor=COMBO_Combo..ValeurAffichée
HAdd(mshop_stock)


//mshop_index_price
mshop_index_price.prodid=nId_produit_mshop_product
mshop_index_price.siteid=1
mshop_index_price.currencyid="MAD"
mshop_index_price.value=Produit.Prix_Vente
mshop_index_price.mtime=DateHeureSys()
HAdd(mshop_index_price)

The products are displayed on the admin part but not on the home page.
for it to appear on the homepage I have to assign them to a category.
I don't want to go to the website every time and do it manually for each product.
cordially

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Copy the data(products,prices,stock,categories) to aimeos using native sql requests

Post by aimeos » 30 Mar 2020, 11:09

You can create the categories and add an entry in the mshop_catalog_list table referening the product. Afterwards, you have to rebuild the product index by running the index/rebuild job controller.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply