Title: Shortcode for meta value?
Last modified: December 24, 2018

---

# Shortcode for meta value?

 *  Resolved [toolsavvy](https://wordpress.org/support/users/toolsavvy/)
 * (@toolsavvy)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/shortcode-for-meta-value/)
 * Hi,
 * I use your other plugin (WP Currency switcher). It has a shortcode to use if 
   you want to use currency switcher with a price from a meta value. I was using
   Advanced Custom Fields plugin and had a meta value fora price of base_price. 
   So I use the following shortcode…
 * `[wpcs_price meta_value="base_price"]`
 * I am switching my site to woocommerce and I wanted to use woocs, but I cannot
   find a shortcode to use meta value. I tried…
 * `[woocs_price meta_value="base_price"]`
 * ..but that doesn’t work. Is there another shortcode I can use for price from 
   a meta value?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [toolsavvy](https://wordpress.org/support/users/toolsavvy/)
 * (@toolsavvy)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/shortcode-for-meta-value/#post-11022944)
 * I just found a way!!! If you have another way, I would like to know what it is.
 * With my way, you have to use:
 * ► [woocs_price meta_value=”x”] shortcode
 * ► Advanced Custom field “get_field” and
 * ► do_shordcode() BUT you have to switch around the single and double quotes on
   the do_shortcode() form it’s normal syntax.
 * So in my case, I have an ACF meta key called “base_price”, so this is what my
   code looks like…
 *     ```
       <?php 
       $base_price = get_field('base_price', $post_id);
       echo do_shortcode( "[woocs_show_custom_price value='$base_price']" );
       ?>
       ```
   
 * This works for me. I hope it helps someone else. Again, please post here if there
   is another way.
    -  This reply was modified 7 years, 5 months ago by [toolsavvy](https://wordpress.org/support/users/toolsavvy/).
 *  [pavloborysenko](https://wordpress.org/support/users/pavloborysenko/)
 * (@pavloborysenko)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/shortcode-for-meta-value/#post-11027005)
 * Hello
 * Thank you for cooperation!
 * Yes! It’s the right way!
 *  Thread Starter [toolsavvy](https://wordpress.org/support/users/toolsavvy/)
 * (@toolsavvy)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/shortcode-for-meta-value/#post-11036524)
 * Thank you for your reply

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Shortcode for meta value?’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-currency-switcher/assets/icon-256x256.png?rev
   =2844633)
 * [FOX - Currency Switcher Professional for WooCommerce](https://wordpress.org/plugins/woocommerce-currency-switcher/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-currency-switcher/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-currency-switcher/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-currency-switcher/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-currency-switcher/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-currency-switcher/reviews/)

## Tags

 * [meta_value)](https://wordpress.org/support/topic-tag/meta_value/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)
 * [value](https://wordpress.org/support/topic-tag/value/)

 * 3 replies
 * 2 participants
 * Last reply from: [toolsavvy](https://wordpress.org/support/users/toolsavvy/)
 * Last activity: [7 years, 5 months ago](https://wordpress.org/support/topic/shortcode-for-meta-value/#post-11036524)
 * Status: resolved