EKM Tag: [ekm:addtocart]
This tag will output the "Add To Cart" button for the product page you are currently viewing. If the product is out of stock it will also output a message and/or hide the button.
This tag can only be used within the product page. This tag MUST be placed within the [ekm:productstart]
and [ekm:productend]
tags in order to work.
- Tag Information
- Nesting This Tag
- Examples
[ekm:addtocart][/ekm:addtocart]
[ekm:addtocart]
output_start='<div class="ekmps-location">';
alt_text='Buy Now';
image_formatting='none';
output_end='</div>';
[/ekm:addtocart]
alt_text='Buy Now';
Specify the message you want to display when you hover your mouse over the button.
input_class='custom-class';
Specifies an additional class to be added to the button element.
image_formatting='none';
Allows you to specify whether you want to prevent formatting, such as tables and font tags, from appearing around your add to cart button.
output_start='<div>';
Specify any HTML to be output before the add to cart button.
output_end='</div>';
Specify any HTML to be output after the add to cart button.
The EKM system allows for some tags to be nested within other tags.
When nesting this tag you do not need to make any alterations.
[ekm:if]
iftype='EQUALS';
ifvalue='1';
ifvalue2='1';
ifthen='[ekm:addtocart][/ekm:addtocart]';
ifelse='';
[/ekm:if]
This examples allows you to place a three state hover effect on your add to cart button. This will give you an effect on hover and a seperate effect when clicking.
This is done using a sprite image (like this) and can only be applied to a text button. If you wish to use this example and have uploaded an image you will need to change back to a text button.
<style type="text/css">
/* Add to cart button */
#add-to-cart input {background: url(/ekmps/shops/[ekm:siteusername][/ekm:siteusername]/resources/Design/add-to-cart-button.png) no-repeat right top; width: 181px; height: 45px; line-height: 300px; overflow: hidden; font-size: 0px; cursor: pointer; border: none 0;}
#add-to-cart input:hover {background-position: right center;}
#add-to-cart input:active {background-position: right bottom;}
</style>
<div id="add-to-cart">[ekm:addtocart]image_formatting='none';[/ekm:addtocart]</a>