20% coupon on Store Manager license!
Limited discount, can can be applied to products only
Rating 0 stars - 0 votes

Use MySQL Expressions for WooCommerce to Edit Product Details via Import

Managing your store, you may have tasks that can’t be solved via the native admin panel. In this article, we’ll show you how you can solve some of the typical tasks by applying a MySQL expression for WooCommerce during import.

Add a Brand Name to a Product Title in WooCommerce

Below you can see a sample file where product title and brands are located in separate columns. It is a typical file that you may receive from your supplier. What if you want a brand name to be added to a title so it looks like Lima Flooring Ramp Section, for example?


WooCommerce Store Manager Brands Import File Structure

This task can be solved by applying an SQL expression during import via Store Manager for WooCommerce.

Store Manager is an application that allows you to manage your WooCommerce store offline and enhances the default WooCommerce functionality with tools for bulk edits, advanced import/export, database backup, data generation, and others. If you don’t have Store Manager installed yet, download a free trial, install the application on your computer and connect it to your store database.

Here are the steps to add a brand to a product title.

  1. Launch Store Manager for WooCommerce import wizard.
  2. See the detailed guide on importing products via Store Manager for WooCommerce.

  3. Select your import file and proceed to the step Field Links.
  4. Find a Title field and open SQL Editor.

  5. WooCommerce Store Manager Brands Import Mapping Expression Edit

  6. In the Expression Editor, add the following expression:
  7. CONCAT([SOURCE_FIELD(Brands)],' ',[SOURCE_FIELD(Title)])
  8. Press Execute Expression to see the selected fields and current values. Then press Next to preview the result.
  9. Press OK to close the Expression Editor and return to the import wizard.

  10. WooCommerce Store Manager Brands Import Mapping Expression Execute

  11. Complete the import and check the result at your store.

Add Price Mark-Up or Apply Exchange Rate

You may need to increase prices by a certain percentage to add price markup or apply an exchange rate. Below is a sample file with products and prices.


WooCommerce Store Manager Price Murkup File

Let’s increase the price by 20% in the course of import. Here are the steps to follow.

  1. Launch Store Manager for WooCommerce Import Wizard.
  2. Select your import file and proceed to the step Field Links.
  3. Find a Regular Price field and open SQL Editor by clicking Edit next to the field name.

  4. WooCommerce Store Manager Price Murkup Add Expression

  5. Enter the expression: [_regular_price]*1.2 (the coefficient increases the price by 20%)
  6. Click Execute Expression to see the selected field and current value. Then click Next to execute the expression and check the result.
  7. If the result is as expected, click OK to return to the import wizard.

  8. WooCommerce Store Manager Price Murkup Add Expression Execute

  9. Complete the import and check the result in Store Manager. As you can see, the initial price has been increased.

  10. WooCommerce Store Manager Price Murkup Add Expression Result

Change Short Description from Uppercase to Lowercase

Suppose you have a file where all product short descriptions are uppercase and you want them to be lowercase:


WooCommerce Store Manager Short Description Uppercase

To change short descriptions to lowercase, follow these steps:

  1. Launch Store Manager for WooCommerce Import Wizard.
  2. Select your import file and proceed to the step Field Links.
  3. Find a Short Description field and click Edit to open SQL Editor.

  4. WooCommerce Store Manager Short Description Edit Expression

  5. In the Expression Editor window, enter the function LOWER. Enter the parentheses, then put the cursor inside the parentheses.
  6. Click Insert value from import source. In the dropdown list, select the Short Description field:

  7. WooCommerce Store Manager Short Description Edit Expression Source Field

  8. Press Execute Expression to see the selected fields. Then press Next to preview the result.

  9. WooCommerce Store Manager Short Description Expression Execute

  10. Press OK to close the editor and return to the import wizard.

  11. WooCommerce Store Manager Short Description Expression Result

  12. Check the result in Store Manager.

  13. WooCommerce Store Manager Short Description Lowercase

Update Data for the Out-of-Stock Products

A typical kind of task is to update products on a certain condition. Thus you may want to update prices only for the products with the Out of Stock status.


WooCommerce Store Manager Outofstock Products Store

Here we have a file that contains new prices for the existing products. We’ll show you how to import this file and update prices only for the “outofstock” products.


WooCommerce Store Manager Outofstock Products File

To update prices via import, follow these steps:

  1. Launch Store Manager for WooCommerce Import Wizard.
  2. Select your import file and proceed to the step Field Links.
  3. Find a Regular Price field and open SQL Editor by clicking Edit next to the field name.
  4. Enter the expression to update prices only for the out-of-stock products: IF([SOURCE_FIELD(Stock Status)] LIKE '%outofstock%',[SOURCE_FIELD(Regular Price)],'')

  5. WooCommerce Store Manager Outofstock Products Expression Add

  6. Press Execute Expression to see the selected fields and sample values.

  7. WooCommerce Store Manager Outofstock Products Expression Execute

  8. Press Next to preview the result.

  9. WooCommere Store Manager Outofstock Products Expression Output

    Press OK to close the Expression Editor and return to the import wizard. Complete the import and check the result in Store Manager. As you can see, the prices for the Out-of-Stock products were updated, and prices for other products from the file are unchanged.


    WooCommerce Store Manager Outofstock Products Price Updated

How to Apply Your Own WooCommerce SQL Query

You can use the Expression Editor with the Import Wizard to update data on the go on your own. The steps should be as follows:

  1. In the import wizard, proceed to the step Field Links.
  2. Find a field that you want to update.
  3. Open Expression Editor by clicking Edit in the Expression column.
  4. Enter the expression.
  5. Press Execute Expression to see selected fields and sample values.
  6. Press Next to execute the expression and check the output.
  7. Press OK to add the expression.
  8. Complete the import following the wizard prompts.

Using the expression editor with Store Manager for WooCommerce, you can perform a lot of different updates on the go. If you’re hesitant about which formula to use, write in the comments below and we’ll try to help you.

Bulk Add WooCommerce Attributes with Store Manager

Try now FREE
Related Articles:
Card image
Step by Step Tutorial to Import Products

Learn how to import WooCommerce products via Store Manager.Read More...

Card image
Mass Changer: Detailed Tutorial

Perform bulk WooCommerce product updates via Mass Changer tool. Read More...

Card image
Merge Product Brand Name and Title Upon Import

How to add a brand name to a product title in WooCommerce via import. Read More...

Card image
Update WooCommerce Product Tags In Bulk

How to update WooCommerce product tags in mass using WooCommerce Product Tags Mass Changer.Read More...

COMMENTS
Be the first to comment.