Building E-commerce Sites with VirtueMart Cookbook
上QQ阅读APP看书,第一时间看更新

Adding similar products

This is so easy I almost left it out! However, the potential time saved using cloning is huge. So I thought of showing this to you, in case you haven't figured it out for yourself yet.

As we have discovered, creating a product with all the various tabs can be a long process. In VirtueMart we can clone a product into an identical, yet new product. We then have the opportunity to go into that product's settings and alter them. So we need to decide which (if any) of our product range would be quicker to amend an existing product than it would be to start from scratch.

Also note that you can clone a product, alter it, then clone the altered product. Careful planning here can save a lot of time, if you have lots of similar products in your catalog.

Getting ready

Make a cloning plan.

How to do it...

Cloning is a lot less painful than it sounds. Just three steps:

  1. Go to the main products page by clicking on the Products link in the Products menu. Select the checkbox on the left of the product to be cloned as shown in the following screenshot:.
  2. Click on the Clone button in the row of buttons at the top of the page as shown in the following screenshot:
  3. Click on the cloned product and edit it according to the requirements. Fields that will probably need changing are Product_alias on the Product Information tab (VirtueMart just appends a number to this but they might not be what you want), the product name, and other essentials like weight, price, and so on. Repeat the preceding steps.

How it works...

VirtueMart very simply makes a duplicate product for you to edit. Helpfully it omits to copy attributes like stock level and price, which are likely to be different, but copies likely to be required information like other product status details.

There's more...

Also note that as you would logically expect, child products are not cloned automatically. So if you cloned a product with multiple versions implemented through a custom field for child products you will get an error on the product page as shown in the following screenshot:

To remove it, simply delete the custom field from the Custom Field tab of the cloned product. Don't forget to Save afterwards.

See also

  • The Custom fields – customizing products with versions and charging different prices for them recipe