Jump to content

Webservice new product problem on the user page

Recommended Posts


I would like to ask your help, perhaps someone has seen this problem:

- Using web service I upload product groups, products and variations into Prestashop
-Everything  looks fine in the admin window. The groups, products and variations are created.
-But at the end user window the new products cannot be seen among the New products and neither under the manufacturer.
However on the page of the product the quantity and the manufacturer fields are filled
-If I refresh a product manually then the product will be seen under the New products and under the manufacturer.

The product upload code is this:

$xml                                                                  = $webService->get(array('url' => $shopurl.'api/products?schema=blank'));
            $product                                                              = $xml->children()->children();

            $product->price                                                       = 0;
            $product->wholesale_price                                             = 0;
            $product->active                                                      = 1;
            $product->on_sale                                                     = 0;
            $product->show_price                                                  = 1;
            $product->available_for_order                                         = 1;
            $product->id_tax_rules_group                                          = 1;
            $product->unity                                                       = $data->Termek_Csomagolasi_egyseg;
            $product->minimal_quantity                                            = $data->Termek_MinimumKeszlet;
            $product->pack_stock_type                                             = 3;
            $product->state                                                       = 1;
            $product->reference                                                   = $data->Termek_SajatCikkSzam;
            $product->id_manufacturer                                             = $gyarto['id_manufacturer'];

            $product->name->language[0][0]                                        = $data->Termek_Megnevezes;
            $product->name->language[0][0]['id']                                  = 1;

            $product->description->language[0][0]                                 = $data->Termek_Megjegyzes;
            $product->description->language[0][0]['id']                           = 1;

            $product->description_short->language[0][0]                           = $data->Termek_Megjegyzes;
            $product->description_short->language[0][0]['id']                     = 1;
            $product->reference                                                   = $data->Termek_SajatCikkSzam;

            $product->associations->categories->addChild('category')->addChild('id', $csoport["id_category"]);
            $product->associations->categories->addChild('category')->addChild('id', $parent["id_parent"]);
            $product->id_category_default                                         = $csoport["id_category"];

            $product->associations->stock_availables->stock_available->quantity   = $data->Termek_AktualisKeszlet;

            $opt                                                                  = array('resource' => 'products');
            $opt['postXml']                                                       = $xml->asXML();
            $xml                                                                  = $webService->add($opt);

            $product                                                              = $xml->product;

In the database the insert date and update date  is good.
It seems that after manuals refresh  there is no change in the database regarding the product.
The cache is switched off in the webshop.

The question is why doesn't the product appear under the New products and under the manufacturer without manual refresh?
The product can only be seen under its own category in the end user window.

Thank you very much for your help!

Share this post

Link to post
Share on other sites
15 minutes ago, a17000 said:



Thanks, but this is not the solution for me.
These products are not discounted products, so the on_sale is 0.

The products are visible on the front page under their categories, but not in the new products and under the selected manufacturer, only after I manually update the product without any changes.
After this, the on sale is 0 too.

Share this post

Link to post
Share on other sites
  • 2 weeks later...

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...

Important Information

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