Jump to content

Edit History

kamil_optime

kamil_optime


Polishing content

I'm working on simple python script for updating product using prestapy library.

Prerequisites

API is enabled

API Key is generated with full permissions

Other operations like retrieving single product or all products work fine

Script

from prestapyt import PrestaShopWebServiceDict

prestashop = PrestaShopWebServiceDict('{API_URL}', '{API_KEY}', debug=True, verbose=False)
new_price  = 28.0
product_id = '22806'

product = prestashop.get('products', product_id)
product['product']['price'] = new_price
product['product'].pop('manufacturer_name', None)
product['product'].pop('quantity', None)
prestashop.edit('products', product)

Error

Quote

prestapyt.prestapyt.PrestaShopWebServiceError: "[SQL Error] Table '{SENSITIVE}.ps_accounts_incremental_sync' doesn't exist. From DbCore->insert() Query was : INSERT INTO `ps_accounts_incremental_sync` (`id_shop`, `id_object`, `type`, `created_at`, `lang_iso`) VALUES ('1', '22806', 'products', '2022-11-09T19:40:25+01:00', 'pl') ON DUPLICATE KEY UPDATE `id_shop` = '1',`id_object` = '22806',`type` = 'products',`created_at` = '2022-11-09T19:40:25+01:00',`lang_iso` = 'pl'"

To be honest, I have no idea how to approach that. Table name ps_accounts_incremental_sync doesn't even exist in prestashop github source code (or it's not searchable?).

I've tried requesting API using postman with same result (screen attached).

Any help greatly appreciated!

screen.png

kamil_optime

kamil_optime

I'm working on simple python script for updating product using prestapy library.screen.thumb.png.6687176509e02faa754d47417665fdfe.png

Prerequisites

API is enabled

API Key is generated with full permissions

Other operations like retrieving single product or all products work fine

Script

from prestapyt import PrestaShopWebServiceDict

prestashop = PrestaShopWebServiceDict('{API_URL}', '{API_KEY}', debug=True, verbose=False)
new_price  = 28.0
product_id = '22806'

product = prestashop.get('products', product_id)
product['product']['price'] = new_price
product['product'].pop('manufacturer_name', None)
product['product'].pop('quantity', None)
prestashop.edit('products', product)

Error

Quote

prestapyt.prestapyt.PrestaShopWebServiceError: "[SQL Error] Table '{SENSITIVE}.ps_accounts_incremental_sync' doesn't exist. From DbCore->insert() Query was : INSERT INTO `ps_accounts_incremental_sync` (`id_shop`, `id_object`, `type`, `created_at`, `lang_iso`) VALUES ('1', '22806', 'products', '2022-11-09T19:40:25+01:00', 'pl') ON DUPLICATE KEY UPDATE `id_shop` = '1',`id_object` = '22806',`type` = 'products',`created_at` = '2022-11-09T19:40:25+01:00',`lang_iso` = 'pl'"

To be honest, I have no idea how to approach that. Table name ps_accounts_incremental_sync doesn't even exist in prestashop github source code (or it's not searchable?).

I've tried requesting API using postman with same result (screen attached).

Any help greatly appreciated!

×
×
  • Create New...