Skip to content

Instantly share code, notes, and snippets.

View wpeliteplugins's full-sized avatar
🎯
Focusing

WPElitePlugins wpeliteplugins

🎯
Focusing
View GitHub Profile
@wpeliteplugins
wpeliteplugins / woo_include_recaptcha_script.php
Created June 5, 2017 17:34
Recaptcha for WooCommerce - Include script on custom page
<?php // Do not Write if its not already open
add_filter( 'woo_include_recaptcha_script', 'woo_recaptcha_include_script' );
function woo_recaptcha_include_script( $include ) {
return $include = true;
}
@wpeliteplugins
wpeliteplugins / woo-min-max-change-error-message.php
Created February 9, 2017 17:49
Change error message - WooCommerce minumum/maximum quantities
<?php
// To change error message:
// The minimum allowed quantity for ABC is 5 (you currently have x in your cart).
add_filter('woo_min_allowed_product_qty_err', 'woo_min_allowed_product_qty_err_message', 10, 4 );
function woo_min_allowed_product_qty_err_message( $err_msg, $_product, $minimum_quantity, $in_cart ) {
$err_msg = __( 'Your message here', 'woo_min_max_quantities' );
return $err_msg;
@wpeliteplugins
wpeliteplugins / woo-gateway-df-rounding-99-cents.php
Created December 13, 2016 17:58
Rounding Discount or Fees to nearest .99 cents - WooCommerce Payment Gateways Discount and Fees
<?php
add_filter('woo_gatway_df_amount', 'woo_amount_to_99_cents' );
function woo_amount_to_99_cents( $amount ) {
$amount = number_format( round( $amount, 0 ) - 0.01, 2 ); // round to 99 cents
return $amount;
}