Skip to content

Instantly share code, notes, and snippets.

View MinaPansuriya's full-sized avatar

Mina Pansuriya MinaPansuriya

View GitHub Profile
/**
* @Title:WooCommerce Change "Continue Shopping" Message on Cart Page
* @Author: Mina Pansuriya
* @Website: http://minapansuriya.com
*/
add_filter( 'wc_add_to_cart_message', 'pbs_change_cart_message', 10, 2 );
function pbs_change_cart_message( $cart_message, $product_id ) {
if(strpos($cart_message, "Continue Shopping") !== false)
/**
* @Title: WooCommerce Hide/Disable Coupons
* @Author: Mina Pansuriya
* @Website: http://minapansuriya.com
*/
add_filter( 'woocommerce_coupons_enabled', 'pbs_woo_disable_coupon' );
function pbs_woo_disable_coupon( $coupons_enabled ) {
return false;
}
/**
* @Title: WooCommerce Display Coupon on Checkout page only
* @Author: Mina Pansuriya
* @Website: http://minapansuriya.com
*/
function pbs_woo_hide_coupon_on_cart_page( $enabled ) {
if ( is_cart() ) {
$enabled = false;
}
return $enabled;
/**
* @Title: WooCommerce Change Default Placeholder image for Product page
* @Author: Mina Pansuriya
* @Website: http://minapansuriya.com
*/
add_action( 'init', 'ccw_custom_woo_placeholder' );
function ccw_custom_woo_placeholder(){
add_filter('woocommerce_placeholder_img_src','pbs_woo_product_placeholder_img_src');
function pbs_woo_product_placeholder_img_src($src){
// Here replace your image attachment ID with 2966
/**
* @Title: WooCommerce Charge additional amount if Cart Quantity exceed given amount
* @Author: Mina Pansuriya
* @Website: http://minapansuriya.com
*/
add_action( 'woocommerce_cart_calculate_fees', 'pbs_woo_charge_additional_fees_for_x_no_of_products' );
function pbs_woo_charge_additional_fees_for_x_no_of_products(){
global $woocommerce;
/**
* @Title: WooCommerce Edit Checkout Billing Address fields
* @Author: Mina Pansuriya
* @Website: http://minapansuriya.com
*/
add_filter( 'woocommerce_checkout_fields' , 'pbs_woo_customize_checkout_billing_address_fields' );
function pbs_woo_customize_checkout_billing_address_fields( $fields ) {
// Remove Billing Company Field
/**
* @Title: WooCommerce Add Custom Notes to Order Email
* @Author: Mina Pansuriya
* @Website: http://minapansuriya.com
*/
add_action( 'woocommerce_email_after_order_table', 'pbs_woo_add_custom_message_to_admin_new_order', 15, 2 );
function pbs_woo_add_custom_message_to_admin_new_order( $order, $is_admin_email ) {
if ( $is_admin_email ) {
/**
* @Title: WooCommerce Remove SKU from the website completely.
* @Author: Mina Pansuriya
* @Website: http://minapansuriya.com
*/
add_filter( 'wc_product_sku_enabled', '__return_false' );