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 woocommerce estimated delivery after email text you have received an order (default) in New Order Email sent to admin. All Text Format( simple, simple_range and date_range ) supported | |
* Created at : 19 July 2018 | |
* Updated at : 19 July 2018 | |
* PluginHive Plugins : https://www.pluginhive.com/plugins/ | |
* Gist Link : https://gist.github.com/xadapter/dc915ec735c5aba2d8d191d7563e563d/ | |
*/ | |
add_action( 'woocommerce_email_order_details', 'ph_add_estimated_delivery_after_heading', 1, 4 ); |
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 adjust woocommerce estimated delivery based on shipping class on Product, Cart, Checkout and Thank you Page. | |
* Created at : 18 July 2018 | |
* Updated at : 18 July 2018 | |
* PluginHive Plugins : https://www.pluginhive.com/plugins/ | |
* Gist Link : https://gist.github.com/xadapter/6c428a24a9f2eb7355a1ed1d04e8c5f7 | |
*/ | |
// Cart and Checkout Page |
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 hide woocommerce shipping methods based on days, based on cutoff time. Drawback - If Calculated before Cutoff time and placed order after cutoff then it won't work. | |
* Created at : 16 July 2018 | |
* Updated at : 02 Aug 2018 | |
* PluginHive Plugins : https://www.pluginhive.com/plugins/ | |
* Gist Link : https://gist.github.com/xadapter/d8caee4845bb41c0d3da1a9b2a3ba897 | |
*/ | |
add_filter( 'woocommerce_package_rates', function( $shipping_rates) { | |
// To hide shipping methods based on days |
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 remove recipient's email address in Woocommerce UPS shipment request. | |
* Created at : 16 July 2018 | |
* Updated at : 16 July 2018 | |
* PluginHive Plugins : https://www.pluginhive.com/plugins/ | |
* Gist Link : https://gist.github.com/xadapter/d572fe8d690605118c76d8f1ee23df94 | |
*/ | |
add_filter( 'wf_ups_shipment_confirm_request_data', function($request_arr){ | |
unset($request_arr['Shipment']['ShipTo']['EMailAddress']); | |
return $request_arr; |
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 display estimated delivery in different format (simple and date range, settings should be in date range ) on product page based on shipping class. | |
* Created at : 13 July 2018 | |
* Updated at : 13 July 2018 | |
* PluginHive Plugins : https://www.pluginhive.com/plugins/ | |
* Gist Link : https://gist.github.com/xadapter/a3aebdd786e553056b49617cfea0cc8b | |
*/ | |
add_filter( 'woocommerce_get_availability', 'ph_change_estimated_delivery_style_based_on_shipping_class', 11, 2 ); | |
if( ! function_exists('ph_change_estimated_delivery_style_based_on_shipping_class') ) { |
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 add extra cost per package to the Woocommerce UPS rate. | |
* Created at : 12 July 2018 | |
* Updated at : 12 July 2018 | |
* PluginHive Plugins : https://www.pluginhive.com/plugins/ | |
* Gist Link : https://gist.github.com/xadapter/5a6404c130dbc61883bda20c392933a4 | |
*/ | |
add_filter( 'wf_ups_rate', function( $response ) { | |
$cost_to_add_per_package = 10; // Add fixed cost to shipping rate per 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
/** | |
* Snippet to allow automatic label generation based on order status. | |
* Created at : 10 July 2018 | |
* Updated at : 10 July 2018 | |
* PluginHive Plugins : https://www.pluginhive.com/plugins/ | |
* Gist Link : https://gist.github.com/xadapter/b19d10709f51d38092cb604364c7cde5 | |
*/ | |
add_filter( 'xa_automatic_label_generation_allowed_order_status', 'xa_allow_automatic_label_generation_based_on_order_status', 10, 3 ); |
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 add handling charge in percent to to shiiping cost based on shipping method and shipping zone. Use * to define for all the remaining zone. | |
* Created at : 09 July 2018 | |
* Updated at : 18 July 2018 | |
* PluginHive Plugins : https://www.pluginhive.com/plugins/ | |
* Gist Link : https://gist.github.com/xadapter/b52eae8ba6d8f8d60513f31bb4cbc630 | |
*/ | |
add_filter( 'woocommerce_package_rates',function( $shipping_rates ){ |
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 | |
/** | |
* Custom code shortcode | |
* | |
* This template can be overridden by copying it to yourtheme/woocommerce_email_cuztomizer_with_drag_and_drop_builder/woo_mail/custom_code.php. | |
* @var $order WooCommerce order | |
* @var $email_id WooCommerce email id (new_order, cancelled_order) | |
* @var $sent_to_admin WooCommerce email send to admin | |
* @var $plain_text WooCommerce email format | |
* @var $email WooCommerce email object |
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 hide shipping method. Useful in case of Local Pickup plus. In case of Local pickup plus add a flat rate or free shipping in every zone, and hide it using below snippet. UPS or Fedex rate will get displayed. | |
* Created at : 04 July 2018 | |
* Updated at : 04 July 2018 | |
* PluginHive Plugins : https://www.pluginhive.com/plugins/ | |
* Gist Link : https://gist.github.com/xadapter/2db2a904b2ba5b0fcf533345c86d67f3 | |
*/ | |
add_filter( 'woocommerce_package_rates',function( $shipping_rates ){ | |
$shipping_methods_to_unset = array( 'flat_rate:6' ); // Shipping method id |