This file contains hidden or 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 get additional number of people from total persons. | |
* Created at : 7 Jan 2019 | |
* PluginHive Plugins : https://www.pluginhive.com/plugins/ | |
*/ | |
add_filter( 'phive_booking_total_person_details', 'phive_booking_get_additional_person_details', 10,2 ); | |
function phive_booking_get_additional_person_details($total_person_detail,$product_id) | |
{ | |
$minimum_person_details = array( | |
'323' => array( // Product Id |
This file contains hidden or 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( 'xa_estimated_delivery_cart_checkout_page_html_formatted_date', 'ph_estimated_delivery_modify_cart_checkout_page_html',11,2 ); | |
function ph_estimated_delivery_modify_cart_checkout_page_html( $text, $test ) { | |
global $woocommerce; | |
$items = $woocommerce->cart->get_cart(); | |
$count=0; | |
foreach($items as $item => $values) { | |
$product_id=(wp_get_post_parent_id($values['data']->get_id())==0) ? $values['data']->get_id() : wp_get_post_parent_id($values['data']->get_id()); | |
if($values['data']->get_stock_status()=='onbackorder') | |
{ |
This file contains hidden or 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( 'woocommerce_before_checkout_form', 'ph_add_custom_message_on_top_of_checkout_page', 10 ); | |
function ph_add_custom_message_on_top_of_checkout_page() | |
{ | |
wc_print_notice( __( 'Please enter complete address to get the accurate Estimated delivery date', 'woocommerce' ), 'notice' ); // You can replace notice with error or success | |
} |
This file contains hidden or 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 change product description in commercial invoice. | |
* Created at : 28 Dec 2018 | |
* PluginHive Plugins : https://www.pluginhive.com/plugins/ | |
*/ | |
add_filter( 'ph_fedex_commodities','ph_fedex_commodities_description_customization',10,3); | |
function ph_fedex_commodities_description_customization($commodoties,$request,$fedex_packages) { | |
$products=array( | |
array( 'ids'=>array('199','122','789'), |
This file contains hidden or 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 to adjust importer price for international Shipment FedEx | |
* Created at : 24 Dec 2018 | |
* PluginHive Plugins : https://www.pluginhive.com/plugins/ | |
*/ | |
add_filter( 'ph_fedex_commodities', 'ph_importer_price_adjust', 11, 3); | |
public function ph_importer_price_adjust($commodoties,$request,$fedex_packages){ | |
$importer_price = array( | |
/* Experiment */ |
This file contains hidden or 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 support Addon_Plugin_dividing_single_product. | |
* Created at : 24 Dec 2018 | |
* PluginHive Plugins : https://www.pluginhive.com/plugins/ | |
*/ | |
add_filter( 'wf_fedex_commodities', 'wf_fedex_request_update_commodity', 10, 3); | |
function wf_fedex_request_update_commodity($commodities,$request,$fedex_packages) | |
{ | |
$final_product=array(); | |
if(!empty($commodities)) |
This file contains hidden or 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
/** | |
* Show hide accesspoint location based on chosen shipping methods. | |
* Created at : 18 Dec 2018 | |
* PluginHive Plugins : https://www.pluginhive.com/plugins/ | |
*/ | |
add_action( 'wp_footer', 'conditionally_hidding_billing_custom_field' ); | |
function conditionally_hidding_billing_custom_field(){ | |
// Only on checkout page |
This file contains hidden or 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
/** | |
* Split cart packages based on product category. | |
* Created at : 17 Dec 2018 | |
* Updated at : 19 Dec 2018 | |
* PluginHive Plugins : https://www.pluginhive.com/plugins/ | |
*/ | |
add_filter( 'woocommerce_cart_shipping_packages', 'wf_split_cart_by_shipping_class_group' ); | |
function wf_split_cart_by_shipping_class_group($package){ |
This file contains hidden or 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 adjust rates based on package dimension. | |
* Created at : 14 Dec 2018 | |
* PluginHive Plugins : https://www.pluginhive.com/plugins/ | |
*/ | |
add_filter('wf_ups_rate', 'wf_modify_ups_rate', 10, 2); | |
function wf_modify_ups_rate($xml, $packages){ | |
if(empty($packages)) | |
{ |
This file contains hidden or 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 change estimate delivery if product is in back order. | |
* Created at : 08 Dec 2018 | |
* PluginHive Plugins : https://www.pluginhive.com/plugins/ | |
* Gist Link : https://gist.github.com/renjith-ph/7ea21e6c60af0bab989ed2a57e98477e | |
*/ | |
add_filter( 'woocommerce_get_availability', 'woocommerce_get_availability',12,2 ); | |
function woocommerce_get_availability( $stock_arr ,$item) { |