Posted on

WooCommerce: Force Cart to Specific Amount (Deposit)

Here’s a very simple snippet that achieves a very complex task – what if you wanted to force your Cart to charge a deposit or a fixed fee, no matter the product price?

Well, thankfully WooCommerce is pretty flexible and a lot of workarounds can be found. In this case, forcing the checkout to a fixed amount (e.g. $100) is as simple as applying a negative “cart fee” to make the total become $100.

Sounds like Japanese? Great – here’s why you’re on Business Bloomer. Copy the snippet, apply it to your test WooCommerce site and see the magic happen – without knowing anything about coding! Continue reading WooCommerce: Force Cart to Specific Amount (Deposit)

Posted on

WooCommerce: Split Cart Items When Product Quantity > 1

Quite an interesting snippet this is! A client needed to show EACH quantity of the SAME product as separate lines (cart items) in the WooCommerce Cart & Checkout page.

At some stage, you might need that too – for different reasons maybe. So, let’s see how this is coded πŸ™‚ Continue reading WooCommerce: Split Cart Items When Product Quantity > 1

Posted on

WooCommerce: Define Add to Cart Min, Max & Step Quantity

Yes, there are many plugins that already achieve this. But my goal at Business Bloomer is to save you from plugin conflicts, delicate updates and to make you learn some PHP πŸ™‚

So, here’s how you can add, with a few lines of PHP, a minimum, maximum, increment and starting value to your Add to Cart quantities. Who knew it was this easy? Continue reading WooCommerce: Define Add to Cart Min, Max & Step Quantity

Posted on

WooCommerce: Add “Quantity” Label in front of Add to Cart Button

Here’s another little WooCommerce tweak for your website user experience: let’s add a string just in front of the Add to Cart button that says “Quantity: “. As usual, the biggest thing is looking for the right “hook”… but thankfully WooCommerce plugin is full of them and adding a string where we want is so easy πŸ™‚ Continue reading WooCommerce: Add “Quantity” Label in front of Add to Cart Button

Posted on

WooCommerce: See What’s Inside the Cart Array (print_r)

So many times I needed to “play” with Cart contents in order to modify the default behaviour (such as removing a columns, hide the sale price to prices, hide an item, etc.).

There is a great PHP function that always helps – it’s called print_r and you can use this to “see” what’s inside the cart array, so that you can return certain information in a message for example.

A bit advanced, but as you grow your WooCommerce coding skills, you will use this a lot πŸ™‚ Continue reading WooCommerce: See What’s Inside the Cart Array (print_r)

Posted on

WooCommerce: Hide Hidden Products From Cart, Order, Emails

While working on a workaround for a client, I had to hide a hidden product from the cart, checkout, order received and emails. Hidden products already don’t show on the shop and category pages, but they do show on the cart if they’re added to cart “programmatically”.

A tough task, but as usual here I come with the solution πŸ™‚ Continue reading WooCommerce: Hide Hidden Products From Cart, Order, Emails

Posted on

WooCommerce: Deny Checkout Based on Cart Weight

A WooCommerca fan asked this question on a Facebook group, so I had to write a snippet about it: “How do you deny checkout if the cart weight is above a certain threshold?“. Well, this is straight forward, so there you go! Continue reading WooCommerce: Deny Checkout Based on Cart Weight

Posted on

WooCommerce: Redirect to Checkout on Add to Cart

A Business Bloomer fan asked me a specific question via the blog comments, so I had to make a new snippet of course πŸ™‚

Here’s how you force redirection to the checkout every time a product is added to cart, no matter if you do so from the loop/shop pages or the single product page. Continue reading WooCommerce: Redirect to Checkout on Add to Cart

Posted on

WooCommerce: Add Content to Empty Cart Page

A Business Bloomer fan asked me a great question: “I’m using your visual hook guide to add content above the cart, however I notice that it doesn’t work if the cart is empty. Are there hooks specifically for empty carts?“.

Well, let’s take a look if we have anything available… (hint: of course we do!). Continue reading WooCommerce: Add Content to Empty Cart Page

Posted on

WooCommerce: Edit “Have a Coupon?” Message @ Cart & Checkout

I wanted to do something different on my own checkout page, and change the default “Have a Coupon?” message. Thankfully, WooCommerce gives us a filter we can use to accomplish anything we like – such as adding a FontAwesome icon or changing the text string completely! Continue reading WooCommerce: Edit “Have a Coupon?” Message @ Cart & Checkout

