verbb / snipcart

A Craft CMS plugin to integrate with Snipcart.
Other
21 stars 9 forks source link

SKU error when trying to update inventory value on existing product #21

Closed zizther closed 4 years ago

zizther commented 4 years ago

Describe the bug

I have products already setup. These all have unique and inventory values. I have it that the Snipcart webhook updates the inventory value. When updating the inventory values up or down it says the entry could not be saved because SKU must be unique.

The SKUs are all unique, so it seems that some in Craft 3.5 has changed, as it was all working in 3.4. It looks like it is checking the entry against itself before saving, which is why it is showing the error, as the SKU already exists for itself.

To Reproduce

Steps to reproduce the behavior:

  1. Enable the webhook for snipcart to reduce the inventory value
  2. Create an entry with a unique SKU and inventory value.
  3. Edit the entry inventory value
  4. Save the entry
  5. See error

Expected behavior

When updating a products inventory value the entry should save with the updated value

Screenshots

Software

mattstein commented 4 years ago

Thanks for reporting this @zizther! I’m not sure how I missed this testing with 3.5 but I’ll get it resolved as soon as I can.

mattstein commented 4 years ago

Would you mind switching to workingconcept/craft-snipcart to dev-develop and confirming that fixes the issue @zizther? Just finished testing locally and that should do the trick.

zizther commented 4 years ago

Solid turn around. Good work. I have tested and my issues are resolved.

Thanks for sorting this so quickly

mattstein commented 4 years ago

Just released 1.4.3 with this fix.