Rewrite product and shop base the same
By default, Woocommerce uses a different base permalink structure for product and shop. But suppose you want to be able to use the following URLs Shop: /products Shop category: /products/product-category/ Product: /products/product-category/product-name …then add the following permalinks programmatically to your functions.php
Apply coupon on woocommerce price
To apply a coupon on a Woocommerce price programmatically use the following function.
WC price without formatting
To show the wc_price() without formatted HTML use the following function:
Cartflows get cart total without discount
For one of my projects I needed the original cart total price without the Cartflows product discounts. I created the following function to achieve this:
WooCommerce price based on user role
One of my clients needed different product prices for their users based on their role. His website included a user role for resellers who have to see lower prices than default customers. To modify the price based on the user role I needed 2 things to know: How to check the current user’s role? What […]
WooCommerce PDF invoice plugin disable attachment by user role
A customer of mine wanted to use the WooCommerce PDF Invoices & Packing Slips plugin, but wanted to make a small adjustment before he could use the plugin. WooCommerce PDF Invoices & Packing Slips plugin This WooCommerce extension automatically adds a PDF invoice to the confirmation email of the order that is sent to your […]