Package Contents - Filter Hook References

Modified on Mon, 19 Sep 2022 at 08:47 AM

This is simply a list of package contents-related filter hooks found within the WooCommerce Table Rate Shipping files. This list also includes the supported parameters and example codes.


wtars_shipped/get-package-item

  • Parameters:
  • $package_item array()
  • $item array()


Example Codes:

function custom_get_package_item( $package_item, $item ) {

    //add your custom code here
    return $package_item;
}

add_filter( 'wtars_shipped/get-package-item', 'custom_get_package_item', 10, 2 );

wtars_shipped/get-grouped-packages

  • Parameters:
  • $grouped_packages array()
  • $group_by array()
  • $data array()


Example Codes:

function custom_get_grouped_packages( $grouped_packages, $group_by, $data ) {

    //add your custom code here
    return $grouped_packages;
}

add_filter( 'wtars_shipped/get-grouped-packages', 'custom_get_grouped_packages', 10, 3 );

wtars_shipped/get-package-destination

  • Parameters:
  • $package_destination array()
  • $package array()


Example Codes:

function custom_get_package_destination( $package_destination, $package ) {

    //add your custom code here
    return $package_destination;
}

add_filter( 'wtars_shipped/get-package-destination', 'custom_get_package_destination', 10, 2 );

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article