craftcms / commerce

Fully integrated ecommerce for Craft CMS.
https://craftcms.com/commerce
Other
217 stars 170 forks source link

[4.x]: Sales not applying to products #2976

Closed robzor closed 1 year ago

robzor commented 1 year ago

What happened?

Description

If i click 'Add to Sale' in a variant or 'Add all to sales' in the right hand sidebar and select any variants, they are not being applied to the sale. In the console I can see this:

CleanShot 2022-09-20 at 4 00 04

The response is []

Shortly afterwards (no user action just with the product page open) there is an XHR request:

CleanShot 2022-09-20 at 4 00 45

With a response of {"sales":[]}

I am running the site locally via Laravel Valet on OSX.

Is there a good way I can expose the log for this, as I am getting a 'Added to sale' confirmation toast message but obviously it's not working?

Steps to reproduce

  1. Create a sale
  2. Add a variant to the sale

Expected behavior

Variant is added to sale

Actual behavior

Variant is not added to sale

Craft CMS version

4.2.4

Craft Commerce version

4.1.2

PHP version

8.0.17

Operating system and version

Mac OSX Catalina 10.15.7

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

-

nfourtythree commented 1 year ago

Hi @robzor

Thank you for bringing this to our attention. We have just pushed up a fix for the issue which will be included in the next release of Commerce.

To get this early, change your craftcms/commerce requirement in your project's composer.json to:

"require": {
  "craftcms/commerce": "dev-develop#700229aeac88abd6edc2ac3111a6b3f12ac7b917 as 4.1.2",
  "...": "..."
}

Then run composer update.

Thanks

robzor commented 1 year ago

Thanks, I'll give this a go :)

stefanfriedrich commented 1 year ago

@nfourtythree bug seems to be back, I have the same problem with craft 4.3.10 and commerce 4.2.5.1. In sales I can add the variant, but variant onSale is false.

lukeholder commented 1 year ago

See my question on #3097 please @stefanfriedrich thanks.