Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.x]: If a product is disabled on the primary site, it cannot be purchased on secondary sites #3797

Open
pixelmachine opened this issue Dec 4, 2024 · 3 comments
Labels
bug commerce4 Issues related to Commerce v4 Craft Commerce

Comments

@pixelmachine
Copy link

What happened?

Description

I'm not sure if this is just a limitation of the Commerce 4 system but if we setup a product and only have it 'enabled for site' for a site other than the primary site, it cannot be purchased. It can be added to the cart but on payment, it's removed from the order.

Steps to reproduce

  1. Setup Commerce with a primary and secondary site
  2. Add a product which is disabled on the primary but enabled on the secondary
  3. Visit the secondary site, and add the product to cart
  4. Continue to checkout and purchase the item
  5. See that after checkout the item is removed and the order is empty

Expected behavior

The product is enabled for site, so I would also expect it to be able to be purchased when disabled on another site

Actual behavior

The product must be enabled on the primary site to be purchased

Craft CMS version

4.9.5

Craft Commerce version

4.6.1

PHP version

8.2

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

  • Gift Voucher
  • Abandoned Cart
@pixelmachine pixelmachine added bug commerce4 Issues related to Commerce v4 Craft Commerce labels Dec 4, 2024
@youwebmax
Copy link

We have a very similar issue, but in our webshop the product can't even be added to the cart.

We have a German (main site), French and Italian shop.

When the product is not enabled for the German site and you add it to the cart in the French or Italian shop the update-cart call returns an empty lineItems list and a notice with the message "XXX nicht länger verfügbar." (XXX no longer available). The stock is unlimited for the product.

When the product is enabled for the German website you can successfully add it to the cart on the French and Italian site.

Craft CMS version: 4.13.5 (we already had the issue on at least version 4.9.1)
Craft Commerce version: 4.6.

@lukeholder
Copy link
Member

@pixelmachine are you using headless or ajax based calls to the cart / payment controllers? My guess is that you are hitting certain controllers while in a different site. What does the post request look like and to what URIs are you making requests?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug commerce4 Issues related to Commerce v4 Craft Commerce
Projects
None yet
Development

No branches or pull requests

3 participants