Skip to content

For Developers

Displays the delivery dates block at any location.

[wpify_woo_delivery_dates]

Modifies the number of days for date calculation.

add_filter( 'wpify_woo_delivery_dates_days', function( $days, $product, $days_group ) {
// Add extra day for heavy products
if ( $product->get_weight() > 30 ) {
return is_numeric( $days ) ? $days + 1 : $days;
}
return $days;
}, 10, 3 );
ParameterTypeDescription
$daysstring/intNumber of days or text
$productWC_ProductCurrent product
$days_grouparrayDate group settings

Modifies data displayed in the dates block.

add_filter( 'wpify_woo_delivery_dates_data', function( $data ) {
// Change date format
$data['message'] = 'We ship on ' . $data['date'];
return $data;
} );
ParameterTypeDescription
$dataarraydate, message, more_info_label, more_info_text, shipping_methods

wpify_woo_delivery_dates_shipping_table_line

Section titled “wpify_woo_delivery_dates_shipping_table_line”

Modifies a row in the shipping methods table.

add_filter( 'wpify_woo_delivery_dates_shipping_table_line', function( $line_data, $method ) {
// Add icon
$line_data['title'] = '📦 ' . $line_data['title'];
return $line_data;
}, 10, 2 );
ParameterTypeDescription
$line_dataarraytitle, price
$methodWC_Shipping_MethodShipping method object

wpify_woo_delivery_dates_payment_table_line

Section titled “wpify_woo_delivery_dates_payment_table_line”

Modifies a row in the payment methods table.

add_filter( 'wpify_woo_delivery_dates_payment_table_line', function( $line_data, $gateway ) {
// Add fee
if ( $gateway->id === 'cod' ) {
$line_data['price'] = wc_price( 50 );
}
return $line_data;
}, 10, 2 );
ParameterTypeDescription
$line_dataarraytitle, price
$gatewayWC_Payment_GatewayPayment method object

Modifies payment methods data.

add_filter( 'wpify_woo_delivery_dates_payments_data', function( $data ) {
$data['message'] = 'Payment on delivery or by card';
return $data;
} );
ParameterTypeDescription
$dataarraymessage, more_info_label, more_info_text

wpify_woo_delivery_dates_disable_country_select

Section titled “wpify_woo_delivery_dates_disable_country_select”

Disables the country selector.

add_filter( 'wpify_woo_delivery_dates_disable_country_select', '__return_true' );

Returns: bool - true to disable the selector

Stores overridden date values for a specific product.

$delivery_data = get_post_meta( $product_id, '_wpify_woo_delivery_dates', true );
// Structure:
// [
// 'delivery_dates_UUID' => [
// 'delivery_days_in_stock' => '1',
// 'delivery_days_out_of_stock' => '7',
// 'delivery_days_backorder' => '14',
// ],
// ]
ClassDescription
.wpify-woo-delivery-dateMain container
.wpify-woo-delivery-date__titleBlock title
.wpify-woo-delivery-date__lineDate row
.wpify-woo-delivery-date__infoExtended information
.wpify-woo-delivery-date__country-selectCountry selector
.wpify-woo-delivery-date__shipping-methodsShipping table
.wpify-woo-delivery-date__paymentsPayment table

The module registers a REST API endpoint for AJAX updates when the country is changed.