Posted on

WooCommerce: Change the “Remove this Item” Icon @ Cart

I have a very long to-write list. Possibly I have enough content for another 2 years πŸ™‚

However, the other day a premium WooCommerce student asked me for some feedback on his custom CSS – so I had to give it priority! The request was: what’s the easiest way to change the little icon/button on the Cart page that has the function of removing items from the cart (yes, that ugly white cross on a red circle)? Continue reading WooCommerce: Change the “Remove this Item” Icon @ Cart

Posted on

WooCommerce: Remove Add Cart, Add View Product @ Loop

A fan requested an interesting edit on the Shop/Category page (or “loop”). Instead of having the default “Add to Cart” button, they wanted to remove that and substitute with a “View Product” button link to the single product page. Here’s the simple snippet. Continue reading WooCommerce: Remove Add Cart, Add View Product @ Loop

Posted on

WooCommerce: Display Regular & Sale Price @ Cart Table

In my opinion, the WooCommerce Cart table is somewhat confusing. Why isn’t the “sale price” displayed there? Well, this is a mystery!

I’m pretty confident that showing the “slashed” price would actually help your customers convert better.

So, what about 10 PHP lines in exchange for an increase in sales? Great! Here’s the snippet πŸ™‚ Continue reading WooCommerce: Display Regular & Sale Price @ Cart Table

Posted on

WooCommerce: Move & Change Number of Cross-Sells @ Cart Page

This week’s snippet is about the Cart Page (perfect timing, as in a few days I will run a free class on “How to Customize the WooCommerce Cart Page“).

Today we’ll focus on the “You may be interested In…” section, also called the “Cross-Sells” area. If a product that is in the cart has cross-sells (Edit Product > Product Data > Linked Products), this section will appear by default. Problem is – it is pretty ugly where it is now and distracts the user from identifying the “Proceed to Checkout” button, the most important CTA (Call To Action) of the Cart page.

So, how can me move it UNDER the Cart Totals, and make the design a little cleaner? Continue reading WooCommerce: Move & Change Number of Cross-Sells @ Cart Page

Posted on

WooCommerce: Display Total Discount / Savings @ Cart

If you love Ecommerce as much as I do, and are passionate about Sales Conversion Rate and reducing Shopping Cart Abandonment, today’s snippet will come in handy.

Besides, this is officially the first guest blog on Business Bloomer (have ideas? Send me your proposal here)… so let me officially introduce you to today’s author: Jamie Gill, a WordPress & WooCommerce enthusiast from Bradford, UK. Continue reading WooCommerce: Display Total Discount / Savings @ Cart

Posted on

WooCommerce Custom “Add to Cart” URLs – The Ultimate Guide

Here’s how to create custom WooCommerce Add to Cart buttons – and make their link add products to cart, redirect to specific pages, include variable and grouped products and so on. You will see that with this guide it’s much easier to place Add to Cart buttons on any page you like such as custom landing pages, or even create custom buttons in your pricing tables – enjoy! Continue reading WooCommerce Custom “Add to Cart” URLs – The Ultimate Guide

Posted on

WooCommerce: Disable Shipping Rate if Cart has Shipping Class

Our goal is to check if a Product with a specific Shipping Class is in the Cart, and consequently disabling Free Shipping if this is true. This is super useful when there are multiple items in the cart and you don’t want to give free shipping for certain orders. Continue reading WooCommerce: Disable Shipping Rate if Cart has Shipping Class

Posted on

WooCommerce: Edit “Add to Cart” Text by Product Category

Hello WooCommerce Customizers!

Today is episode #12Β of my “18 snippets in 18 days” challenge. With 6 days to go, I hope you’ve enjoyed the snippets so far and that your WooCommerce code snippet library has been growing steadily πŸ™‚

I ask you to kindly share on social media and leave blog comments to support my marathon, a lot of work is going into this and feel free to share some love πŸ™‚

Today we take a look at the WooCommerce “Add to Cart” buttons. What if you wanted to change the “Add to Cart” text depending on the Product Category? For example, you may want to show “Buy Now” for books and “Add to Basket” for cds. Continue reading WooCommerce: Edit “Add to Cart” Text by Product Category