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
/** | |
* @Title: WooCommerce - Set minimum amount for delivery of an order | |
* @Author: Mina Pansuriya | |
* @Blog URL: http://minapansuriya.com/woocommerce-set-minimum-amount-for-delivery-of-an-order/ | |
add_action( 'woocommerce_check_cart_items', 'pbs_cart_check_for_min_order_amount', 99, 1 ); | |
function pbs_cart_check_for_min_order_amount( ) { | |
global $woocommerce; | |
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
/** | |
* @Title: WooCommerce - How to use Woocommerce Cart Widges on any page | |
* @Author: Mina Pansuriya | |
* @Website: http://minapansuriya.com | |
<?php the_widget( 'WC_Widget_Cart'); ?> |
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
/** | |
* @Title: WooCommerce Add Product Price Unit on Shop and Single Product Page | |
* @Author: Mina Pansuriya | |
* @Website: http://minapansuriya.com | |
*/ | |
add_filter( 'woocommerce_get_price_html', 'pbs_woo_add_product_unit_after_prie' ); | |
add_filter( 'woocommerce_cart_item_price', 'pbs_woo_add_product_unit_after_prie' ); | |
function pbs_woo_add_product_unit_after_prie( $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
/** | |
* @Title: WooCommerce Show Custom Text on Shop page to non-logged in Customer* @Author: Mina Pansuriya | |
* @Website: http://minapansuriya.com | |
*/ | |
add_action( 'woocommerce_archive_description', 'pbs_woo_product_archive_additiona_details', 20 ); | |
function pbs_woo_product_archive_additiona_details( ){ | |
if(! is_user_logged_in() ) | |
{ |
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
/** | |
* @Title: WooCommerce Hide or Remove SKU from Product Page | |
* @Author: Mina Pansuriya | |
* @Website: http://minapansuriya.com | |
*/ | |
add_filter( 'wc_product_sku_enabled', 'pbs_woo_hide_sku_on_product_page' ); | |
function pbs_woo_hide_sku_on_product_page( $sku_visibility ) { | |
if ( is_product() ) { |
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
/** | |
* @Title: WooCommerce Remove SKU from the website completely. | |
* @Author: Mina Pansuriya | |
* @Website: http://minapansuriya.com | |
*/ | |
add_filter( 'wc_product_sku_enabled', '__return_false' ); | |
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
/** | |
* @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 ) { |
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
/** | |
* @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; |
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
/** | |
* @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 |
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
/** | |
* @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; |