Posted on Leave a comment

How To Add Multiple Images For WooCommerce Product Variations

One of the most hard to understand limitation of WooCommerce is the number of a images you can have for product variations. One variation can have only one image:

How To Add Multiple Images For WooCommerce Product Variations 1

What if you want to add more images to the variation? Well, bad news is you cannot do that with WooCoomerce’s default functionalities. However, the good news is there is a plugin that let you add up to 2 images for products’ variations (if you are using the free version). If you have the pro version of this plugin, you can add as many images as you want.

Add Unlimited product images to WooCommerce variations using plugin

The plugin we are going to use to day is Additional Variation Images Gallery for WooCommerce. You can download it for free here on WordPress.org

After installing and activating the plugin. You’ll see the effects right away. Let’s go to one of my variable product and open the variations tab. Click on one variation and you’ll see that there is a new button under the default image place holder:

new button to add more images to woocommerce product variation

Now, let me add some images to this product. You need to add the images one by one though. I think it would be more convenient to have the ability to add more than one image at a time.

added images for product variations

As you can see, my product has a “Black” variation and I was able to add 3 images to this one (one supported by WooCommerce and two others I added through the Add Gallery Images button).

Now, let’s view our product:

product variation now has multiple images

As you can see, as soon as changed the color option to Black, I can see the list of images available to that variation. You can add more images to all of your variations.

Some additional settings

I’m not sure about you but I’m pretty happy with the result up to now. However, the plugin offers more options for you to customize in case you have some specific needs. Let’s go to WooCommerce->Settings and you’ll see there is a new tab called WooCommerce Variation Gallery:

new tab to customize variation gallery

All the options are quite self explanatory. If the image slider on the product page is working good for you, then you should not change anything here.

 

Conclusion

This is a very nice plugin to have when you have variable product. The limit one image per variation of WooCommerce is quite limited and in most cases, isn’t enough for store owners. This plugin (free version) allows us to add two more images to the product’s variation. This should be enough for most store. If you need more images, consider upgrading to support the developer. 

Posted on Leave a comment

WooCommerce Product Attributes Q&A – The Ultimate Guide

WooCommerce Product Attributes Q&A - The Ultimate Guide 2

What are WooCommerce Product Attributes?

WooCommerce Products Attributes, as the name suggested, are the attributes that products in WooCommerce can have. One product can have multiple attributes as well as many products can share one attribute. Take color as an example. Color could be an attribute of any product. If you sell head phones, your products’ colors could be red, white, black…

Product Attributes vs Product Categories

Sometimes you may wonder, what are differences between product attributes and product categories. The rule of thumb is when if an attribute is distinctive enough, you should make it a category. Attributes are things that products HAVE, categories are groups that products BELONG to. If you sell headphones only and your store only have red, blue, pink headphones then you can categories your headphones according to their colors. If you sell other products too, making color as category doesn’t make much sense. However, the decision is yours.

What are global attributes and product specific attributes

In WooCommerce, there are two ways you can add attributes to your products. Either you go to Product->attributes or in the product edit page, you go to Product Data->Attributes to add new attributes. However, if you choose the first method, you will create global attributes, which means the attributes you created in Product->Attributes are available to all other products. If you choose to go to the product edit page->Product data->attributes, you can create attributes that are available to that specific product only.

So, when you create a global attribute and when to create a product-specific attribute. This is your call. If one attribute is shared among two or more products, it makes senses to make it as global attribute. However, if one attribute that is possessed by only one product, it’s best to make it product-specific.

How to add global attributes in WooCommerce

Creating global attributes is quite simple with WooCommerce. Let’s create an attribute called Color in my store.

  1. In your site’s dashboard, let’s go to Products->Attributes:

go to products then attributes

Now, we are in add attributes screen. You can see that it’s very similar to add post’s categories screen:

WooCommerce Product Attributes Q&A - The Ultimate Guide 3

There are a few fields here you need to pay attention to:

  1. Name field: This field is required. This is the attribute’s name, in our case is color. This name is visible to your end users so you should make this one user friendly.
  2. Slug: This one could appear in your URL. You can specify this field or let WooCommerce does that for you based on your attribute’s name
  3. Enable archives: Do you want to have a page dedicated to list products that have this attribute? If so, check this box.
  4. Default sort order: What order you want the attributes to displayed in the product page? You can set the order by name (name numeric if the attributes are numbers) or by ID of the attribute. For example, I have 4 colors for the attribute color:

WooCommerce Product Attributes Q&A - The Ultimate Guide 4

If I set the custom ordering to Name, here is what I see on the product page:

