VirtueMart
Google Sitemap
Requirements:
CSVI 7.0 version
VirtueMart 3.0 or higher
A Google sitemap can be created using VirtueMart product export operation with the following steps.
Step 1
Create a template by selecting Component as VirtueMart, Action as Export and Operation as Product in template Details tab.
Step 2
Under File tab set the following optins
- Set Export type to XML
- Set Website to Custom
- Set Export State to Published. This is needed because only published products should appear in the sitemap as unpublished products are not accessible.
Step 3
To design the layout of the sitemap, under XML layout tab set the following
- Fill the header with the text:
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">
- Fill the body with the text:
<url> <loc>[product_url]</loc> <image:image> <image:loc>[picture_url]</image:loc> </image:image> </url>
- Fill the footer with the text:
</urlset>
- Click on apply to save your changes
Step 4
Add the template fields needed for export on CSVI template fields page.
- Add the fields:
- product_url
- picture_url
- product_sku
- Fill in the column header for the product_url and picture_url fields
- Publish the fields product_url and picture_url and to unpublish product_sku field.
Step 5
Finally we are done with setting up the template. Go to CSVI Export page and select the Google sitemap template to download the sitemap file.
References:
Speed up product import
When you have a large number of products in your VirtueMart shop the import will take it's sweet time to finish. There are ways to speed up the import, one of the ways is to make use of indexes on your tables. An index can be seen as a list that the database keeps to remember where to find which item.
Product table index
CSVI uses the product SKU as a unique identifier to identify a product. Adding an index on this field will be beneficial because it allows the database to find the product faster as it then keeps a list of all your products. To add an index on the product_sku field we need to take the following steps using PhpMyAdmin.
- Go to PhpMyAdmin
- Go to the database that contains your site
- Go to the virtuemart_products table Structure page
- Click on the Indexes link (this is a bit obscure but it is above the Information table)
- There will be a line below the indexes that says "Create an index on 1 columns" with a Go button. Click the Go button.
- A popup will appear with a form to enter some information. Enter the following information:
- Index name: product_sku
- Index choice: Unique
We set this to unique to be sure there won't be any duplicate SKUs in the database - Column: Select the product_sku column
- Size: 25
- Click on Go
- The index is now created.
VirtueMart Calculation Rules export
This VirtueMart Calculation Rules export tutorial explains how to setup the fields and export the VirtueMart calculation rules.
VirtueMart Product Image Fields
This page shows which VirtueMart Product Image fields you can use for import and export.
Why are my products not showing up?
There are several reasons why products are not showing up after an import. Here is a list of possible causes:
- No slug set
When a product has no slug, VirtueMart will show a Product not found message - Not published
On import, you need to set the published field to Y or 1. Not including this field leaves the product unpublished even if VirtueMart shows it as published - No matching shopper group
Products can be linked to a specific shopper group, if there is no shopper group match, VirtueMart will not show the product - Incorrect language
After you have imported products and go to VirtueMart to check and see if they are there you might find that no products show up. The reason for this is that VirtueMart uses a different language than what you imported them in. For example, your site has 2 languages, English and Dutch where English is your site default language.(Extensions -> Language manager)
After you import your first products in the Dutch language, VirtueMart won't show them because it is looking for English products. To see the list of Dutch products you need to go to Extensions -> Language manager and set your Site language to Dutch as default. Now go back to VirtueMart and your products will show up.