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 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
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
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
/** | |
* 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_add_warning_on_above_estimated_delivery',11,2 ); | |
function ph_estimated_delivery_add_warning_on_above_estimated_delivery( $text, $test ) { | |
$message='<tr class="shipping"><th>Your cart having back-order products</th></tr>'; // add your message here | |
$text=$message.$text; | |
return $text; | |
} |
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 price to custom declared value and change unit of measurement for international shipping. | |
Created at : 26 Nov 2018 PluginHive Plugins : https://www.pluginhive.com/plugins/ | |
updated on : 14 Jan 2019 | |
*/ | |
add_filter( 'wf_ups_shipment_confirm_request_product_details', 'wf_ups_shipment_confirm_request_product_details', 10, 2 ); | |
if( ! function_exists('wf_ups_shipment_confirm_request_product_details') ) { | |
function wf_ups_shipment_confirm_request_product_details( $product_details, $product_data ) { | |
if(!empty($product_data)) |
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 add extra product description for UPS international shipping. | |
Created at : 14 Jan 2019 PluginHive Plugins : https://www.pluginhive.com/plugins/ | |
*/ | |
add_filter( 'wf_ups_shipment_confirm_request_product_details', 'ph_ups_add_extra_product_description_for_commercial_invoice', 10, 2 ); | |
if( ! function_exists('ph_ups_add_extra_product_description_for_commercial_invoice') ) { | |
function ph_ups_add_extra_product_description_for_commercial_invoice( $product_details, $product_data ) { | |
$description=".Add your description here"; // add extra description in the commercial invoice. | |
$product_details['Description']=$product_details['Description'].$description; |
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 redirect to checkout page after adding product to cart. | |
Created at : 16 Jan 2019 PluginHive Plugins : https://www.pluginhive.com/plugins/ | |
https://gist.github.com/renjith-ph/0defbaf8a48d49ec61fc50add6b1b051 | |
*/ | |
function ph_change_redirect_url_after_adding_product_to_cart( $url ) { | |
$url = wc_get_checkout_url(); | |
return $url; | |
} | |
add_filter( 'woocommerce_add_to_cart_redirect', 'ph_change_redirect_url_after_adding_product_to_cart' ); |
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 add custom message on top of checkout page if shipping methods are available. | |
Created at : 16 Jan 2019 PluginHive Plugins : https://www.pluginhive.com/plugins/ | |
gist link: https://gist.github.com/renjith-ph/8f27c63d5a079d578ad3c7db00ece94b | |
*/ | |
add_action( 'woocommerce_before_checkout_form', 'ph_add_custom_message_on_top_of_checkout_page_if_shipping_method_available', 10 ); | |
function ph_add_custom_message_on_top_of_checkout_page_if_shipping_method_available() | |
{ | |
$i=0; | |
$message="Do you qualify for a shipping discount? Give us a call at 541-419-6054"; // this message will display on top of checkout page |