With Paid Membership Pro (PMPro) plugin, you can restrict certain products for certain membership levels. But by default, when a member visits shop, they can still see those restricted products, which they were not supposed to see. We will avoid that using woocommerce_product_query action hook, by modifying the default WooCommerce… Read More »
Category: WooCommerce
Redirect WooCommerce Category and Tag archives to shop page
Not every WooCommerce store needs or wants a category or tag archive. is_product_category detects if current page is a WooCommerce category archive or not. Similarly, is_product_tag detects if it a product tag archive or not. So with below small snippet we can redirect category and tag archives to shop page…. Read More »
WooCommerce login redirect to custom page
When you use WooCommerce login form (usually my-account page), by default users are redirected to my-account page after successful login. Might not be the best way to showcase your shop. Some user might want to redirect logged in users to a custom page, some might consider redirecting to shop page…. Read More »
Check if an user already used a coupon before in WooCommerce store
Let’s say you don’t want one user to use the same coupon code multiple times. There is a default option in WooCommerce coupon settings to achieve this. But today we will try and achieve this using code. Above code will be triggered when a coupon is being added. It will… Read More »
Automatically Complete all WooCommerce orders
Many people likes to mark WooCommerce orders completed automatically, as soon as they are placed. There is no default option in WooCommerce to do this directly from admin panel. But this is very easy and small customization – a few lines of codes. Code goes in the functions.php file of… Read More »
Remove WooCommerce product link from cart and thank you page
WooCommerce product links can be removed from shopping cart and thank you page. woocommerce_cart_item_permalink filter deals with the product permalink on shopping cart page. And woocommerce_order_item_permalink filter deals on thank you page. Returning false will simply remove product links from those pages. In the above code, __return_false is a default… Read More »
Show customer details on WooCommerce thank you page
If you are accepting guest orders on your WooCommerce store, after placing an order, guest users/not logged in users don’t see their details (customer details – billing/shipping addresses) on the thank you page. This can be confusing for some users, as they might be feeling comfortable seeing their billing/shipping address… Read More »
Remove “optional” text from WooCommerce checkout fields
Optional input fields in WooCommerce checkout is marked with (optional) text. This text can be removed without editing any WooCommerce template, by using woocommerce_form_field filter. Code goes in the functions.php file of your active theme…. Read More »
Customize WooCommerce order notes placeholder and label
By default the label of “order notes” on WooCommerce checkout page is “Order notes”, and placeholder is “Notes about your order, e.g. special notes for delivery.”. This can be updated using woocommerce_checkout_fields filter. Modify the placeholder and label as per your need, from the below code. Code goes in the… Read More »
