Shortcodes & Widgets
The shortcodes & widgets add-on allows you to do 2 core things; display products from your Magento store within any WordPress post or page, and add a sidebar widget to your WordPress site that displays products from a category of your choosing.
The Shortcode
The shortcode allows you to display any number of products in a WordPress post or page.
[mwi_product sku="" title="true" title_tag="h2" desc="true" img="true" img_width="200" price="true" type="add" btn_color="blue" btn_link="button" cols="3"/]
- sku
Description: Displays the products entered.
Options: A single SKU from Magento, or a comma separated list of SKUs.
Default: -
- title
Description: Shows/hides the product title.
Options: true/false
Default: true
- title_tag
Description: Wraps the title in a HTML tag.
Options: Any HTML tag
Default: h2
- desc
Description: Shows the product’s short description. img
Options: true/false
Default: true
- img
Description: Shows the product image.
Options: true/false
Default: true
- img_width
Description: The pixel width of the product image.
Options: Any numerical value
Default: 200
- price
Description: Show/hide the price
Options: true/false
Default: true
- type
Description: The type of button to show under the product; add to cart, view product, or nothing.
Options: add/view/false
Default: add
- btn_color
Description: If styles are enabled, this allows you to choose a button color.
Options: blue/orange/black/gray/white/red/rosy/green/pink/none
Default: blue
- btn_link
Description: Whether to display the button as an HTML button or an anchor link.
Options: button/link
Default: button
- cols
Description: If more than one SKU is entered, this defines how many items to show per row
Options: Any numerical value
Default: 3
Shortcode Usage
To display a single product with all the default settings, use:
[mwi_product sku="product1"/]
To display multiple products with all the default settings, simple use the following shortcode:
[mwi_product sku="product1,product2,product3"/]
To display multiple products, but change the width of the thumbnail, use:
[mwi_product sku="product1,product2,product3" img_width="100"/]
The Widget
The widget allows you to display products from any category in a dynamic WordPress sidebar. There are a bunch of options, including:
- Category ID
- Number of products to show
- Show/link title
- Show/link product image
- Show/hide price
- Image width
- View/Add product buttons, with changeable text
This widget only allows you to display products from one Magento category. If you’d like to display products from different Magento categories, based on the WordPress category you’re in, try the
Category Specific Widget add-on.
Widget Usage
After activating the add-on, navigate to Appearance → Widgets. You will see a new widget called Mage/WP: Products from category; simply drag this into a sidebar position and enter your parameters.
Activate the Add-on
- Browse to Settings → Mage/WP.
- Towards the bottom you will see an add-ons table. In the field Shortcodes & Widgets enter the code that was emailed to you after purchasing the add-on.
- Click Activate.
Styles
Once activated, you will have a new option in Settings → Mage/WP that allows you to enable/disable the default styles for products display via a widget or shortcode.
License
After purchasing, you are permitted to use your add-on activation key on multiple websites.
Notes
The shortcodes and widgets add-on requires that the core MWI plugin is installed and setup.
You will be sent an activation code immediately after purchasing the add-on.