View Categories

Action Hooks Associated With Cart Page

Action: wp_travel_multiple_time_cart_page #

Hook to support multiple times in cart.

Active Since v3.0.8

Source

File: /templates/content-cart.php
Used by: /templates/content-cart.php

Parameters
$trip, $trip_id, $price_key, $trip[‘arrival_date’]

Example:

function prefix_wp_travel_multiple_time_cart_page( $trip, $trip_id, $price_key, $trip['arrival_date'] ) {
         // Code here.
}
add_action( โ€˜wp_travel_multiple_time_cart_page', 'prefix_wp_travel_multiple_time_cart_pageโ€™ );

Action: wp_travel_action_cart_after_date #

Fire after date and time in cart.

Active Since v3.0.8

Source

File: /templates/content-cart.php
Used by: /templates/content-cart.php

Parameters
$trip, $trip_id

Example:

function prefix_wp_travel_action_cart_after_date( $trip, $trip_id )
{
  // Code here.
}
add_action( โ€˜wp_travel_action_cart_after_date', 'prefix_wp_travel_action_cart_after_dateโ€™ );

Action: wp_travel_cart_before_product_subtotal #

Fire before product subtotal in cart.

Active Since v3.0.4

Source

File: /templates/content-cart.php
Used by: /templates/content-cart.php

Parameters
$args

Example:

function prefix_wp_travel_cart_before_product_subtotal( $args ) {
   // Code here.
}
add_action( โ€˜wp_travel_cart_before_product_subtotal', 'prefix_wp_travel_cart_before_product_subtotalโ€™ );

Action: wp_travel_tour_extras_cart_block #

Hook to support tour extras in cart.

Source

File: /templates/content-cart.php
Used by: /templates/content-cart.php

Parameters
$trip_extras, $cart_id, $trip_id

Example:

function prefix_wp_travel_tour_extras_cart_block( $trip_extras, $cart_id, $trip_id ) {
esc_html_e( โ€˜This is content added using this hookโ€™, โ€˜text-domainโ€™ );
}
add_action( โ€˜wp_travel_tour_extras_cart_block', 'prefix_wp_travel_tour_extras_cart_blockโ€™ );

Action: wp_travel_cart_before_product_subtotal #

Active Since v9.3.0

Hook to change the delay time for the โ€œTrip added to cartโ€ notice.

This will set the delay time for the “Add to Cart” notice to 2000 milliseconds.

add_filter( 'wp_travel_add_to_cart_notice_delay_time', function(){ 
	return 2000; 
} );

Remove notice

Hook to change the remove โ€œTrip added to cartโ€ notice.

This will set the delay time for the “Add to Cart” notice to 2000 milliseconds.

add_filter( 'wp_travel_add_to_cart_notice_delay_time', function(){ 
	return false; 
} );