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>’; }

Redirect After Registration on Specific Link

Try this ode, dont forgot to change ex: http://test.com/custom_page custom_page => ( Change with your current registration page slug ) change this link ‘http://customlink.com/asdasda/‘ => (Change with where you want to redirect ) $registration_redirect=”http://customlink.com/asdasda/“ add_filter( ‘registration_redirect’, ‘my_redirect_home’ ); function my_redirect_home( $registration_redirect ) { global $post; $post_slug=$post->post_name; if( ‘custom_page’ === $post_slug ){ $registration_redirect=”http://customlink.com/asdasda/”; } return $registration_redirect; … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)