MAIN shortcode for the site content which makes prices in it switch-able!
This shortcode allows you set switch-able value in any of you promotional text in the WordPress site. Value should be set in the default currency. Good for any advertising text in txt-banners and articles to show the price in by-user selected currency.
Example: [wpcs_price value=20], or [wpcs_price meta_value=my_any_meta_field_key]
Has next attributes:
- value – price, amount or any by your logic. Decimal or integer.
- meta_value – price amount taken directly from a meta field, this field has more priority than attribute ‘value’ if they presented together in the shortcode. Decimal or integer. Example: [wpcs_price meta_value=my_price_field]. Use point for decimals, example: 100.55
- type – write there word ‘fixed’ to display fixed prices for each currency instead of recounting relatively of basic currency
- post_id – (from v.2.1.7/1.1.7) if it is necessary to show switchable post price somewhere, for example in a catalog. Works together with attribute ‘meta_value‘. If meta value is not described price value is taken from field ‘wpcs_price‘ of the post.
- fix_currency – (from v.2.1.9/1.1.9) accepts a currency code, and shows the price in this currency, independent of the selected one
If you want to set for each currency its own price and avoid recounting relatively of basic currency write smth like: [wpcs_price type=”fixed” value=”USD:15,EUR:20,GBP:45“] . If you want use meta field instead of attribute ‘value‘ write shortcode as [wpcs_price meta_value=my_price_field type=”fixed”] and value of meta field should has next syntax: USD:15,EUR:20,GBP:45
If you will miss value for any currency on the site front will be displayed word ‘none‘.