Jump to content
mcp2

Product added via Webservice not available in search

Recommended Posts

Hi all, 

 

I started to play with Prestashop a few weeks ago, trying to integrate it via Webservice to a different database. It was quite complicated to understand the whole API with combinations and attribute_values and all, but I managed to crack it in the end. The products are being created with combinations and stocks, all good, nice and fluffy. 

 

My issue is now that whenever I'm trying to search one of these products via the search API, it doesn't show. If I enter the admin panel and make a change in the product via the admin panel, after that it will show in the search.

 

Is it something wrong in the way i create the product? Am I missing some switch somewhere? Please see below the XML that is sent to the webservice to create the product. 

<?xml version="1.0" encoding="UTF-8"?>
<prestashop xmlns:xlink="http://www.w3.org/1999/xlink">
<product>
    <id/>
    <id_manufacturer/>
    <id_supplier/>
    <id_category_default>2</id_category_default>
    <new/>
    <cache_default_attribute/>
    <id_default_image/>
    <id_default_combination/>
    <id_tax_rules_group>1</id_tax_rules_group>
    
    <type/>
    <id_shop_default>1</id_shop_default>
    <reference>FRC</reference>
    <supplier_reference/>
    <location/>
    <width/>
    <height/>
    <depth/>
    <weight>100</weight>
    <quantity_discount/>
    <ean13/>
    <isbn/>
    <upc/>
    <cache_is_pack/>
    <cache_has_attachments/>
    <is_virtual></is_virtual>
    <state>1</state>
    <on_sale/>
    <online_only/>
    <ecotax/>
    <minimal_quantity>1</minimal_quantity>
    <price>0</price>
    <wholesale_price/>
    <unity/>
    <unit_price_ratio/>
    <additional_shipping_cost/>
    <customizable/>
    <text_fields/>
    <uploadable_files/>
    <active>1</active>
    <redirect_type>404</redirect_type>
    <id_type_redirected/>
    <available_for_order>1</available_for_order>
    <available_date>2017-09-08</available_date>
    <show_condition/>
    <condition>new</condition>
    <show_price>1</show_price>
    <indexed>1</indexed>
    <visibility>both</visibility>
    <advanced_stock_management>0</advanced_stock_management>
    <date_add/>
    <date_upd/>
    <pack_stock_type>3</pack_stock_type>
    <meta_description><language id="1"/></meta_description>
    <meta_keywords><language id="1"/></meta_keywords>
    <meta_title><language id="1">Fargesia robusta</language></meta_title>
    <link_rewrite><language id="1">fargesia-robustal</language></link_rewrite>
    <name><language id="1">Fargesia robusta</language></name>
    <description><language id="1"/></description>
    <description_short><language id="1"/></description_short>
    <available_now><language id="1"/></available_now>
    <available_later><language id="1"/></available_later>
<associations>
<categories>
    <category>
    <id/>
    </category>
</categories>
<images>
    <image>
    <id/>
    </image>
</images>
<combinations>
    <combination>
    <id/>
    </combination>
</combinations>
<product_option_values>
    <product_option_value>
    <id/>
    </product_option_value>
</product_option_values>
<product_features>
    <product_feature>
    <id/>
    <id_feature_value/>
    </product_feature>
</product_features>
<tags>
    <tag>
    <id/>
    </tag>
</tags>
<stock_availables>
    <stock_available>
    <id/>
    <id_product_attribute/>
    </stock_available>
</stock_availables>
<accessories>
    <product>
    <id/>
    </product>
</accessories>
<product_bundle>
    <product>
    <id/>
    <quantity/>
    </product>
</product_bundle>
</associations>
<position_in_category>0</position_in_category>
</product>
</prestashop>
Edited by mcp2 (see edit history)

Share this post


Link to post
Share on other sites

Most important information is missing. Which prestashop version?

 

Spoken for 1.6.1.10 and later I know that prestashop doesn't correctly build the index files for new products. This issue is not related to how the product is inserted. To overcome this in the version mentionned there is at least one update on a product needed so the index is in place. The faulty class is product.php.

Share this post


Link to post
Share on other sites

Managed to find the issue. The version is 1.7.2 . 

It seems that a product must be associated with a category in order to be available in the catalogue. This was the information I was missing in the XML

 

 

Most important information is missing. Which prestashop version?

 

Spoken for 1.6.1.10 and later I know that prestashop doesn't correctly build the index files for new products. This issue is not related to how the product is inserted. To overcome this in the version mentionned there is at least one update on a product needed so the index is in place. The faulty class is product.php.

Share this post


Link to post
Share on other sites

Hello,

 

I am encountering the same problem. Products show up on front end (search, categories, direct link) and i can also choose them from the backend to create  orders and from a mass product editor module i have installed, but they wont show up on the order list -.-

 

I read clearing cache on another post but that didnt help. Any ideas?

Share this post


Link to post
Share on other sites

Forgo to add, category info is set and products show up on front-end categories

Share this post


Link to post
Share on other sites

This error has been fixed in 1.7.6.0

https://assets.prestashop2.com/es/system/files/ps_releases/changelog_1.7.6.0.txt -> Note #11192

In Product.php class change Hook::exec('updateProducto', array('id_product' => (int) $this->id)); for Hook::exec('actionProductUpdate', array('id_product' => (int) $this->id));

 

Edited by vad1 (see edit history)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More