Jump to content

Can't use advanced stock management based on stock in the warehouses when product was added by API


portals

Recommended Posts

Hi
I added many products using PSWebServiceLibrary.php and everything was look like correct. But when i want to switch same product to based on stock in the warehouses i got this error:

If you wish to use the advanced stock management, you must:

Associate your products with warehouses.
Associate your warehouses with carriers.
Associate your warehouses with the appropriate shops.

 

Amount in product tab is always 0 even if product is in warehouse. When i add product via admin page everything is OK.

This is example of problematic product:

<?xml version="1.0" encoding="UTF-8"?>
<prestashop xmlns:xlink="http://www.w3.org/1999/xlink">
<product>
    <id><![CDATA[2772]]></id>
    <id_manufacturer><![CDATA[0]]></id_manufacturer>
    <id_supplier><![CDATA[0]]></id_supplier>
    <id_category_default xlink:href="http://myshop.com/api/categories/13"><![CDATA[13]]></id_category_default>
    <new></new>
    <cache_default_attribute><![CDATA[0]]></cache_default_attribute>
    <id_default_image xlink:href="http://myshop.com/api/images/products/2772/2739" not_filterable="true"><![CDATA[2739]]></id_default_image>
    <id_default_combination not_filterable="true"></id_default_combination>
    <id_tax_rules_group><![CDATA[0]]></id_tax_rules_group>
    <position_in_category not_filterable="true"><![CDATA[1]]></position_in_category>
    <manufacturer_name not_filterable="true"></manufacturer_name>
    <quantity not_filterable="true"><![CDATA[0]]></quantity>
    <type not_filterable="true"><![CDATA[simple]]></type>
    <id_shop_default><![CDATA[1]]></id_shop_default>
    <reference></reference>
    <supplier_reference></supplier_reference>
    <location></location>
    <width><![CDATA[0.000000]]></width>
    <height><![CDATA[0.000000]]></height>
    <depth><![CDATA[0.000000]]></depth>
    <weight><![CDATA[0.000000]]></weight>
    <quantity_discount><![CDATA[0]]></quantity_discount>
    <ean13><![CDATA[...]]></ean13>
    <upc></upc>
    <cache_is_pack><![CDATA[0]]></cache_is_pack>
    <cache_has_attachments><![CDATA[0]]></cache_has_attachments>
    <is_virtual><![CDATA[0]]></is_virtual>
    <on_sale><![CDATA[0]]></on_sale>
    <online_only><![CDATA[0]]></online_only>
    <ecotax><![CDATA[0.000000]]></ecotax>
    <minimal_quantity><![CDATA[0]]></minimal_quantity>
    <price><![CDATA[...]]></price>
    <wholesale_price><![CDATA[0.000000]]></wholesale_price>
    <unity><![CDATA[1]]></unity>
    <unit_price_ratio><![CDATA[0.000000]]></unit_price_ratio>
    <additional_shipping_cost><![CDATA[0.00]]></additional_shipping_cost>
    <customizable><![CDATA[0]]></customizable>
    <text_fields><![CDATA[0]]></text_fields>
    <uploadable_files><![CDATA[0]]></uploadable_files>
    <active><![CDATA[1]]></active>
    <redirect_type><![CDATA[404]]></redirect_type>
    <id_product_redirected><![CDATA[0]]></id_product_redirected>
    <available_for_order><![CDATA[1]]></available_for_order>
    <available_date><![CDATA[0000-00-00]]></available_date>
    <condition><![CDATA[new]]></condition>
    <show_price><![CDATA[1]]></show_price>
    <indexed><![CDATA[1]]></indexed>
    <visibility><![CDATA[both]]></visibility>
    <advanced_stock_management><![CDATA[0]]></advanced_stock_management>
    <date_add><![CDATA[2014-09-14 14:08:12]]></date_add>
    <date_upd><![CDATA[2014-09-14 14:09:47]]></date_upd>
    <meta_description><language id="1" xlink:href="http://myshop.com/api/languages/1"><![CDATA[]]></language></meta_description>
    <meta_keywords><language id="1" xlink:href="http://myshop.com/api/languages/1"><![CDATA[]]></language></meta_keywords>
    <meta_title><language id="1" xlink:href="http://myshop.com/api/languages/1"><![CDATA[]]></language></meta_title>
    <link_rewrite><language id="1" xlink:href="http://myshop.com/api/languages/1"><![CDATA[...]]></language></link_rewrite>
    <name><language id="1" xlink:href="http://myshop.com/api/languages/1"><![CDATA[...]]></language></name>
    <description><language id="1" xlink:href="http://myshop.com/api/languages/1"><![CDATA[]]></language></description>
    <description_short><language id="1" xlink:href="http://myshop.com/api/languages/1"><![CDATA[]]></language></description_short>
    <available_now><language id="1" xlink:href="http://myshop.com/api/languages/1"><![CDATA[]]></language></available_now>
    <available_later><language id="1" xlink:href="http://myshop.com/api/languages/1"><![CDATA[]]></language></available_later>
<associations>
<categories node_type="categories">
    <categories xlink:href="http://myshop.com/api/categories/13">
    <id><![CDATA[13]]></id>
    </categories>
</categories>
<images node_type="images">
    <images xlink:href="http://myshop.com/api/images/products/2772/2739">
    <id><![CDATA[2739]]></id>
    </images>
</images>
<combinations node_type="combinations"/>
<product_option_values node_type="product_option_values"/>
<product_features node_type="product_features"/>
<tags node_type="tags"/>
<stock_availables node_type="stock_availables">
    <stock_availables xlink:href="http://myshop.com/api/stock_availables/3001">
    <id><![CDATA[3001]]></id>
    <id_product_attribute><![CDATA[0]]></id_product_attribute>
    </stock_availables>
</stock_availables>
<accessories node_type="products"/>
<product_bundle node_type="products"/>
</associations>
</product>
</prestashop>


<?xml version="1.0" encoding="UTF-8"?>
<prestashop xmlns:xlink="http://www.w3.org/1999/xlink">
<stock_available>
	<id><![CDATA[3001]]></id>
	<id_product xlink:href="http://myshop.com/api/products/2772"><![CDATA[2772]]></id_product>
	<id_product_attribute><![CDATA[0]]></id_product_attribute>
	<id_shop xlink:href="http://myshop.com/api/shops/1"><![CDATA[1]]></id_shop>
	<id_shop_group><![CDATA[0]]></id_shop_group>
	<quantity><![CDATA[1]]></quantity>
	<depends_on_stock><![CDATA[0]]></depends_on_stock>
	<out_of_stock><![CDATA[0]]></out_of_stock>
</stock_available>
</prestashop>

What did I do wrong when adding a product ? How can i fix it?

Edited by portals (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...