Closed QuentindevePro closed 3 months ago
I just tried this myself, and my unlimited box ended up checked
But I had to change this to:
$csProduct->setHasVariations(false);
What is missing is a bunch of sensible defaults for products, so you don't have to specifically set a bunch of options you aren't interested in. I'm just about to push up a fix for that.
Try applying this, then doing a doctrine refresh and cache clear, you should be able to then omit lots of these setters:
Thanks ! Now the value isn't magically changed anymore. But I wonder: my products actually have some variations. pVariations is set to 0 but products still display correctly on /products. Shouldn't I have some issues ?
It might depend on what you are wanting to do in terms of where the quantities are actually managed.
In the store Settings, there's an option here:
Perhaps try setting that to No, and then in your API call setting setHasVariations to true.
I see. Thanks for your reactivity !
I have a simple code that creates a Product entity and then persists it to database:
However, even with
$csProduct->setIsUnlimited(true)
called, the resulting record in database ends up withpQtyUnlim
on zero. I have the same issue withProductVariation::setVariationIsUnlimited(true)
.