Skip to content

Conversation

@petitphp
Copy link
Member

@petitphp petitphp commented Nov 18, 2025

  • Customize directory where the products's feed is written
  • Customize products's feed filename
  • Customize shipping method used when creating the shipping rate during order import

Note

Adds filters to customize feed directories/filename and the shipping rate data during order import, plus tests for feed helper functions.

  • Backend:
    • Feed configuration: Add filters shopping_feed_feed_directory_path, shopping_feed_feed_parts_directory_path, and shopping_feed_feed_filename in ShoppingFeedHelper.
    • Order shipping: Apply shopping_feed_order_shipping_rate in src/Orders/Order/Shipping.php to allow modifying shipping method data when creating rates.
  • Tests:
    • Add tests/wpunit/Feed/HelperFunctionsTest.php covering defaults and filter overrides for feed directory, parts directory, and filename.

Written by Cursor Bugbot for commit 7d33ed9. This will update automatically on new commits. Configure here.

- Customize directory where the products's feed is written
- Customize products's feed filename
- Customize shipping method used when creating the shipping rate during order import
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

* @param OrderResource $sf_order the ShoppingFeed order.
*/
$shipping_rate = apply_filters( 'shopping_feed_order_shipping_rate', $shipping_rate, $this->sf_order );

Copy link

Choose a reason for hiding this comment

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

Bug: Filter data type mismatch causes downstream errors.

The filter shopping_feed_order_shipping_rate allows external code to return non-array values that bypass the empty() check but cause errors when accessed as array keys later. If the filter returns a non-empty, non-array value (like a string or number), execution continues past line 111 but then fails at lines 124-131 when trying to access array keys like method_rate_id and method_title on a non-array value.

Fix in Cursor Fix in Web

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.

2 participants