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
add_action( 'woocommerce_order_status_completed', 'wpglorify_change_role_on_purchase' ); | |
function wpglorify_change_role_on_purchase( $order_id ) { | |
// get order object and items | |
$order = new WC_Order( $order_id ); | |
$items = $order->get_items(); | |
$product_id = 56; // that's a specific product ID |
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
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 ); | |
add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 15 ); | |
// Try this to move only varations | |
remove_action( 'woocommerce_single_variation', 'woocommerce_single_variation', 10 ); | |
add_action( 'woocommerce_single_product_summary', 'woocommerce_single_variation', 15 ); |
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
# Block WordPress xmlrpc.php requests | |
<Files xmlrpc.php> | |
order allow,deny | |
deny from all | |
</Files> |
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
<?php | |
/* | |
* source: https://wpglorify.com/?p=3846 | |
* Hide coupon notice on the checkout page if a coupon has been applied in cart | |
*/ | |
add_filter( 'woocommerce_coupons_enabled', 'woocommerce_coupons_enabled_checkout' ); | |
function woocommerce_coupons_enabled_checkout( $coupons_enabled ) { | |
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
remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_title', 5); | |
remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_rating', 10); | |
add_action( 'woocommerce_before_single_product_summary', 'woocommerce_template_single_title', 5 ); | |
add_action( 'woocommerce_before_single_product_summary', 'woocommerce_template_single_rating', 4); |
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
/** | |
* @snippet Deny Checkout to User With Pending Orders | WooCommerce | |
* @sourcecode https://wpglorify.com/?p=1952 | |
* @author Garry Singh | |
* @testedwith WooCommerce 3.0.7 | |
*/ | |
add_action('woocommerce_after_checkout_validation', 'wpglorify_deny_checkout_user_pending_orders'); | |
function wpglorify_deny_checkout_user_pending_orders( $posted ) { |