Skip to content

Release 3.4.7 merge#3088

Closed
carterbuce wants to merge 9 commits intofacebook:release/3.4.7from
carterbuce:release-3.4.7-merge
Closed

Release 3.4.7 merge#3088
carterbuce wants to merge 9 commits intofacebook:release/3.4.7from
carterbuce:release-3.4.7-merge

Conversation

@carterbuce
Copy link
Copy Markdown
Contributor

Merging the following into the 3.4.7 release branch:
#3031
#3029
#3048
#3056
#3063
#3078
#3060
#3079

David Evbodaghe and others added 9 commits April 23, 2025 18:39
…product data (facebook#3029)

Summary:
# Add separate short_description field to Facebook product catalog

## Description
This PR modifies how product descriptions are synced to Facebook by sending the short description as a separate field rather than using it as a fallback for the main description. This change allows both description types to be utilized independently in the Facebook catalog.

### Changes Made
- Added `short_description` field to product data sent to Facebook
- Modified `get_fb_short_description()` method to handle variation products consistently with main description
- Added fallback logic for variation products to use parent product's short description when needed
- Maintained separation between main description and short description fields

### Before
Previously, short descriptions were only used as a fallback when the main description was empty or when specifically configured to use short descriptions instead of main descriptions.

### After
Now both descriptions are sent to Facebook as separate fields:
- `description`: Contains the main product description
- `short_description`: Contains the product's short description
- Both fields maintain their own content and fallback logic

### Testing
- [ ] Verify that both main and short descriptions are sent to Facebook
- [ ] Test with variation products to ensure proper fallback behavior
- [ ] Confirm that existing product syncs continue to work as expected
- [ ] Verify that products with only one description type still sync correctly

## Impact
This change provides more flexibility in how product descriptions are displayed on Facebook, allowing merchants to utilize both description types for different purposes in their product catalog.

# Added tests for product short descriptions in Facebook catalog

This PR adds comprehensive test cases for the Facebook product short description functionality (`get_fb_short_description()` method). The tests ensure the method behaves correctly across various product types and scenarios.

## Test Cases

- **Variation inheritance**: Verifies that product variations correctly inherit short descriptions from parent products (even when variations attempt to set their own descriptions)
- **Simple product descriptions**: Confirms short descriptions are properly retrieved from product excerpts
- **Empty description handling**: Tests that empty short descriptions return empty strings
- **Filter application**: Validates the `facebook_for_woocommerce_fb_product_short_description` filter hook works correctly

These tests help ensure reliable product information display when syncing to Facebook catalog and maintain consistency with WooCommerce's product description behavior.

Pull Request resolved: facebook#3029

Differential Revision:
D72671275

Privacy Context Container: L1313315

Pulled By: devbodaghe

fbshipit-source-id: 177fd103bf4768af2a88a67cb20e9bc7c42ac369

(cherry picked from commit ac45802)
Summary:
## Description
This PR modifies how product descriptions are synced to Facebook by sending the short description as a separate field rather than using it as a fallback for the main description. This change allows both description types to be utilized independently in the Facebook catalog.

### Changes Made
- Added `short_description` field to product data sent to Facebook
- Modified `get_fb_short_description()` method to handle variation products consistently with main description
- Added fallback logic for variation products to use parent product's short description when needed
- Maintained separation between main description and short description fields

### Before
Previously, short descriptions were only used as a fallback when the main description was empty or when specifically configured to use short descriptions instead of main descriptions.

### After
Now both descriptions are sent to Facebook as separate fields:
- `description`: Contains the main product description
- `short_description`: Contains the product's short description
- Both fields maintain their own content and fallback logic

### Testing
- [ ] Verify that both main and short descriptions are sent to Facebook
- [ ] Test with variation products to ensure proper fallback behavior
- [ ] Confirm that existing product syncs continue to work as expected
- [ ] Verify that products with only one description type still sync correctly

## Impact
This change provides more flexibility in how product descriptions are displayed on Facebook, allowing merchants to utilize both description types for different purposes in their product catalog.

Pull Request resolved: facebook#3031

Reviewed By: vinkmeta

Differential Revision: D72671491

Pulled By: devbodaghe

fbshipit-source-id: 4a56db94bb699689ed41b768048014bba2aa7340

(cherry picked from commit 8e8a9df)
Summary:
## Feature: Short Description Fallback

This pull request introduces a new feature to the `WC_Facebook_Product` class, specifically enhancing the `get_fb_short_description` method. The method now includes logic to use the main product description as the short description when the main description is less than 50 characters.

### Changes

- **Modified `get_fb_short_description` Method:**
  - For variation products, if no short description is found, the method now checks if the main description is less than 50 characters and uses it as the short description.
  - For regular products, if no short description (excerpt) is found, the method checks if the main description is less than 50 characters and uses it as the short description.

### Benefits

- Ensures that products with very short main descriptions can still have a meaningful short description.
- Improves the consistency and completeness of product data sent to Facebook.

### Testing

- Verified that the short description is correctly populated from the main description when it is less than 50 characters.
- Ensured that existing functionality remains unaffected for products with longer descriptions.

### Notes

- This change does not affect any other parts of the plugin and maintains backward compatibility.

Pull Request resolved: facebook#3048

Reviewed By: vinkmeta

Differential Revision: D72866715

Pulled By: devbodaghe

fbshipit-source-id: 87fe2e362dcc025b2633894f930afa9cbd9a174d
(cherry picked from commit 6c768e4)
…d generation. (facebook#3056)

Summary:
## Description

As of now there is a switch in UI that controls enablement of the new style feed generation.

The plan is to remove this from the UI, while we will still respect the value that was set.
We are planning for the new style of feed generation to be additionally tested and then rolled out via a Gatekeeper to insure consistent feed generation across all sellers.

We are removing this from the UI since this is exposing an internal infra change and there will be no need for seller to be aware or have a control over it.
The control was removed from both old and new plugin page UX.

### Type of change

Please delete options that are not relevant.

- New feature (non-breaking change which adds functionality)

## Checklist

- [] I have commented my code, particularly in hard-to-understand areas.
- [] I have confirmed that my changes do not introduce any new PHPCS warnings or errors.
- [] I have checked plugin debug logs that my changes do not introduce any new PHP warnings or FATAL errors.
- [] I followed general Pull Request best practices. Meta employees to follow this [wiki]([url](https://fburl.com/wiki/2cgfduwc)).
- [] I have added tests (if necessary) and all the new and existing unit tests pass locally with my changes.
- [] I have completed dogfooding and QA testing, or I have conducted thorough due diligence to ensure that it does not break existing functionality.
- [] I have updated or requested update to plugin documentations (if necessary). Meta employees to follow this [wiki]([url](https://fburl.com/wiki/nhx73tgs)).

## Changelog entry

One liner entry to be surfaced in changelog.txt

Pull Request resolved: facebook#3056

Test Plan:
Was manually tested, screenshots provided below.

## Screenshots
Please provide screenshots or snapshots of the system/state both before and after implementing the changes, if appropriate
### Before

<img width="1277" alt="Screenshot 2025-04-14 at 15 37 02" src="https://github.com/user-attachments/assets/6f00e56c-1313-432f-9a2e-41adef32a39f" />

### After

The UI control has been removed:
<img width="1481" alt="Screenshot 2025-04-14 at 15 32 03" src="https://github.com/user-attachments/assets/284c138a-dce8-4c8a-95ae-c9b257c1601b" />

Reviewed By: ajello-meta, vinkmeta

Differential Revision: D72970938

Pulled By: mshymon

fbshipit-source-id: 3ada315d22168a0cd0c8ff3723351898052a97e0

(cherry picked from commit 9596404)
Summary:
## Description

Remove type casting for gpc to int

### Type of change

- Bug fix (non-breaking change which fixes an issue)

## Checklist

- [] I have commented my code, particularly in hard-to-understand areas.
- [] I have confirmed that my changes do not introduce any new PHPCS warnings or errors.
- [] I have checked plugin debug logs that my changes do not introduce any new PHP warnings or FATAL errors.
- [] I followed general Pull Request best practices. Meta employees to follow this [wiki]([url](https://fburl.com/wiki/2cgfduwc)).
- [] I have added tests (if necessary) and all the new and existing unit tests pass locally with my changes.
- [] I have completed dogfooding and QA testing, or I have conducted thorough due diligence to ensure that it does not break existing functionality.
- [] I have updated or requested update to plugin documentations (if necessary). Meta employees to follow this [wiki]([url](https://fburl.com/wiki/nhx73tgs)).

## Changelog entry

Remove type casting for gpc to int

Pull Request resolved: facebook#3078

Reviewed By: vinkmeta

Differential Revision:
D73508817

Privacy Context Container: L1313315

Pulled By: devbodaghe

fbshipit-source-id: 27d7842646a79f2560424df784a8a889792ada7c
(cherry picked from commit 0772347)
Summary:
Added a hook to woocommerce_new_order event to ensure we track Purchase events through different flows. Also added a flag to the order metadata to track whether a Purchase event has been sent for this order or not. Added more hooks to track if an event's status changed from on-hold or pending to processing or completed through the WP dashboard. Also fixed a phpcs warning in AAMSettings.php file

## Description

This PR is addressing the gap in Purchase events being sent by this plugin compared to GTM & Stape.
The details are explained in this doc: https://fburl.com/gdoc/ihoi9jna

### Type of change
Bug fix (non-breaking change which fixes an issue)

## Checklist

- [x] I have commented my code, particularly in hard-to-understand areas.
- [x] I have confirmed that my changes do not introduce any new PHPCS warnings or errors.
- [x] I have checked plugin debug logs that my changes do not introduce any new PHP warnings or FATAL errors.
- [x] I followed general Pull Request best practices. Meta employees to follow this [wiki]([url](https://fburl.com/wiki/2cgfduwc)).
- [x] I have added tests (if necessary) and all the new and existing unit tests pass locally with my changes.
- [x] I have completed dogfooding and QA testing, or I have conducted thorough due diligence to ensure that it does not break existing functionality.
- [x] I have updated or requested update to plugin documentations (if necessary). Meta employees to follow this [wiki]([url](https://fburl.com/wiki/nhx73tgs)).

## Changelog entry

Fixed a problem where Purchase event was not firing if thankyou page was not shown, Custom payment provider or order management plugin used, or Purchase state updated through Woo dashboard

Pull Request resolved: facebook#3060

Test Plan:
On a woo website, use any of the following payment options and check the Purchase event being registered:

- Klarna
- Card Payment
- Direct Bank transfer
- Cash on delivery
- Paypal

Reviewed By: tzahgr

Differential Revision: D73507420

Pulled By: vahidkay-meta

fbshipit-source-id: e879f24103ca0b4505fa981b99d820de9181ee77
(cherry picked from commit 21f2866)
Summary:
## Description

Disable unmapped fields to batch api

### Type of change
- New feature (non-breaking change which adds functionality)

## Checklist

- [] I have commented my code, particularly in hard-to-understand areas.
- [] I have confirmed that my changes do not introduce any new PHPCS warnings or errors.
- [] I have checked plugin debug logs that my changes do not introduce any new PHP warnings or FATAL errors.
- [] I followed general Pull Request best practices. Meta employees to follow this [wiki]([url](https://fburl.com/wiki/2cgfduwc)).
- [] I have added tests (if necessary) and all the new and existing unit tests pass locally with my changes.
- [] I have completed dogfooding and QA testing, or I have conducted thorough due diligence to ensure that it does not break existing functionality.
- [] I have updated or requested update to plugin documentations (if necessary). Meta employees to follow this [wiki]([url](https://fburl.com/wiki/nhx73tgs)).

## Changelog entry

Disable unmapped fields to batch api

Pull Request resolved: facebook#3079

Reviewed By: vinkmeta

Differential Revision:
D73518066

Privacy Context Container: L1313315

Pulled By: devbodaghe

fbshipit-source-id: b94721cf267fbb78449a90cecf6f90a15764019d
(cherry picked from commit 01ad67b)
@tzahgr tzahgr deleted the branch facebook:release/3.4.7 April 28, 2025 15:18
@tzahgr tzahgr closed this Apr 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants