Shared shopping cart and unpublished products

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
2 anni tempo fa
Hello all !

I have some troubles configuring my multi store.
I'm in 4.3 version and got 4 stores set up.
On the first store I sell just some products (lets say T-shirts for the example).
On a second one I sell some other products (ex: shoes)

I have configured the products so they are limited to stores they belong to.
I have unchecked the "Ignore limited per strore rule" setting and checked the "Carts shared between stores" one.

So when I go to one of my stores, I can see all products that I added in the cart (For the moment everything is working fine) and I can notice an alert "Product is not published". But when I try to order what's inside my cart I got the error "Product is not published" and the customer can't order the products.

Did I missed a setting that allows the user to buy the wall cart even if some products bellongs to an other store (That is what I try to do with shared shopping cart) ?
2 anni tempo fa
You can share the cart between stores but you can only buy products that are limited to the store
If products are limited to store 1 then you can only buy them in store 1
If products are limited to store 2 then you can only buy them in store 2
So if a product limited to store 1 is added to the cart and then you go to store 2 you will see the error as you have described  and you can not purchase the product
2 anni tempo fa
Yidna wrote:
You can share the cart between stores but you can only buy products that are limited to the store
If products are limited to store 1 then you can only buy them in store 1
If products are limited to store 2 then you can only buy them in store 2
So if a product limited to store 1 is added to the cart and then you go to store 2 you will see the error as you have described  and you can not purchase the product


Thanks a lot for your answer !

In order to make it working in my shops I try to develop a plugin that overrides the order method.
I'm totally new with NopCommerce solution and .Net environment so I'm a bit lost.
I have already made a plugin (following the tutorial for 4.3) that allows me to turn a boolean value via the admin panel. I'm super happy with that but I don't find more info on how to override the default order method.
My aim is to go through the order method exept for the part that checks if a product is published or not on the current store (and overriding the red warning message as a bonus).

My current plugin just like this :
-Plugin
----Controllers
--------AController.cs
----Models
--------AModel.cs
----Views
--------_ViewImports.cshtml
--------Configure.cshtml
----logo.png
----OrderMultiStore.cs
----OrderMultiStoreSettings.cs
----plugin.json

For the moment it only implements (BasePlugin, IMiscPlugin).

Could you recommand me a ressource or tutorial on how to do it or understand more how to achieve my goal ?
Do I have to use IConsumer interface and try to manage events ? Or do I have to try to do a new route ?

Best regards,
Dorian
2 anni tempo fa
So to buy items in a shared shopping cart in which these are unpublished items on the current shop, I made a plugin that overrides the "ShoppingCartService" source class.
My class inherits from ShoppingCartService class and extends IShoppingCartService interface.
In order to access private fields I overrided all the class even the fields.
So I found that in "GetStandardWarnings" method, a warning is added when a product is not published on the curretn store, so for the moment I just commented this line.
I'll try to change this method to keep the warning if the current store as not a shared shopping cart.

Best regards
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.