• Resolved jstnpwll

    (@jstnpwll)


    I’m working with a FB feed. On Facebook catalogs, if the quantity_to_sell_on_facebook is zero (or missing), then the product will not be available for sale in my shop.

    I’m setting quantity_to_sell_on_facebook to stock (Custom attribute). This works for items which have stock management engaged and a stock > 0, but for items with no stock management there is no field added.

    I added a rule: if manage stock (Custom attribute) is not equal to yes, then set stock (Custom attribute) to 100. However, this does not seem to add the quantity_to_sell_on_facebook to the other items.

    Does the rule only apply to the value, AFTER logic has already determined whether the include the field? I don’t understand why else it would fail to show up. How can I get this to work?

Viewing 12 replies - 1 through 12 (of 12 total)
  • Thanks for using our plugin and reaching out to us.

    We’ve tried to replicate the issue at hand by adding the quantity_to_sell_on_facebook field to our feed and map it to the normal quantity attribute like this: https://www.dropbox.com/s/x9612e27d2cr67l/w-Quantity-0.png?dl=0

    Which resulted in all values to be 0 in our feed as we had not set quantities in WooCommerce.

    By creating this rule the issue was solved and they now all have 100 in the feed:
    https://www.dropbox.com/s/8a9m9fcwpv5i06w/w-Quantity-1.png?dl=0

    So the above solution should also work in your case I think?

    Thread Starter jstnpwll

    (@jstnpwll)

    I want items whose stocks are managed by woocommerce to represent the stock accurately, i.e. 0 if there are none left. I only want to set 100 if I am not managing stock via woocommerce, i.e. for products I source from an off-site supplier. There is a checkbox on products which determines this.

    Will the rule you suggested work for that case?

    I presume you mean this one?
    https://www.dropbox.com/s/o0nec1hwfn9w8y6/Quantity-off.png?dl=0

    Yes that will work.

    Thread Starter jstnpwll

    (@jstnpwll)

    This doesn’t work for products whose stock I am tracking which have an actual stock of zero. It overrides them to 100.

    That unfortunately we can’t change. With the above setting, where stock management is actually turned-off, WooCommerce returns 0 as stock.

    Thread Starter jstnpwll

    (@jstnpwll)

    I know, that’s why I opened this ticket. I was asking about using the stock management flag in a rule. Are you saying stock management is not available to use in rules or filters?

    You mentioned “manage stock (Custom attribute)”, that is not a default WooCommerce attribute so it must be an attribute you created yourselves. We don’t know what values you save in it and thus what you should use in your filters/rules. Theoretically rules and filters should work on it too. When you add the “manage stock (Custom attribute)” to a custom field (mapping) how does it show in your feeds?

    Thread Starter jstnpwll

    (@jstnpwll)

    I haven’t added that attribute, it must be from some other plugin. I assumed “Manage stock” would be available as a standard setting to base rules on since it is core WooCommerce functionality, but that custom attribute was the only option I found so I was experimenting with it.

    I will have to dig into it more to see if it will work for me. It would be nice if your plugin allowed rules to use the WooCommerce stock management flag out of the box, though!

    Thread Starter jstnpwll

    (@jstnpwll)

    I looked in the database and I think manage stock (Custom attribute) is based on the _manage_stock post meta (for product posts), which does seem to be what WooCommerce uses to track the stock management feature.

    For products whose stocks are managed, the value is ‘yes’. For products whose stocks are not managed, the value is ‘no’.

    In my rule, I am setting the Quantity [Stock] to 100 if the manage stock (Custom attribute) meta value is not equal to yes. However, this sets all products to 100 stock in my feed, including the few which are stock-managed (i.e. the ones which have a _manage_stock post meta of ‘yes’).

    • This reply was modified 4 years, 8 months ago by jstnpwll.

    I haven’t added that attribute, it must be from some other plugin. I assumed “Manage stock” would be available as a standard setting to base rules on since it is core WooCommerce functionality, but that custom attribute was the only option I found so I was experimenting with it.

    –> My bad, this is actually coming from WooCommerce out-of-the-box. Apologies.

    Now I do think I got it to work.

    I added these (test) field mappings to my feed:
    https://www.dropbox.com/s/emvqrct1ilpfvzr/stock-mapping.png?dl=0

    Created this rule:
    https://www.dropbox.com/s/7o2hei99uulbeem/Quantity-rule.png?dl=0

    For one product I had enabled the stock management and set the stock to 44. For all other products I left the stock management disabled.

    This is how it ended-up in my feed for products for which the stock management was disabled: https://www.dropbox.com/s/56u76zf9i2zzfr3/no-stock-management.png?dl=0

    And this is how it ended up in the feed for the product I enabled it for:
    https://www.dropbox.com/s/0hkhbmrsy474chx/yes-stock-enabled.png?dl=0

    Isn’t that what you wanted to accomplish?

    Thread Starter jstnpwll

    (@jstnpwll)

    I finally got this to work. I think I may have had some caching issues thrown into the mix, which made troubleshooting difficult. Thank you for your help.

    Perfect, good to hear you got it to work!

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Can’t get quantity to populate on products without stock management’ is closed to new replies.