woocommerce / facebook-for-woocommerce

A first-party extension plugin built for WooCommerce. Development is managed by Ventures.
https://woocommerce.com/products/facebook/
GNU General Public License v2.0
211 stars 140 forks source link

Fix - Always send stock quantity when available #2792

Closed mshymon closed 2 months ago

mshymon commented 2 months ago

Changes proposed in this Pull Request:

This change suggests to always sync to Facebook the stock quantity if is it available. Earlier this was sent only if default country is USA. Also this PR removes unnecessary UX of a checkbox "Sell on Instagram" which was really a control whether to send stock quantity to Facebook. So, basically this PR suggests to treat stock quantity as any other product data (e.g. price or description) and just send it when available.

Screenshots:

Screenshot 2024-08-29 at 17 01 28

Detailed test instructions:

  1. New tests ./vendor/bin/phpunit --filter test_quantity_to_sell_on_facebook_when_manage_stock_is_on ./vendor/bin/phpunit --filter test_quantity_to_sell_on_facebook_when_manage_stock_is_off
  2. All tests npm run test:php
  3. Lint ./vendor/bin/phpcs
  4. Manual testing. I tested this in the locally hosted WP WooCommerce website and checked logs on Meta side to verify the request is being sent with the "quantity_to_sell_on_facebook" populated correctly.

Additional details:

Fix - Always send stock quantity when available.

Changelog entry