This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'wc_add_to_cart_message_html', 'phive_added_to_cart_message', 11,2 ); | |
function phive_added_to_cart_message( $message, $products ){ | |
$added_to_cart_message='Booking Done. Please check cart for payment.'; //make your changes | |
$is_booking_product = false; | |
foreach ($products as $product_id => $quantity) { | |
if( ph_is_bookable_product($product_id) ){ | |
$is_booking_product = true; | |
break; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('wp_footer','scripting'); | |
function scripting() | |
{ | |
?> | |
<script type="text/javascript"> | |
// console.clear(); | |
// console.log("started check box condition"); | |
jQuery(document).ready(function($){ | |
var max_selection=2; // change this value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* hide non-available dates in time calendar */ | |
#ph-calendar-time li.ph-calendar-date.de-active.not-available { | |
display: none !important; | |
} | |
/* hide booked slots in time calendar */ | |
#ph-calendar-time li.ph-calendar-date.booking-full.de-active { | |
display: none; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'ph_non_adjacent_bookings_multiply_cost_with_block_before_calc', 'ph_non_adjacent_bookings_multiply_cost_with_block_before_calc',10,2 ); | |
function ph_non_adjacent_bookings_multiply_cost_with_block_before_calc( $true_false,$product_id='' ) { | |
return true; | |
} | |
add_filter( 'ph_multiple_non_adjacent_participant_applied_cost', 'ph_multiple_non_adjacent_participant_applied_cost_condition',10,2 ); | |
function ph_multiple_non_adjacent_participant_applied_cost_condition( $query='' ) { | |
return false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'woocommerce_email_order_item_quantity', 'display_number_of_days_booked_as_quantity_in_order_emails',10,2 ); | |
function display_number_of_days_booked_as_quantity_in_order_emails($quantity,$item =array()) | |
{ | |
if(!empty($item) && !empty($item->get_product_id()) ) | |
{ | |
$product_id = $item->get_product_id(); | |
$from_date = $item->get_meta('From',true); | |
$to_date = $item->get_meta('To',true); | |
if (!empty($from_date)) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'ph_booking_add_to_cart_message_html', 'ph_booking_hide_add_to_cart_message_html' ); | |
function ph_booking_hide_add_to_cart_message_html( $message='' ) { | |
// return $message; | |
return ''; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Snippet to show shipping method on order weight | |
* Created at : 2 December 2019 | |
* PluginHive Plugins : https://www.pluginhive.com/product-category/woocommerce-plugin/ | |
* Gist Link : https://gist.github.com/PluginHive/bc669f7d85124a18c457c0d27a00a229 | |
**/ | |
add_filter( 'woocommerce_package_rates', 'ph_show_shipping_method_on_order_weight', 10, 2 ); | |
function ph_show_shipping_method_on_order_weight( $available_shipping_methods, $package ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'ph_bookings_display_booking_end_time', 'check_display_booking_end_time' ); | |
function check_display_booking_end_time( $default=true ) { | |
return false; | |
// return true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.woocommerce div.product.elementor form.cart:not(.grouped_form):not(.variations_form){ | |
display: block !important; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function remove_currency_in_wc_price( $price_html ) { | |
global $product; | |
if( !empty($product) && is_a( $product, 'WC_Product_phive_booking' ) && !is_cart() && !is_checkout() && !is_ajax() ) { | |
$display_cost=get_post_meta( $product->get_id(), '_phive_booking_pricing_display_cost', 1 ); | |
if(!empty($display_cost)) | |
{ | |
$arr=explode('<span class="woocommerce-Price-currencySymbol">', $price_html); | |
$arr2=explode('</span>', $arr[1]); | |
return $arr[0].$arr2[1]; | |
} |