Jump to content

Product pricing and inventory: »Enabled« checkbox has no effect


Recommended Posts

@kongondo No big deal, just FYI: Found out that the checkbox »Enabled« (If unchecked, customers will not be able to buy this product.) on shop/products/edit has no impact at all. You can buy this product, no matter if checked or not.

Link to comment
Share on other sites

Hi @Jan Fromm,

This has now been fixed. Products or variants that are not enabled for selling cannot be added to the basket. However, please note that since Padloper does not involve itself with the frontend display of products, developers will need to exclude such non-enabled products from frontend display, if they wish to. For instance:

<?php
// please note the below will also find parent product of variants!
// FIND non-enabled products and variants
$nonEnabledProductsAndVariants = $padloper->find("template=product|variant,stock.enabled=0");
// FIND enabled products and variants
$enabledProductsAndVariants = $padloper->find("template=product|variant,stock.enabled=1");

I also fixed a bug that allowed out-of-stock items to be added to the basket/cart. Please note that out-of-stock is only applicable to products/variants that track their inventory (Product Settings Tab) AND that don't allow overselling/backorders.

  • Like 1
Link to comment
Share on other sites

One more thing – What happens now is when you enable variants, the product gets disabled.

1) Content tab: Check enabled -> Save
2) Settings: Enable Product Variants: Yes -> Save
3) Content tab: Checkbox disappeared
4) Settings: Enable Enable Product Variants: No -> Save
5) Content tab: Checkbox re-appeared, but is unchecked

Link to comment
Share on other sites

Hi @Jan Fromm,

That is the expected behaviour because variants are products in themselves. So, if you enable variants, it means you will in effect have several products (the variants) that can be enabled independently of each other. At this point, the main product's enabled status does not come into play. However, other shared fields are still relevant, e.g. properties, tax, etc. Hope this makes sense.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...