The Rule form: VirtueMart

(2 votes, average 5.00 out of 5)

8-cham-virtuemart-form-b

8-cham-virtuemart-form-c

1. Page Type

This control allows you to target every different page type within VirtueMart. You might wish to select all the Cart and Checkout pages in 1 rule for a certain template, and the productdetails page in another rule for another template — the combinations are practically limitless.

Options:

  • VM front page
  • category
  • productdetails
  • productdetails.ask
  • productdetails.mailquestion
  • productdetails.notify
  • productdetails.recommend
  • cart
  • cart.editshipment
  • cart.editpayment
  • cart.thankyou
  • checkout.result
  • checkout.editshipto
  • checkout.editbillto
  • user
  • user.editshipto
  • user.editbillto
  • orders
  • order.view
  • plugin.response
  • searchresults
  • manufacturer
  • manufacturer.products

2. Product id(s)

You can target particular products by ID number, to use a certain template (or to make the rule SUCCEED). If you want to target more than one, enter the list of ID numbers separated by commas.

The Product IDs are checked whenever VirtueMart is on a productdetails page or any other page that takes a product_id parameter. Therefore you might like to restrict the types of pages checked using the Page Type selector as well as the Product id(s) selector.

3. Category id(s)

You can target particular products by category ID number, to use a certain template (or to make the rule SUCCEED). If you want to target more than one, enter the list of category ID numbers separated by commas.

The Category IDs are checked whenever VirtueMart is on a category page (i.e. browsing the category), productdetails page (viewing a product in that category) or any other page that takes a category_id parameter. Therefore you might like to restrict the types of pages checked using the Page Type selector as well as the Category id(s) selector.

4. Ancestor Category id(s)

If your category hierarchy is more than 1 deep, you may wish to target all category pages or product pages that are beneath a certain top-level or mid-level category.

That’s where this control comes in. It allows you to target any category page or productdetails page that descends from the specified category id(s).

Don’t be confused by the fact that this is called “ancestor” rather than “descendent”. The category id(s) that you insert in this box may be the parents or grandparents (etc) of the products that you are trying to target... therefore the box is called “ancestor category id(s)”.

e.g. your category hierarchy may look like this:

  • Technology (id 1)
    • Microsoft (id 3)
      • Business (id 7)
      • Consumer (id 8)
    • Apple (id 4)
      • Hardware (id 9)
      • Software (id 10)
  • Sports (id 2)
    • Athletics (id 5)
      • Field (id 11)
      • Track (id 12)
    • Team (id 6)

If you want to target everything in the Sports section, enter "2" in the Ancestor Category Id(s) box.
If you want to target anything under both Athletics and Apple, enter "5, 4" in the Ancestor Category Id(s) box.

5. Manufacturer id(s)

You can target particular products by manufacturer ID number, to use a certain template (or to make the rule SUCCEED). If you want to target more than one, enter the list of manufacturer ID numbers separated by commas.

The Manufacturer IDs are checked whenever VirtueMart is on a manufacturer page (i.e. viewing info about that manufacturer), manufacturer.products page (i.e. browsing products by manufacturer), shop.product_details page (viewing a product from that manufacturer) or any other page that takes a manufacturer_id parameter. Therefore you might like to restrict the types of pages checked using the Page Type selector as well as the Manufacturer id(s) selector.

6. Items in Stock

The number of product items in stock. Operates only on productdetails pages. This selector comes in 2 parts: a drop-down and a text field to enter numbers.

Options:

  • Ignore
  • =
  • != (not equal to)
  • >
  • >=
  • <
  • <=

Examples:

  • = 0
  • > 0
  • < 10 (i.e. low stock)
  • > 1000 (i.e. high stock)

7. Previous purchases of this product

The number of product items of the currently-viewed product that have already been purchased by the current user. As for "Items in Stock" above, you need to select =, etc. from a drop-down to go with the figure in the text box.

8. Previous purchase SKU(s)

Whether the current user has already purchased any items with SKU(s) as listed in this box. Enter a comma-separated list of product SKUs. Note that this cannot detect whether the user has purchased any of the listed items until/unless the user is logged in to their Joomla user account.

9. Previous purchase id(s)

Whether the current user has already purchased any items with product id(s) as listed in this box. Enter a comma-separated list of product ids. Note that this cannot detect whether the user has purchased any of the listed items until/unless the user is logged in to their Joomla user account.

10. Cart Empty

Is the shopping cart empty? This can be used on any Joomla! page, not just VirtueMart pages.

When an item is added to the cart for the first time, Chameleon is run before the item is actually added, so this rule will appear to lag by one page.

Options: Ignore | Yes | No

11. Cart Product id(s)

A comma-separated list of product ids. The rule will SUCCEED if the cart contains any one of these products. This can be used on any Joomla! page, not just VirtueMart pages.

When an item is added to the cart for the first time, Chameleon is run before the item is actually added, so this rule will appear to lag by one page.

12. Cart Category id(s)

A comma-separated list of category ids. The rule will SUCCEED if the cart contains a product directly inside one of the given categories. This can be used on any Joomla! page, not just VirtueMart pages.

When an item is added to the cart for the first time, Chameleon is run before the item is actually added, so this rule will appear to lag by one page.

13. Coupon Used

Detects whether or not a coupon has been redeemed in the current session.

When a coupon code is submitted, Chameleon is run before the coupon is actually added in Virtuemart, so this rule will appear to lag by one page.

Options: Ignore | Yes | No

14. Coupon Code(s)

A comma-separated list of coupon codes. The rule will SUCCEED if the user has entered one of these codes.

When a coupon code is submitted, Chameleon is run before the coupon is actually added in Virtuemart, so this rule will appear to lag by one page.

15. Selected Currency

The rule will succeed if the VM currency is set to any of the selected currencies. If none are selected, no check is performed.

Example:

  • You could allow users to set their own currency using VM's standard currency selector, but use this control to detect a certain currency (e.g. Euro) and change the language or names of menu items to match that currency. 
Last Updated on Wednesday, 15 July 2015 11:09