Title: Customizing Your Shortcode for Dynamic Pricing
Last modified: August 22, 2016

---

# Customizing Your Shortcode for Dynamic Pricing

 *  Resolved [Denis Lam](https://wordpress.org/support/users/spiffyd/)
 * (@spiffyd)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/customizing-your-shortcode-for-dynamic-pricing/)
 * I would like to customize your shortcode so that the value for the “price” attribute
   calls from another source such as user meta field. Instead of directly modifying
   your plugin, do you have any hooks for developers to accomplish this task easily?
   Thanks in advance!
 * [https://wordpress.org/plugins/wordpress-simple-paypal-shopping-cart/](https://wordpress.org/plugins/wordpress-simple-paypal-shopping-cart/)

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

 *  Plugin Contributor [mbrsolution](https://wordpress.org/support/users/mbrsolution/)
 * (@mbrsolution)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/customizing-your-shortcode-for-dynamic-pricing/#post-5328449)
 * Hi Denis Lam, one of the plugin developers will review your request and reply
   soon.
 * Thank you
 *  Plugin Author [mra13](https://wordpress.org/support/users/mra13/)
 * (@mra13)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/customizing-your-shortcode-for-dynamic-pricing/#post-5328481)
 * Hi Denis, I am not 100% sure how you plan to use it. If you give me an example
   use case scenario, I should be able to help.
 * You can suggest an action hook or filter (where you see fit) and we will add 
   it in the plugin.
 * You can directly call a PHP function from another source and specify the product
   details. Here is an example usage:
 *     ```
       <?php echo print_wp_cart_button_for_product("Product Name","10.00"); ?>
       ```
   
 *  Thread Starter [Denis Lam](https://wordpress.org/support/users/spiffyd/)
 * (@spiffyd)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/customizing-your-shortcode-for-dynamic-pricing/#post-5328483)
 * Let me see if the direct PHP function call will work for our scenario. It does
   look promising as I can probably create my own shortcode that executes your function.
   Can you give me all the attributes your function can accept? Because I know in
   your shortcode there are other attributes we can add in there such as shipping.
   Thank you!
 *  Plugin Author [mra13](https://wordpress.org/support/users/mra13/)
 * (@mra13)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/customizing-your-shortcode-for-dynamic-pricing/#post-5328522)
 * Here is an example of the parameters you could pass:
 *     ```
       <?php echo print_wp_cart_button_for_product($name, $price, $shipping, $var1, $var2, $var3); ?>
       ```
   
 * Alternatively, you can do the following too (you can use all the parameters available
   in the shortcode):
 *     ```
       <?php echo do_shortcode('[wp_cart_button name="Test Product" price="19.95"]'); ?>
       ```
   
 *  Thread Starter [Denis Lam](https://wordpress.org/support/users/spiffyd/)
 * (@spiffyd)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/customizing-your-shortcode-for-dynamic-pricing/#post-5328533)
 * Your function `print_wp_cart_button_for_product()` and its parameters were perfect
   for my custom coding needs. There’s no need for you to add anything extra in 
   your simple plugin! 🙂
 *  Plugin Author [mra13](https://wordpress.org/support/users/mra13/)
 * (@mra13)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/customizing-your-shortcode-for-dynamic-pricing/#post-5328544)
 * Glad to hear that 🙂

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

The topic ‘Customizing Your Shortcode for Dynamic Pricing’ is closed to new replies.

 * ![](https://ps.w.org/wordpress-simple-paypal-shopping-cart/assets/icon-128x128.
   png?rev=2722490)
 * [Simple Shopping Cart](https://wordpress.org/plugins/wordpress-simple-paypal-shopping-cart/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-simple-paypal-shopping-cart/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-simple-paypal-shopping-cart/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-simple-paypal-shopping-cart/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-simple-paypal-shopping-cart/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-simple-paypal-shopping-cart/reviews/)

## Tags

 * [attribute](https://wordpress.org/support/topic-tag/attribute/)
 * [custom](https://wordpress.org/support/topic-tag/custom/)
 * [dev](https://wordpress.org/support/topic-tag/dev/)
 * [price](https://wordpress.org/support/topic-tag/price/)

 * 6 replies
 * 3 participants
 * Last reply from: [mra13](https://wordpress.org/support/users/mra13/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/customizing-your-shortcode-for-dynamic-pricing/#post-5328544)
 * Status: resolved