WooCommerce: Scroll To Product Tab @ Single Product 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

WooCommerce: Move & Customize Upsells @ Single Product

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

WooCommerce: Checkbox to Disable Related Products Conditionally

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 (Without a Plugin!)

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!)

WooCommerce: 10 Easy Snippets to Increase Your Sales

I had the pleasure to speak at WordCamp Prague 2019. I spoke about “10 PHP Snippets to Increase WooCommerce Sales” and managed to show some simple coding to the audience. Trust me – increasing your WooCommerce sales can also be done with a free, short, easy PHP snippet.

So, given that I want to share all the snippets I talked about, this is a quick recap. Copy them, test them (a must!) and then use them. And let me know if your conversion rate and/or AOV (average order value) increased!

At the bottom of the page you also find my talk slides. Enjoy:)

Continue reading WooCommerce: 10 Easy Snippets to Increase Your Sales

WooCommerce: Rename Product Description Tab Label @ Single Product Page

Product tabs show on the single product page, right below the image gallery. Tab labels are “Description”, “Additional Information”, “Reviews” by default – but what if you wish to rename them into something more relevant to your users?

Here’s a simple PHP snippet you can copy/paste into your child theme’s functions.php file to immediately change the “Description” tab name – enjoy ๐Ÿ™‚

Continue reading WooCommerce: Rename Product Description Tab Label @ Single Product Page

WooCommerce: Remove “Description” Heading @ Single Product Tabs

When you are on the single product page, and you have a non-empty product long description, a “Description” tab appears below the product images. Unfortunately, not only the tab label is “Description”, but also the tab H2 heading. This sounds and looks horrible, so here’s a way to completely remove it.

Alternatively, you can use this other snippet in order to rename it: https://businessbloomer.com/woocommerce-rename-product-description-single-product-page/ Continue reading WooCommerce: Remove “Description” Heading @ Single Product Tabs

WooCommerce: Add to Cart Quantity Plus & Minus Buttons

Here’s a quick snippet you can simply copy/paste or a mini-plugin you can install to show a “+” and a “-” on each side of the quantity number input on the WooCommerce single product page and Cart page.

The custom code comes with a jQuery script as well, as we need to detect whether the plus or minus are clicked and consequently update the quantity input. jQuery might look difficult to many, but the beauty of this is that you don’t need to have a degree in jQuery – just copy/paste the code or install the lightweight plugin and see the magic happen.

Continue reading WooCommerce: Add to Cart Quantity Plus & Minus Buttons

WooCommerce: Display Global Short Description When Empty @ Single Product Page

The WooCommerce product short description is that piece of content that appears on the right hand side of the featured image above the add to cart button. This is, of course, unless you forgot to enter the short description under Product > Edit Product > Short Description!

In case you forgot to enter it or you want to display a global short description, here’s a quick PHP snippet for you. Enjoy!

Continue reading WooCommerce: Display Global Short Description When Empty @ Single Product Page

WooCommerce: Get Currently Selected Variation ID

We’ve seen a lot of PHP so far on Business Bloomer – WooCommerce after all is a bunch of PHP files! However, sometimes PHP is just not enough, mostly when you need to work with variable products and the “currently selected variation”.

In fact, WooCommerce uses jQuery (a JavaScript Library) to handle variations on the frontend and show conditional content (variation price, description, add to cart) based on the dropdown selection. So, to detect the current variation ID we must use jQuery as well. Here’s how!

Continue reading WooCommerce: Get Currently Selected Variation ID

WooCommerce: Add Content Below Single Product Images

One of the latest WooCommerce versions introduced an optimized product gallery on the single product page. If your products have multiple images and therefore use the product gallery, you might want to also add content below the gallery itself. But…

If you’re familiar with WooCommerce customization and WooCommerce hooks (and specifically the ones of the Single Product Page), you’ll know it’s now impossible to add content under the image as it used to be done with the “woocommerce_product_thumbnails” hook.

In fact, the new gallery completely replaces the default content via JQuery, including that hook. Adding content is not as easy as it used to be. So, here’s the workaround (you might want to check how it behaves on mobile or maybe completely hide this for small devices – this has been tested on desktop only).

Continue reading WooCommerce: Add Content Below Single Product Images

WooCommerce: How to Sell Product Customizations & Add-Ons

Product customization has been revolutionizing ecommerce in the last 5 years. And WooCommerce store owners, if possible, should look into offering additional product options, add-ons, personalizations, custom text and whatever can make a mass product unique to each single customer.

You can now pick your shoe colors, engrave a message on jewelry, upload your own graphics on t-shirts, pick your own ingredients, select custom materials and so on. Correct, some very smart marketer found out a way to sell the same exact product to a bunch of very different, demanding people and make them all 100% happy – while also increasing average order value (AOV), margins, profits, return business and decreasing returns, bad feedback and churn rate.

Most of us rely on WooCommerce product variations to sell the same product in different “sizes” or “colors”… but this has got nothing to do with product “add-ons”. With a product add-ons plugin, you can sell additional options and personalizations on top of the existing product attributes.

Good news is there are free and premium plugins that can help you implement product options, customization and add-ons… and eventually increase your profit.

Continue reading WooCommerce: How to Sell Product Customizations & Add-Ons

WooCommerce: Rename “Add to Cart” Button if Product Already @ Cart

When talking about UX, or for very specific WooCommerce shops, you might need to tell the user a product is already in the Cart before re-adding it or increasing its quantity from the Shop/Category/Loop and Single Product pages.

The “Add to Cart” button label comes with a filter (actually 2 filters, one for the Single Product page and another for the other pages such as Shop), so all we need to do is targeting those two hooks. We will “filter” the label text in case the product is already in the Cart, and return that back to WooCommerce. If this sounds like Japanese to you (hey, unless you’re from Japan!) don’t worry – simply copy/paste the snippet below as per below instructions.

Enjoy!

Continue reading WooCommerce: Rename “Add to Cart” Button if Product Already @ Cart

WooCommerce: Hide Related Products @ Single Product Page

Adding content to the WooCommerce Single Product Page is super easy – but what if you wish to remove / hide a default element?

Well, in this case it gets even easier. All you need to know is the default hook used by WooCommerce – so that you can remove it with one line of PHP in your functions.php. You can find a list of default hooks here: (https://businessbloomer.com/woocommerce-visual-hook-guide-single-product-page/)

For example, how do we hide the Related Products? Well, here’s one line of code that will help you! Continue reading WooCommerce: Hide Related Products @ Single Product Page