We already saw how to add a product to cart automatically, for example if you visit a specific page or if there are no products in the cart – but today we want to find out how to do the opposite: if a certain condition is met, we want to remove a product ID from the cart.
This becomes a little complex – while adding an item to cart requires just its product ID, removing it from the cart forces you to know the “cart item key”. Japanese, I know, but just copy the snippet and you’re done! Continue reading WooCommerce: Remove Product From Cart Programmatically
Do you want to sell your handmade items online? Don’t worry, it won’t be that hard with the best handmade and crafts WooCommerce themes. These themes are perfect for beginners thanks to visual builders, extensions and sliders.
WooCommerce is a comprehensive WordPress solution to run an ecommerce website. If you opt for WooCommerce, you’ll experience its simplicity when creating the layouts, managing styles and adding content to your store. What’s more, you’ll get a chance to pick a number of exceptional WordPress plugins that are WooCommerce-compatible.
With WooCommerce you get:
- Multiple product types: sell not only tangible goods but also digital products, content and even appointments
- Rich blogging experience: build a strong brand and rank higher on SERPs, thanks to WordPress CMS
- Compatibility with other popular WordPress plugins
- Trouble-free integration: easily embed products, checkout and other store functionality in any page of your website
- Tags, categories and attributes to let users find exactly what they need
- Prolific product sorting and filtering options
- Customer ratings and reviews
These themes I’ve chosen have the most attractive designs and modern functionality, and tey let you customize your store in visual mode. Moreover, they feature premium extensions for product filtering, Ajax cart functionality, zoom, product quick view, wish-list, comparisons, etc.
And if you create WooCommerce websites on a regular basis you can get access to 132 unique WooCommerce themes at ONE subscription. But for now, these are my top 10 handmade WooCommerce themes. Continue reading Top 9 Crafts & Handmade WooCommerce Themes
You’re looking to assign different unit prices based on the quantity added to Cart, for example from 1-100 price is $5, from 101-1000 price is $4.90 and from 1001 units ordered price becomes $4.75.
There are many “Dynamic Pricing” plugins out there (and the number #2 on this article would suit complex pricing rules and dynamic discounts), but this time I want to teach you a simple code to DIY WooCommerce quantity-based pricing.
As usual, comments and shares are much appreciated. Enjoy! Continue reading WooCommerce: Bulk Dynamic Pricing Without a Plugin
If you sell one-off products like online courses, lifetime memberships or unique pieces that can only be purchased once by a given customer, maybe you’d better redirecting the logged in customer who has purchased that product to a custom URL, such as the shop page, the “my courses” page for online courses or another customer-specific section.
With this easy snippet you’ll learn how to see if a user is logged in and has purchased a given product ID and then how to do a safe PHP redirect. Enjoy! Continue reading WooCommerce: Single Product Page Redirect for Logged In Customers
If you want to create your ecommerce business from scratch or freshen up your WooCommerce theme, today’s topic might catch your attention.
I want to share with you the new ONE subscription service for designers and developers. ONE is a service from TemplateMonster, which provides access to lots of themes and tools for design and development for a fixed yearly payment.
ONE is a service that works on a paid subscription. You don’t have to worry about credits and download restrictions. This approach gives you the opportunity to experiment with different templates before making a final decision – and if you don’t find what you need, there is also a 14 days money back guarantee.
Thanks to the subscription, you can access not only themes and templates, but also plugins, graphic elements and even PowerPoint templates. There are also lots of Elementor templates and many different themes for ecommerce like Magento, OpenCart and, of course, WooCommerce. Continue reading 132 WooCommerce Themes at ONE Subscription
Currently, you can use a widget to have the user see the list of products they recently viewed. This is great and sooner or later it will also become a Gutenberg block I believe.
But for now, let’s create our own shortcode… and let’s take advantage of the existing [products] shortcode and learn how we can “pass” product IDs to it without the need of reinventing the wheel.
This snippet teaches you where recently viewed products are stored (spoiler: in a cookie) and also how to use an existing shortcode… inside a new shortcode. Enjoy! Continue reading WooCommerce: Recently Viewed Products (Shortcode)
“Continue Shopping” appears on the Cart page when an item is added to Cart and you have “Redirect to the cart page after successful addition” enabled via the WooCommerce settings.
By default, “Continue Shopping” button redirects to the previously visited page – sometimes this makes no sense and you might want to send them back to the main shop page instead (or a custom page).
Here’s a quick snippet to do just that. Enjoy! Continue reading WooCommerce: Edit “Continue Shopping” Link Redirect
Some plugins such as “deposit” and “subscription” payments send customers to the “Pay for Order” page in order to complete a pending WooCommerce order. In certain cases, also, customer is forced to log in and this really affect sales conversion rate – instead of the checkout form customers see this notice: “Please log in to your account below to continue to the payment form“.
Here’s a quick snippet to make sure customers do not have to log in when on the “Pay for Order” page, so that they can immediately go ahead with the payment. The WooCommerce function in question is wc_customer_has_capability, and thankfully we can override this with the user_has_cap filter. Enjoy! Continue reading WooCommerce: Allow to “Pay for Order” Without Login
Here’s a visual hook guide for Shoptimizer Theme by CommerceGurus, a WooCommerce theme specifically developed with speed, performance, sales conversion and UX in mind.
This visual guide belongs to my “Visual Hook Guide Series“, that I’ve put together so that you can find WooCommerce hooks quickly and easily by seeing their actual locations. Also, you can copy & paste in seconds and speed up your customization time.
Let me know in the comments what you think about this resource! Enjoy! Continue reading Shoptimizer Theme Visual Hook Guide
If you’re developing custom landing pages or sections dedicated to logged in customers, knowing the quantity purchased of a certain product ID might come useful.
We already saw how to detect whether a logged in customer has purchased a given product, as well as a snippet to return all products purchased by a specific user – but this time I want to “count” how many times a current user has purchased a product ID, and return this on the screen via a shortcode.
From this snippet you can learn lots of things, for example how to create custom shortcodes, how to get customer orders, and how to set up a foreach loop in PHP. Either way, enjoy! Continue reading WooCommerce: Count User Purchases By Product ID (Shortcode)
If you want to increase your AOV (Average Order Value), you can definitely start from the WooCommerce Checkout page.
A client asked me to place a “Donation Area” close to the “Place Order” button (so at the bottom of the page, once customers are ready to pay) to drive more awareness around this add-on. All I had to do was creating hidden products with a donation value, use my own “Custom Add to Cart URL” guide to create add to cart links and print an HTML box right above the checkout button by using my WooCommerce Visual Hook Guide for the Checkout Page. Enjoy! Continue reading WooCommerce: Add Upsell Area @ Checkout Page
Depending on your theme, just creating an href link anchor to a product tab might or might not work i.e. it might not scroll to it as it’s currently closed.
Here comes a way to create href links that not only scroll to the tab, but also open it in case it’s closed (this will guarantee the anchor scroll to the tab). Also, a little jQuery “animate” will provide the smooth scroll and enhance UX. Hope you enjoy! Continue reading WooCommerce: Scroll To Product Tab @ Single Product Page
There are many snippets on the internet but many are out of date… so this is how to completely hide the Shop Page title in WooCommerce (plus: how to hide the title on WooCommerce Category pages). Enjoy! Continue reading WooCommerce: Remove “Shop” Title @ WooCommerce Shop Page
Keeping WooCommerce upsells at the very bottom of the single product page it’s kinda boring. In my view, WooCommerce users want to know there are upsells even before they scroll down (you also might want that: upsell means more profit). Amazon does that too.
In this tutorial, we will see not only how to move them to the top, right below the Add to Cart, but also how to customize the upsells output to show just 2 columns and remove default WooCommerce “loop” elements such as the Add to Cart. Enjoy! Continue reading WooCommerce: Move & Customize Upsells @ Single Product
This is a very specific function. Sometimes, you need to “set” a checkout field value upon order creation (because it was not required and left empty for example). In some other cases, you might want to override what the customer input if you have certain requirements.
Either way, overriding the checkout fields on order creation is super easy. Here’s how it’s done – enjoy! Continue reading WooCommerce: Set Checkout Field Value @ Order Creation
As you know, one of the product bulk edit methods comes with WooCommerce out of the box. It can be found under “WP Dashboard” > “Products” > “Bulk Actions” > “Edit”. For example, you can decrease all prices by 10%, or bulk assign a new product category.
However, if you added a custom product field such as RRP, this won’t show automatically there in the bulk edit form – you’ll therefore need to add it via code. Thankfully, WooCommerce gives us a “hook” we can use to display the input in the bulk edit form. After that, another PHP function will be used to save and store the value.
Easy as pie! Just copy & paste into your functions.php. Enjoy 🙂 Continue reading WooCommerce: Add Custom Field to “Bulk Actions” > “Edit”
Here’s how you can display a “checkbox” in the product edit page in order to hide the Related Products section in case this is checked. This is something you can also reuse to hide other sections in the same way – for example you might need to hide product tabs or featured image in certain cases.
I’ve coded this in 15 minutes for a client so why not sharing it with you too? Here’s the full snippet, enjoy! Continue reading WooCommerce: Checkbox to Disable Related Products Conditionally
WooCommerce product add-ons are custom input fields that show on the single product page. They’re called “add-ons” as you can add a product personalization or an upsell (at a cost of course).
For example, you can display a text input to print something on the product. Or radio buttons to select different kinds of product upgrades. Or a checkbox to upsell gift wrapping.
Either way, and of course, there are plugins for that. But first, I want to give you a tutorial to code this by yourself (case study: global custom input text field and no surcharge), so that you can learn something new. Enjoy! Continue reading WooCommerce: Product Add-Ons (Without a Plugin!)
In terms of SEO, if you’re trying to rank your product category pages, you really need to make the most of the default WooCommerce product category “description” and “thumbnail”. Most themes, if compatible with WooCommerce, will show this content right below the product category name and above products.
Nothing new so far. But what if you want to add another piece of content below the category products while also keeping the default description? Well, we’d need to customize the edit category page and display a new text editor field, save it, and finally display it where we want. So, here’s how they do it! Continue reading WooCommerce: Add a Second Content Box @ Product Category Pages
By default, empty WooCommerce product categories (i.e. categories which have no published products) will not display on your Shop page.
This makes a lot of sense and avoids that customers land on empty pages… BUT sometimes you might have different needs and require that users still see these categories when the shop display is set to “Show Categories”.
Thankfully there is a quick one-line fix that you can copy / paste in your functions.php to show empty categories… enjoy! Continue reading WooCommerce: Show Empty Product Categories