Created
June 9, 2022 11:58
-
-
Save kartikparmar/16292d35e8733fac28920c1877175fcd to your computer and use it in GitHub Desktop.
Adding Special Price to Variable Price
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
<?php | |
/** | |
* Adding Special Price to Variable Price. | |
* | |
* @param string $time_slot_price Booking Price. | |
* @param string $product_id Product ID. | |
* @param string $variation_id Variable ID. | |
* @param string $product_type Product type. | |
* | |
* @return string $time_slot_price Modified Booking Price. | |
*/ | |
function bkap_add_special_price_to_variation( $time_slot_price, $product_id, $variation_id, $product_type ) { | |
if ( isset( $_POST['special_booking_price'] ) && '' != $_POST['special_booking_price'] ) { | |
$time_slot_price = bkap_common::bkap_get_price( $product_id, $variation_id, $product_type ); | |
$time_slot_price += $_POST['special_booking_price']; | |
} | |
return $time_slot_price; | |
} | |
add_filter( 'bkap_modify_booking_price', 'bkap_add_special_price_to_variation', 10, 4 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment