Ubercart Shortcodes
Categories
Component ID
Component name
Component type
Maintenance status
Development status
Component security advisory coverage
Downloads
Component created
Component changed
Component body
This add-on to the shortcode module provides provides additional shortcodes for use with Ubercart.
Usage
Places the sell price of the specified product into the page:
[sellprice nid=X (class="additional class") /]
[sellprice sku="X" (class="additional class") /]
Places the list price of the specified product into the page:
[listprice nid=X (class="additional class") /]
[listprice sku="X" (class="additional class") /]
Places the difference between the list price and the sell price into the page:
[pricediff nid=X (class="additional class") /]
[pricediff sku="X" (class="additional class") /]
Quick Start Instructions:
- Download and install the Shortcodes module
- Download and install the Ubercart Shortcodes module
- Go to Site Configuration > Input Formats
- Click Configure next to the Full HTML Input Format
- Check the Shortcodes option under Filters
- Click Save configuration
You're now ready to use shortcodes in any text area that uses the Full HTML input format. Create a new Page node and change the input format to Full HTML. In the body of the page, add the text [cartlink sku="UC-123"][sellprice sku="UC-123" /][/cartlink]
(Change UC-123 to the model number of a product in your store). When you view the page, you should see the price of that product. When clicked, it should add that product to your cart.
Theming
Each shortcode can be customized by copying the included theme file into your active theme. The theme system looks for files named shortcode_[shortcode-tag].tpl.php. For example, to customize the output of the sellprice shortcode you'll create the file shortcode_sellprice.tpl.php in your active theme folder. Don't forget to reset the theme registry cache after you add a new theme file.
If you have recommendations for additional shortcode tages for Ubercart, please post in the issue queue.