Title: Dynamic price
Last modified: September 1, 2016

---

# Dynamic price

 *  Resolved [Peter](https://wordpress.org/support/users/scripteo/)
 * (@scripteo)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/dynamic-price/)
 * Hi, How can I change price dynamically for orders in the php code? Regards
 * [https://wordpress.org/plugins/woocommerce/](https://wordpress.org/plugins/woocommerce/)

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

 *  Plugin Contributor [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * (@mikejolley)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/dynamic-price/#post-7610722)
 * Orders or products, and based on what?
 *  Thread Starter [Peter](https://wordpress.org/support/users/scripteo/)
 * (@scripteo)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/dynamic-price/#post-7610741)
 * Hi Mike,
 * I would like to create item e.g. “Example” with the price $1.
 * I need to show this item on site with button “add to cart” but I need to change
   the price for a specific users (like donations).
 * One item used with different prices. So users will be able to add to cart the
   same item with different prices. Then they will be able to pay for all items 
   added to cart.
 * Thanks!
 *  Plugin Support [Riaan K.](https://wordpress.org/support/users/riaanknoetze/)
 * (@riaanknoetze)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/dynamic-price/#post-7610747)
 * If I understand correctly, [Dynamic Pricing](https://woocommerce.com/products/dynamic-pricing/)
   should do the trick for you – it will allow you to set discounted prices for 
   the same product based on a user’s role 🙂
 *  Thread Starter [Peter](https://wordpress.org/support/users/scripteo/)
 * (@scripteo)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/dynamic-price/#post-7610750)
 * Hi Riann,
 * This add-on is not what I need. I need to control price for a few conditions (
   country, time, user and other parameters). So I want to change price dynamically
   via php code.
 * Regards
 *  [Thomas Shellberg](https://wordpress.org/support/users/shellbeezy/)
 * (@shellbeezy)
 * Automattic Happiness Engineer
 * [9 years, 9 months ago](https://wordpress.org/support/topic/dynamic-price/#post-7610768)
 * The following posts contain some examples for how you can modify the product 
   price using code:
 * [http://stackoverflow.com/questions/12327251/woocommerce-add-product-to-cart-with-price-override](http://stackoverflow.com/questions/12327251/woocommerce-add-product-to-cart-with-price-override)
 * [http://snippet.fm/snippets/change-product-price-in-woocommerce-programmatically/](http://snippet.fm/snippets/change-product-price-in-woocommerce-programmatically/)
 *  Thread Starter [Peter](https://wordpress.org/support/users/scripteo/)
 * (@scripteo)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/dynamic-price/#post-7610770)
 * Thanks Thomas!

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

The topic ‘Dynamic price’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

 * 6 replies
 * 4 participants
 * Last reply from: [Peter](https://wordpress.org/support/users/scripteo/)
 * Last activity: [9 years, 9 months ago](https://wordpress.org/support/topic/dynamic-price/#post-7610770)
 * Status: resolved