Shopping Basket

 x 
Cart empty


Popular Items

Find Us Elsewhere

VM2 Product Snapshot Pro Documentation

This is the documentation for the pro version of our content plugin for Virtuemart.

Installation


Install using the Joomla installer. Enable the plugin in the plugin manager


Embedding the product snapshot into a Joomla Article

The product snapshot can be embedded in any content that supports Joomla content plugins. This includes Joomla articles and the custom html module, also many 3rd party extensions such as K2. Use code such as the following:

{product id=23}

This will embed the product with an id number of 23 (the id number is the one in the right hand column in the column marked id in the Virtuemart product manager).

You can set default parameters in the plugin manager. These can be overridden with user parameters, the ones available are:

  • id
  • sku
  • cid
  • category
  • mid
  • manufacturer
  • group
  • showAddToCart
  • showQuantityControls
  • showPrice
  • showCaption
  • showSDescription
  • showDescription
  • showImage
  • showName
  • showProductLink
  • showStock
  • showSKU
  • showChild
  • captionLength
  • imageWidth
  • imageHeight
  • maxImages
  • layout
  • orderBy
  • orderDir
  • limit

Compulsory Parameters

One of the following parameters is required:-

  • id (product id, can be a list)
  • sku (product sku, can be a list)
  • cid (category id eg 4)
  • category (category name eg Electronics)
  • mid (manufacturer id eg 3)
  • manufacturer (manufacturer name eg Microsoft)
  • group (values are featured, latest, random, topten, recent)

The others are optional. If used they must be separated by semi-colons and usually have a zero or one value:

Example 1

{product id=23,27,34;showImage=1;showAddToCart=0;showDescription=1}

This will show three products with the image and description but not the add-to-cart button. The other parameters will take their default values as set in the plugin manager.

Example 2

{product sku=c002a,c0002b,m0054;showImage=1;showStock=1;showDescription=0}


This will show three products with the listed skus, with the images and stock levels but no description. The other parameters will take their default values as set in the plugin manager.

Example 3

{product cid=4}

will show products from the category with id number 4.

Controlling the Ordering

With listing multiple products you may want to set the orderBy and orderDir parameters. Possible values of orderyBy are:-

  • product_name
  • created_on
  • product_sku
  • product_s_desc
  • category_name
  • mf_name
  • product_price
  • product_special
  • product_sales
  • product_height
  • product_width
  • product_length
  • product_weight
  • virtuemart_product_id
  • ordering

orderDir can take the values ASC or DESC

Example 4

{product category=tools;limit=15;orderBy=product_price;orderDir=ASC}

This will list up to 15 products from the tools category, ordered by price in ascending order. Note that the plugin conducts a keyword search so if more than one category has 'tools' in the name (eg, garden tools, power tools) results from both will be displayed.

Example 5

{product group=featured}

This will display products marked as featured.

Combining Parameters

It is possible to combine the cid parameter with some of the others (mid, manufacturer or group) to restrict results to a specific category, eg

Example 6

{product group=latest;cid=6}

This will show the latest products from the category with id number 6.

Price and Custom Field Display

The plugin will display the price fields selected in the Virtuemart price configuration. It will display custom fields, and is fully compatible with the stockable variants plugin.

Image and Layout Options

The imageWidth, imageHeight and layout parameters are only available in the 'Pro' version of the plugin. The imageWidth and imageHeight parameters take an integer value for the size in pixels.

The 'pro' version of the plugin includes extra layouts. These are installed in the tmpl sub-directory of the plugin, and can be overridden by placing your own versions in the html folder of your site template. The layout parameter takes the values: default, thumbnails, small_thumbnails, lightbox_gallery and slideshow. For example:-

Example 7

{product id=23;imageWidth=200;imageHeight=160;layout=slideshow}

If you wish to override the layout there are a long list of data available to your template:- 

  • $list->product_id
  • $list->category_id
  • $list->product_name
  • $list->product_link - url of Virtuemart product page
  • $list->product_link_button - html for product link button
  • $list->product_thumb_image - html for product thumb image
  • $list->product_s_desc - product short description
  • $list->price - sales price
  • $list->prices - list of prices information, keys are "basePrice","basePriceVariant", "variantModification","basePriceWithTax", "salesPriceWithDiscount", "salesPrice", "discountedPriceWithoutTax","priceWithoutTax","discountAmount","taxAmount","unitPrice"
    eg $list->prices->salesPriceWithDiscount gives sales price with discount
  • $list->prices->priceDiv gives complete html for prices
  • $list->addtocart_link - url to add product to cart
  • $list->addtocart_button - html for add to cart button
  • $list->images - array of small image urls
  • $list->full_images - array full image urls
  • $list->thumbnails - html markup for thumbnails including lightbox if appropriate
  • $list->lightbox_links - <a> tag for hidden lightbox links
  • $list->stock
  • $list->sku