Я пытаюсь создать сценарий PHP, который обновляет количество комбинаций в PrestaShop 1.6.1.11
Я думал, что могу получить комбинацию по их коду:
$product = new Product("COMB CODE");
$product->quantity = 5; // your quantity
$product->save();
Но PHP повышает:
PHP Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in /home/w.sk/web/Adapter/Adapter_EntityMapper.php on line 84
PHP Warning: count(): Parameter must be an array or an object that implements Countable in /home/w.sk/web/classes/ObjectModel.php on line 478
PHP Fatal error: Uncaught Out of range value for column 'id_product' at row 1<br /><br /><pre>INSERT INTO `ps_product` (`id_shop_default`, `id_manufacturer`, `id_supplier`, `reference`, `supplier_reference`, `location`, `width`, `height`, `depth`, `weight`, `quantity_discount`, `ean13`, `upc`, `cache_is_pack`, `cache_has_attachments`, `is_virtual`, `id_category_default`, `id_tax_rules_group`, `on_sale`, `online_only`, `ecotax`, `minimal_quantity`, `price`, `wholesale_price`, `unity`, `unit_price_ratio`, `additional_shipping_cost`, `customizable`, `text_fields`, `uploadable_files`, `active`, `redirect_type`, `id_product_redirected`, `available_for_order`, `available_date`, `condition`, `show_price`, `indexed`, `visibility`, `cache_default_attribute`, `advanced_stock_management`, `date_add`, `date_upd`, `pack_stock_type`) VALUES ('1', '0', '0', '', '', '', '0', '0', '0', '0', '0', '', '', '0', '0', '0', '0', '1', '0', '0', '0', '1', '0', '0', '', '0', '0', '0', '0', '0', '1', '', '0', '1', '0000-00-00', 'new', '1', '0', 'both', in /home/w.sk/web/classes/db/Db.php on line 791
Вы знаете, как получить существующую комбинацию и обновить ее количество?