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 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 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 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 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 "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) |
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 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 |
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 - 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 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', |
NewerOlder