Virtuemart Extensions by

  • Full Screen
  • Wide Screen
  • Narrow Screen
  • Increase font size
  • Default font size
  • Decrease font size

Gift products at the Checkout

Starting with OPC 2.0.325 we added a generic support for a select drop down where your customer can choose which gift he would like to receive with the purchase. 


This is how it works: 

1. crete zero price product (name: Gift, price: 0.00001 - if your shop allows to purchase zero priced products you can also use a zero price, but it's recommended to use the lowest number possible)

2. make sure this product could be purchased by normal checkoukt, and it is not blocked by stock system or other VM configuration. To hide the product you can assign it to a hidden or no category

3. OPC configuration: 

3.1 Visit Shopper Fields tab in OPC backend configuratino

3.2. At the bottom you can locate "Gift Products section"

3.3 List of product IDs: 156,11090,11863,11864  (to find out ID of your product, visit the product configuration via Virtueamart backend and locate this section in your URL: option=com_virtuemart&view=product&task=edit&virtuemart_product_id=11859  This says that the product has ID 11859 which can be used in OPC configuration

3.4 Product display - you can choose if the product should be displayed as part of the cart as shown here (Gift Product No Price): 

gift product

Or if it should be displayed only as part of the totals (Cowboy Hat): 



3.5 Theme position for the the product checkbox - at version 325 most of the included themes already got a position for the gift products section and you can choose "checkbox_products" position in this configuraiton. 

3.5.1 If you are using your own custom theme and you would like to update it to support the Gift products you can do it this way: 

modify your onepage.unlogged (and logged).tpl.php files in your /components/com_onepage/themes/YOUR OPC THEME/onepage.unlogged.tpl.php

if (!empty($checkbox_products)) {
?><div class="op_inside checkbox_wrapper bandbox_wrapper" >
<div id="payment_head" class="bandBoxStyle bandBoxStyleHeader"><?php echo OPCLang::_('COM_ONEPAGE_CHECKBOX_SECTION'); ?></div>
<div id="payment_container"><?php echo $checkbox_products; ?></div>




to your

/components/com_onepage/themes/YOUR THEME/overrides/checkbox_products.php

The checkbox_products.php is used to render the gift or checkbox products with checkboxes.




to your

/components/com_onepage/themes/YOUR THEME/overrides/checkbox_products_select.php


The checkbox_products_select.php is used to render drop down for the checkbox products. 


3.6. Display as select drop down (only one can be chosen)

Here you can choose if the Gift products should be shown as classic checkboxes as shown above with "Cowboy hat" example or if they should be shown as drop down with the select as shown here: 

checkout section gift products


3.7 Default title for no selection, but default the drop down shows "COM_VIRTUEMART_LIST_EMPTY_OPTION" which is "-- select --", if you change this to EMPTY value, the first gift will be selected by default. You can insert your own text of the select default option here as you need. 

3.8 Display this section only above order subtotal starting at (order subtotal without taxes, shipping and payment) -> you can choose if to display the section of gift products only aboe a specific subtotal. 

We hope you enjoy the new feature, please let us know at the forum if you got any questions. 


You are here