color attribute order on product page

As you can see, the colors are sorted alphabetically.

If you want to customize this order, you can select “Custom ordering”. I’ll show you more about custom ordering in the next section.

Now, let’s click on Add attribute to add the color attribute.

Adding terms for global attributes

Now we have the attribute Color added. It’s time to add the values that it can hold. You can always add more value to your attributes later so you don’t have to add all values at once. In WooCommerce, attributes’ values are called terms. For example, our color attribute can  have Red, White, Blue, Black, Green terms.

Once you have the attribute added, you’ll see there is a link called “Configure terms” appears:

WooCommerce Product Attributes Q&A - The Ultimate Guide 5

Let’s click on that add add four “terms” for our attributes. They are Blue, Black, White, Red:

WooCommerce Product Attributes Q&A - The Ultimate Guide 6

Now, let’s go back to talk about the custom ordering of attributes a bit more. As you can see, our terms are ordered by Name or by ID, if you want a different ordering, you need to set the Default sort order to Custom ordering. So, if you want to display the colors in the product page to White->Red->Black->Blue, you need to set the order on this page. Simply click and hold the hamburger icon and drag the items to your desired position:

attribute terms custom ordering

After a bit of dragging, here I have my terms in my desired order:

WooCommerce Product Attributes Q&A - The Ultimate Guide 7

Now, if I view the product page, I’ll see the colors are ordered from White to Red to Black to Blue:

custom ordering of colors take effects

Adding a product-specific attribute

If your product has a special attribute that only it owns, it’s suitable to use the product-specific attribute. To add a product-specific attribute, simply click on Product data->Attributes:

go to product data then attributes

Now, in the select box, make sure you have “Custom product attribute” selected then click on “Add”. You’ll have a form to enter the attribute details. For example, I’m going to add an attribute called Size with the three possible values: Small, Medium, Large:

adding product-specific attributes

As you can see, I separated the terms (values) by the pipe (|) character. I can either select the attribute to be visible on the product page or not. Check the checkbox if you want to show this attribute on the product page.

If your product is a variable product, you will also see another checkbox “Used for variations”. Check this if you want to create variations based on this attribute.

Finally, click on Save attributes button to save the attribute.

WoCommerce Attributes FAQs

Below, you’ll find answers to some of most common questions regarding WooCommerce product attributes. If you don’t find your questions, feel free to ask.

What to do when WooCommerce stuck spinning ball when saving attributes?

This is usually caused by Javascript error. The best bet is to open the Developer Console (Right click, select inspect/inspect element) and click on Console tab to see the red messages (errors). This error could be the result of:

  1. Poorly coded theme, plugins
  2. Caching plugins that combine and minify Javascript files incorrectly.

You can also try changing your site theme (temporarily) to the Store Front theme from WooCommerce. If the error is gone, you could safely conclude that your theme is the culprit. Otherwise, try deactivating your plugins, one by one (but leave WooCommerce activated) to see which one is the cause of that error.

How To Add Special Symbols (Registered, Trademark…) To Product Attribute

Since WordPress supports Unicode, you can add many special characters to product attributes. In some cases, you may want to add the trademark symbol (™) to the attribute name. Simply copy this character and paste into the attribute’s name input box:

WooCommerce Product Attributes Q&A - The Ultimate Guide 8

Then, click on Update to save your changes.

Conclusion

WooCommerce product attributes offering more flexibility to your store. They also let your customer search, filter product by specific attributes such as color, size … There is no limit on how many or what kind of attribute you can use on your store.

Posted on Leave a comment

How To Quickly Add Child Categories In WordPress

How To Quickly Add Child Categories In WordPress 9

Adding child category and blog’s hierachy is as tedious task if you have many categories to manage. My website has a lot of categories too so I think there must be a better way to add child categories to current category.

So, I decided to make a plugin to solve this problem. It is a very simple plugin that help you quickly create child categories. Initially, it supports WordPress’ categories only. Now, WooCommerce categories are also supported.

Since the code is very simple, you can implement the functions without installing a plugin. I’ll provide the code in the section 2 of this post.

Quickly adding child categories using plugin

You can download the plugin below:

 

How To Quickly Add Child Categories In WordPress 10

As you can see, when you click on the + child button, the Parent category select box is automatically changed to the category you select. Then, you can simply go ahead and details for the child category and click on add new category button as usual.

I’m submitting the plugin to WordPress.org so you can download the plugin directly from that site. I also added support for WooCommerce categories so you can now quickly add child categories to current WooCommerce categories too.

Quickly adding child categories WITHOUT using plugin

