Tags pages for different Custom Post Types and WooCommerce Products sharing Post Tags

I found out ! I just had to declare the paged rewrite rule before the non-paged rewrite rule… add_rewrite_rule( ‘activities/([^/]+)/page/([0-9]{1,})/?’, ‘index.php?tag=$matches[1]&product_cat=activities&pages=$matches[2]’, ‘top’ ); add_rewrite_rule( ‘activities/tag/([^/]+)’, ‘index.php?tag=$matches[1]&product_cat=activities’, ‘top’ );

Multiple sorting criteries (order by)

The solution is old as time is. And it was already described earlier. Place in functions.php class iWC_Orderby_Stock_Status { public function __construct() { // Check if WooCommerce is active if (in_array(‘woocommerce/woocommerce.php’, apply_filters(‘active_plugins’, get_option(‘active_plugins’)))) { add_filter(‘posts_clauses’, array($this, ‘order_by_stock_status’), 2000); } } public function order_by_stock_status($posts_clauses) { global $wpdb; // only change query on WooCommerce loops if (is_woocommerce() … Read more

Woocommerce REST API not considering discounts and coupons

In your coupon_lines array, each item in the array needs 2 properties: code (the coupon code itself) and amount, which is either a flat fee (eg 50.00 off) or a discount (eg 10% off). Your structure ends up looking like: “coupon_lines”: [ { “code”: “MYCODE1”, “amount”: “10.00” }, { “code”: “MYCODE2”, “amount”: “25.00” } ] … Read more

WooCommerce custom checkbox $_POST issue on checkout

I have found a solution: // 2. Display T&C @ Single Order Page add_action( ‘woocommerce_admin_order_data_after_billing_address’, ‘display_optout_acceptance’, 10, 1 ); function display_optout_acceptance( $order ) { $nosignoptout = get_post_meta( $order->get_id(), ‘nosign’, true ); if ( $nosignoptout == 1) { echo ‘<p><strong>Shipping Opt-Out: </strong>Selected</p>’; } else echo ‘<p><strong>Shipping Opt-Out: </strong>Not Selected</p>’; }