For Developers
Shortcode
Section titled “Shortcode”[wpify_woo_delivery_dates]
Section titled “[wpify_woo_delivery_dates]”Displays the delivery dates block at any location.
[wpify_woo_delivery_dates]Filters
Section titled “Filters”wpify_woo_delivery_dates_days
Section titled “wpify_woo_delivery_dates_days”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 );| Parameter | Type | Description |
|---|---|---|
$days | string/int | Number of days or text |
$product | WC_Product | Current product |
$days_group | array | Date group settings |
wpify_woo_delivery_dates_data
Section titled “wpify_woo_delivery_dates_data”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;} );| Parameter | Type | Description |
|---|---|---|
$data | array | date, 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 );| Parameter | Type | Description |
|---|---|---|
$line_data | array | title, price |
$method | WC_Shipping_Method | Shipping 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 );| Parameter | Type | Description |
|---|---|---|
$line_data | array | title, price |
$gateway | WC_Payment_Gateway | Payment method object |
wpify_woo_delivery_dates_payments_data
Section titled “wpify_woo_delivery_dates_payments_data”Modifies payment methods data.
add_filter( 'wpify_woo_delivery_dates_payments_data', function( $data ) { $data['message'] = 'Payment on delivery or by card'; return $data;} );| Parameter | Type | Description |
|---|---|---|
$data | array | message, 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
Product Meta Data
Section titled “Product Meta Data”_wpify_woo_delivery_dates
Section titled “_wpify_woo_delivery_dates”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',// ],// ]CSS Classes
Section titled “CSS Classes”| Class | Description |
|---|---|
.wpify-woo-delivery-date | Main container |
.wpify-woo-delivery-date__title | Block title |
.wpify-woo-delivery-date__line | Date row |
.wpify-woo-delivery-date__info | Extended information |
.wpify-woo-delivery-date__country-select | Country selector |
.wpify-woo-delivery-date__shipping-methods | Shipping table |
.wpify-woo-delivery-date__payments | Payment table |
REST API
Section titled “REST API”The module registers a REST API endpoint for AJAX updates when the country is changed.