If you don’t want to use the plugin, you can paste the code below in the functions.php file of your child theme. Click here if you don’t have one and wonder how to create a child theme in WordPress.

 

add_filter('category_row_actions', 'binary_carpenter_quick_add_child_add_option', 10, 2);
add_filter('product_cat_row_actions', 'binary_carpenter_quick_add_child_add_option', 10, 2);
add_action('admin_print_scripts', 'binary_carpenter_quick_add_child_print_js', 10, 2);

function binary_carpenter_quick_add_child_print_js()
{

    global $current_screen;

        if ($current_screen->id === 'edit-category' || $current_screen->id === 'edit-product_cat')
        { ?>
            <script>

                document.addEventListener("DOMContentLoaded", function(event) {

                    var add_child_buttons = document.getElementsByClassName('bcqac-item');

                    for (var i = 0; i < add_child_buttons.length; i++)
                    {
                        add_child_buttons[i].addEventListener('click', function(e){
                            e.preventDefault();
                            //set the parent category to the current parent category
                            var parent_id = this.getAttribute('data-parent-id');
                            var parent_select = document.getElementById("parent");
                            parent_select.value = parent_id;

                        });
                    }

                });



            </script>
        <?php }
}

function binary_carpenter_quick_add_child_add_option($actions, $tag)
{
  $actions['add_child'] = sprintf(
    '<a href="#" data-parent-id="%s" class="bcqac-item" >%s</a>',
    $tag->term_id,
    /* translators: %s: taxonomy term name */
    __( '+ child' )
  );

  return $actions;
}

Save the functions.php file and you are done. Now, you can quickly add child categories in WordPress and WooCommerce.

Conclusion

I can now quickly create child category in WordPress and WooCommerce. As I’m creating the hierarchy for this blog, this tool becomes very handy. If you have any suggestions, please let me know in the comment section below.

Posted on 1 Comment

Creating WooCommerce Gift Cards/Store Credit With WooCommerce Smart Coupons

store-gift-card-woocommerce

When it comes to creating WooCommerce gift cards, there are quite many options. Previously, I’ve covered how to create gift cards for WooCommerce with YITH plugin. Today, we are going to create gift cards/store credit with another plugin called smart coupons from the developer of WooCommerce.

I’m going to focus on creating gift cards/store credit for your WooCommerce store with smart coupons in this post. If you want a full tutorial on how to use the plugin, I’m going to create a new post dedicated to that purpose.

Here are the steps we are going to go through to create the gift cards with this plugin:

  1. Activate smart coupons
  2. Create a coupon without an amount
  3. Create a product so customers can purchase it
  4. Apply the coupon on a test purchase to see how the gift card works

Without further ado, let’s get started.

Download and install, activate smart coupons

First of all, you need to download and install the smart coupons plugin from here. It is not a free plugin and its price is quite high so I’ll cover as much details as I can to help you make the purchase decision easier.

You install it as you do with normal plugin. Here are the steps if you need a reminder:

  1. Download the zip file
  2. Go to your site’s dashboard, click on Plugins->add new
  3. Select upload
  4. select the zip file that you downloaded from WooCommerce
  5. Wait for the upload to complete and click on Activate

Now, you are ready to start creating WooCommerce gift cards with Smart coupons.

Create a coupon without an amount

Now, you have smart coupons installed and activated. Let’s go to WooCommerce->Coupons:

start adding coupons

If you have created WooCommerce coupons before, you’ll see this interface is very familiar. Let’s click on Add Coupon button at the top left of the screen to start adding a coupon.

create new smart coupon

There are a few things you need to remember when creating this coupon:

  1. Gift card name is required. You can name it anything you like. Your customers don’t see it so it doesn’t matter much
  2. Coupon description is optional, you can leave it as blank if you like
  3. The discount type must be Store Credit/Gift Certificate
  4. The coupon amount must be 0 since the customers will enter the amount they want to purchase on the product page
  5. The checkbox at the right of “Coupon Value Same as Product’s Price” must be checked.

Now, hit the publish button to publish the coupon. The next step is to create a product that customers can actually buy our store credits.

Create a product so customers can purchase it

Let’s go creating a WooCommerce product. This is the product that the customers can purchase to get store’s credit. It’s not much different from a normal product. Under Products, click on Add new.

create a product to sell store credit

Creating a product to sell store credit is very similar to regular product. However, there are somethings you need to pay attention to:

  1. Product type must be Simple product
  2. If you want to offer free shipping for this product, check Virtual
  3. Regular price and sale price must be blank
  4. You need to enter the coupon name and select it from the suggestion appears when you typed pass three characters in the coupon box

