nopSolutions / nopCommerce

ASP.NET Core eCommerce software. nopCommerce is a free and open-source shopping cart.
https://www.nopcommerce.com
Other
9.14k stars 5.25k forks source link

Add more checks when validate shopping cart item attributes #7101

Closed RomanovM closed 4 months ago

RomanovM commented 5 months ago

nopCommerce version: 4.60

  1. Create a new nop installation, including the demo data (no plugins, no themes).
  2. Go to "Nike Tailwind Loose Short-Sleeve Running Shirt" in the frontend
  3. Select size "Small"
  4. Add the product to the cart, and place the order.
  5. Open exactly the same product in the backend
  6. Delete the product attribute value "small" from within the backend
  7. Navigate to the frontend, "My Account > Orders" and select the last order
  8. Press "Rebuy" and wait for redirect into the shopping cart

And here is the problem. Once you are in the shopping cart you can see that there is already something weird happing. There is no product attribute description displayed. If you have a look at the database, your shopping cart item still contains the old product attribute Id that you previously deleted.

  1. Place the order

You were now successfully able to purchase a product (product attribute value) that no longer exists.

Source: https://www.nopcommerce.com/boards/topic/98780/inconsistent-product-attribute-handling-in-reorder-functionality

Manuel-Innovapps commented 4 months ago

@exileDev I just wanted to mention, that today we had a pretty similar case with another of our customers.

They had a product (shirt) with two product attributes (size, fit). Via the backend they added multiple product attribute combinations (size, fit): (42, body) (42, modern) (43, body) (43, modern) (44, body)

notice that (44, modern) is not available. Yet nopCommerce shows this to the user as a valid option in the dropdowns (which is understandable).

The problem here is that when you select (44, modern) and add the product to the cart, you can buy this product, although no combination exists.

I think that this should be fixed while resolving the problem described above.

As I'm here writing this, is it planned to include this important bugfix in the next release, so that we can inform our customers?

RomanovM commented 4 months ago

@Manuel-Innovapps You should enable "Allow only existing attribute combinations" for such a product in this case.

Manuel-Innovapps commented 4 months ago

@RomanovM Thanks! That's really the case for the second problem I mentioned in this ticket. Although this is a pretty hidden setting, because it apparently only shows if you have product attribute combinations available.

Additionally I checked the first issue but this one does not seem to be resolved by this setting.

Sorry for the confusion

exileDev commented 4 months ago

Closed #7101