This file contains hidden or 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: Wocommerce apply coupon automatically to the cart for specific products | |
* @Author: Mina Pansuriya | |
* @Blog URL :http://minapansuriya.com/wocommerce-apply-coupon-automatically-to-the-cart-for-specific-products/ | |
**/ | |
add_action( 'woocommerce_before_cart', 'pbs_apply_auto_discount_coupons' ); | |
function pbs_apply_auto_discount_coupons() { | |
global $woocommerce; |
This file contains hidden or 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 Bcc email to Completed Order Email | |
* @Author: Mina Pansuriya | |
* @Blog URL: http://minapansuriya.com/woocommerce-add-bcc-email-to-completed-order-email/ | |
**/ | |
add_filter( 'woocommerce_email_headers', 'es_headers_filter_function', 10, 3); | |
function es_headers_filter_function( $headers, $id, $object ) | |
{ |
This file contains hidden or 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 a product to the cart programmatically | |
* @Author: Mina Pansuriya | |
* @Website: http://minapansuriya.com | |
* @Blog URL: http://minapansuriya.com/woocommerce-add-a-product-to-the-cart-programmatically/ | |
*/ | |
add_action( 'template_redirect', 'pbs_woo_add_gift_product_to_the_cart' ); | |
function pbs_woo_add_gift_product_to_the_cart() { | |
$isAddGiftF = false; | |
This file contains hidden or 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 - List All Products From a specific category | |
* @Author: Mina Pansuriya | |
* @Website: http://minapansuriya.com | |
* @Blog URL: http://minapansuriya.com/woocommerce-list-all-products-from-a-specific-category/ | |
*/ | |
<?php | |
$cat_name = 'Bags'; // Here replace Category name with yours | |
$product_cat = get_term_by( 'name', $cat_name, 'product_cat' ); | |
$cat_slug = $product_cat->slug; |
This file contains hidden or 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 - List All Categories | |
* @Author: Mina Pansuriya | |
* @Website: http://minapansuriya.com | |
* @Blog URL: http://minapansuriya.com/woocommerce-list-all-categories/ | |
*/ | |
<?php | |
$args = array( | |
'taxonomy' => 'product_cat', | |
'orderby' => 'name', |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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() ) | |
{ |
NewerOlder