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

Fix - Sync stock quantity when available #2811

Conversation

mshymon
Copy link
Contributor

@mshymon mshymon commented Oct 3, 2024

Changes proposed in this Pull Request:

This change suggests to always sync to Meta the stock quantity when it is available.

Screenshots:

N/A (no changes to UI/UX)

Detailed test instructions:

  1. Run new tests
    ./vendor/bin/phpunit --filter test_quantity_to_sell_on_facebook_when_manage_stock_is_on_for_simple_product
    ./vendor/bin/phpunit --filter test_quantity_to_sell_on_facebook_when_manage_stock_is_off_for_simple_product
    ./vendor/bin/phpunit --filter test_quantity_to_sell_on_facebook_when_manage_stock_is_on_for_variable_product
    ./vendor/bin/phpunit --filter test_quantity_to_sell_on_facebook_when_manage_stock_is_off_for_variable_product_and_off_for_parent
    ./vendor/bin/phpunit --filter test_quantity_to_sell_on_facebook_when_manage_stock_is_off_for_variable_product_and_on_for_parent

  2. Run all tests
    npm run test:php

  3. 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. Tested on both simple and variable products.

Changelog entry

Fix - Sync stock quantity when available

@rawdreeg rawdreeg requested a review from a team November 4, 2024 12:14
Copy link
Contributor

@rawdreeg rawdreeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for submitting this fix, @mshymon. The changes work as described.

I left some small comments related to PHP coding style fixes. I'll approve so long.

includes/fbproduct.php Outdated Show resolved Hide resolved
includes/fbproduct.php Outdated Show resolved Hide resolved
includes/fbproduct.php Outdated Show resolved Hide resolved
includes/fbproduct.php Outdated Show resolved Hide resolved
Marian Shymon and others added 2 commits December 5, 2024 14:42
@mshymon mshymon force-pushed the update_to_quantity_to_sell_on_facebook_2 branch from d5e131d to 2f89a66 Compare December 5, 2024 14:44
@vahidkay-meta vahidkay-meta merged commit c263bd6 into facebook:develop Dec 5, 2024
4 checks passed
@vahidkay-meta vahidkay-meta mentioned this pull request Dec 6, 2024
29 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants