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 reduce the shipping Cost for Particular Country and Shipping Method if Shipping class exists in cart. | |
* Created at : 15 Jan 2019 | |
* Updated at : 15 Jan 2019 | |
* PluginHive Plugins : https://www.pluginhive.com/plugins/ | |
* Gist Link : https://gist.github.com/varun-pluginhive/0d86c88cbe37b240d313588dbcced366 | |
*/ | |
if( ! function_exists('ph_reduce_shipping_method_cost') ) { | |
function ph_reduce_shipping_method_cost( $shipping_costs, $package ){ | |
$shipping_classes = array( 'shipping_class_a', 'shipping_class_b', 'shipping_class_c' ); // Shipping Classes that should be in cart to reduce the 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
/** | |
* Snippet to Add Handling Fee based on number of UPS Packages. | |
* Created at : 02 Jan 2018 | |
* Updated at : 02 Jan 2018 | |
* PluginHive Plugins : https://www.pluginhive.com/plugins/ | |
* Gist Link : https://gist.github.com/varun-pluginhive/82552099b55a500c4844df65d3e48723 | |
*/ | |
// Get the number of ups packages and set in session | |
add_filter( 'ph_ups_generated_packages', function( $ups_packages ) { |
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 the number of places left shown in WooCommerce Bookings on hover. | |
* Created at : 02 Jan 2019 | |
* Updated at : 02 Jan 2019 | |
* PluginHive Plugins : https://www.pluginhive.com/plugins/ | |
* Gist Link : | |
*/ | |
add_action( 'woocommerce_after_single_product', function() { | |
?> | |
<script> |
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
div.summary.entry-summary{ | |
display: contents !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
/** | |
* Snippet to convert city as Drop Down in WooCommerce Checkout | |
* Created at : 28 Dec 2018 | |
* Updated at : 28 Dec 2018 | |
* PluginHive Plugins : https://www.pluginhive.com/plugins/ | |
* Gist Link : https://gist.github.com/varun-pluginhive/77383993417e6db5a71292a9548b1542 | |
*/ | |
add_filter( 'woocommerce_checkout_fields', function( $fields ) { | |
$city_args = wp_parse_args( array( |
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
/** | |
* Style to change Bookings Calendar style on hover. | |
* Created at : 24 Dec 2018 | |
* Updated at : 24 Dec 2018 | |
* PluginHive Plugins : https://www.pluginhive.com/plugins/ | |
* Gist Link : https://gist.github.com/varun-pluginhive/8bd634b7d93253d45b88289e10119f12 | |
*/ | |
li.ph-calendar-date:hover{ | |
background-color:red; |
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 check for PO Box Address in Shipping Line Address 1 and 2 and throw the error if found. | |
* Created at : 19 Dec 2018 | |
* Updated at : 19 Dec 2018 | |
* PluginHive Plugins : https://www.pluginhive.com/plugins/ | |
* Gist Link : https://gist.github.com/varun-pluginhive/89ae4de38f5a4f5ef7a65f2a67fa1e34 | |
*/ | |
add_action( 'woocommerce_after_checkout_validation', function($data) { | |
$text_to_check = array( 'PO', 'PO.', 'PoBox' ); // Text to check in shipping address Line 1 and 2 | |
$message = "PO Box is not allowed please check your address."; |
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 change Booking Product font-size of Time in Product Page. | |
* Created at : 19 Dec 2018 | |
* Updated at : 19 Dec 2018 | |
* PluginHive Plugins : https://www.pluginhive.com/plugins/ | |
* Gist Link : https://gist.github.com/varun-pluginhive/78996c9a57e98cf319a9b0f9d44a1e6a | |
*/ | |
add_action( 'woocommerce_after_single_product', function() { | |
?> | |
<script> |
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 message to the cart page. | |
* Created at : 17 Dec 2018 | |
* Updated at : 17 Dec 2018 | |
* PluginHive Plugins : https://www.pluginhive.com/plugins/ | |
* Gist Link : https://gist.github.com/varun-pluginhive/9938137d3a7f8e6b910109267f61e88f | |
*/ | |
add_action( 'woocommerce_init', function(){ | |
$message = "Please proceed to the Checkout page to get the UPS AccessPoint option as delivery option."; // Provide the message | |
$request_url = $_SERVER['REQUEST_URI']; |
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 set minimum weight of UPS Package. | |
* Created at : 03 Dec 2018 | |
* Updated at : 03 Dec 2018 | |
* PluginHive Plugins : https://www.pluginhive.com/plugins/ | |
* Gist Link : https://gist.github.com/varun-pluginhive/a59ff76a71e33dd97303f931375d2ad5 | |
*/ | |
add_filter( 'ph_ups_generated_packages', function( $packages ){ | |
$min_weight = 0.5; // Minimum Weight of Package | |
foreach( $packages as &$package ) { |
NewerOlder