Developer forum

Forum » Integration » Deactivate missing products with multiple shops

Deactivate missing products with multiple shops

Arnór Halldórsson
Arnór Halldórsson
Reply

Hola,

We found a rotten pickle.

We have a webshop, with a PIM, where products are imported from AX into PIM. The products are under seperate companies in AX so in the PIM we have 2 warehouses that the products get split into, then the client adds some info to his products and publishes them to Ecommerce groups which are also split between two seperate shops.

The problem is during the import process, when we select Deactivate missing products and designate a SHOP on the Dynamicweb destination provider, the provider adds this clause to the SQL query:

AND NOT EXISTS
(
    SELECT * FROM EcomGroupProductRelation
    JOIN EcomShopGroupRelation
    ON
        EcomGroupProductRelation.GroupProductRelationGroupID=EcomShopGroupRelation.ShopGroupGroupID
    WHERE
        EcomGroupProductRelation.GroupProductRelationProductID=EcomProducts.ProductID
        AND
        EcomShopGroupRelation.ShopGroupShopID<>'" + shop + "'
)


Meaning that if the product exists in a warehouse in PIM, and an Ecommerce shop, it won't get deactivated.

Is this something that could be changed or is it to prevent products getting accidentally deactivated that exist in multiple shops on the frontend?

 

Best regards,

Arnór Geir


Replies

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Arnor,
yes, that is used for the last one. You can deselect the Shop(set it to None) in the Dynamicweb Provider destination settings, so the pointed query will not contains the Join to EcomShopGroupRelation and should deactivate all missed products.
Regards, Dmitrij

 
Arnór Halldórsson
Arnór Halldórsson
Reply

Hi Dmitriy,

That would, I think, create another problem. Since the batch XML for each company in AX arrives in seperate files, then importing XML A would deactivate all the products from XML B and vice versa?

I know, I always bring you the most delightful of issues :D

One solution would be to have AX send over the ProductActive flag but we're trying to avoid that since the client needs to be able to deactivate products without removing them so they don't loose the product information.

Can you think of anything else we could try?

Best regards,

Arnór

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Arnor,
then you can try the approach with table script as explained to similar problem here:
https://doc.dynamicweb.com/forum/integration/user-provider-remove-missing-users?PID=1605

So in the ProcessInputRow method cache your input products and in the JobFinished subscriber deactivate the needed products.
Regards, Dmitrij

 
Arnór Halldórsson
Arnór Halldórsson
Reply

Yea we thought about that.

Turns out, just removing the Warehouses from PIM and setting the ShopID on the integration jobs to the ecommerce shops did the trick :D

We just use dynamic structures and queries in PIM instead to filter the product list and manage it before it get's published to Ecommerce groups :)

Thank you for your help!

 

Best regards,
Arnór

 

You must be logged in to post in the forum