Skip to content

Hooks and Filters

Filter the list of DPD branches (parcel shops and pickup points) returned from the API.

apply_filters( 'wpify_woo_dpd_get_branches', array $shops );

Parameters:

ParameterTypeDescription
$shopsarrayArray of branch data from the DPD API

Example — filter branches by city:

/**
* Show only branches in Prague
*
* @param array $shops Branches from DPD API
* @return array
*/
function my_dpd_filter_branches( $shops ) {
return array_filter( $shops, function ( $shop ) {
return $shop['city'] === 'Praha';
} );
}
add_filter( 'wpify_woo_dpd_get_branches', 'my_dpd_filter_branches' );

The plugin registers the following REST API endpoints under the wpify-woo-dpd/v1 namespace:

MethodEndpointDescriptionPermission
POST/admin/packages-noUpdate the number of packages for an ordermanage_woocommerce
POST/admin/addressUpdate the sender address for an ordermanage_woocommerce
POST/ordersSubmit orders to DPDmanage_woocommerce
GET/branchesGet DPD branches/parcel shops (deprecated — the plugin now uses the official DPD widget)Public
POST/optionSave plugin optionsmanage_woocommerce

You can add custom functions either in your child theme’s functions.php or use the Code Snippets plugin.