After that, you can hit publish to make the product live. You can also add a featured image for the product to make it more attractive.

Now, let’s have a look at our store credit product:

gift card product created on woocommerce store

Let’s make a test purchase and try to apply the gift card to another purchase to see how it works.

Make a test purchase on WooCommerce gift cards and Apply the coupon to see how it works

I’m going to buy £500 credit in this test purchase so let’s enter 500 in the Purchase credit worth and click on add to cart:

enter credit amount

On the checkout page, you have two options: Send the coupon to you or to other:

send coupon to email option

I’ll use the second option, send to a friend of mine as a gift:

send gift card to a friend

As you can see, I can send to one email address at a time. In case of YITH coupon, you can send to multiple recipients.

Now, let’s complete the purchase and see how the gift card is delivered.

Sure enough, when I check the email I entered in the recipient box, I got the notification:

gift card sent to recipient email

If the recipient click on the gift card, it will be applied automatically on her purchase. Let’s make some purchases and go to the checkout page:

coupon applied on purchase

As you can see, the order total is £274.00 and it was covered by our £500.00 store credit.

Thoughts on WooCommerce Smart coupons plugin

As you can see, WooCommerce Smart coupons plugin let us create gift cards, store credit quite easily. You can create the product once then it can be purchases many times by many customers. In comparison to YITH plugin, it lacks some flexibility such as having a drop down of pre-defined amount or the ability to send coupons to multiple recipient on the checkout page. However, as far as creating gift cards/store credit, this plugin does the job really well.

Hopefully now you have a good idea on how the plugin works. If you have questions, please drop a message in the comment section below and I’ll reply as soon as I can.

 

Posted on Leave a comment

WooCommerce Cross Sell – 5 Must Know Secrets For Every Store Owner

woocommerce cross sells

Implementing WooCommerce cross sells can increase your store’s revenue dramatically. However, not many store owners are using this because the lack of tutorial on WooCommerce cross sell. In this post, I’m going to show you how to setup products for cross sell and answer some questions you may have when  using this setup.

What are WooCommerce Cross Sells?

Cross sell products are the one you display when the customers are viewing their cart. The cross sell products are not in the cart yet. It is the choice of the customer to add the item to card or not. By default, the cross sell products are shown under the heading: “You may be interested in”

How are cross sells different from up sells?

Up sells are another kind of related products in WooCommerce. The main different between up sells and cross sells is while cross sells are shown in the cart page, up sells are shown in the products pages, under the main product. Having said that, there isn’t any different between cross sells and up sells in terms of product types or features. You can set any product to be cross sell or up sell of any other product.

How does cross sell work, exactly?

Up until now, you may already know who cross sell work. When the customers go to the cart page, they may be interested in closely related products, which are the cross sells. One example is if your customer already has the printer in cart, you may want to add additional colored ink set as cross sells.

How to setup cross sell products

Setting up cross sell products is quite straightforward with WooCommerce. In the product data tab of all product types, you’ll see a tab called Linked products:

woocommerce linked products

Click on that, you’ll see two input box, one for entering upsells and one for entering cross sells. Since we are adding cross sells, let’s type the product name in the cross sells box. I’m editing the Xbox controller on my store. I would like to add the charger as a cross sell. As long as I typed past three character, list of matching products appears:

WooCommerce Cross Sell - 5 Must Know Secrets For Every Store Owner 11

I’ll hit enter to select that product. Finally, I’ll update the editing product and let’s make a test purchase.

I add the XBox Controller to cart and go to the cart page. Sure enough, I see the charger appears under “You may be interested in…”

cross sells shown in cart

 

If you have more than one cross sells, all of them will be shown here. For example, I’ve just added another cross sell to the controller, which is a battery pack. I can see it in the cart too:

multiple cross sells

If you have multiple products in cart, each of those products has cross sells, all of them will be shown too.

For example, I’m going to add an Xbox one S to the cart. This product has the HDMI cable as cross sell. Here is what we see in the cart:

woocommerce cross sells from multiple products in cart

Here are some questions you may have in mind right now:

  1. How can you customize the number of columns in the cross sells section
  2. How to setup default cross sells for all products when there isn’t one selected.
  3. How do you limit the number of cross sells products showing in the cart (for example, you only want to show at most 4 cross sells)

WooCommerce doesn’t support those features natively. We’ll need a plugin for that. I’ll be making one and will put it here.

Conclusion

As you can see, WooCommerce cross sells is a kind of related products and it really helps boost sales. The trick is to choose the cross sells wisely so they are very related to the products in cart. Unrelated cross sells may not work very well.