Title: Load XML prices into PHP
Last modified: September 1, 2016

---

# Load XML prices into PHP

 *  [fvdekart](https://wordpress.org/support/users/fvdekart/)
 * (@fvdekart)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/load-xml-prices-into-php/)
 * Because I want to change the display product price of each product (not the real
   price). I have used following code in my functions.php:
 *     ```
       function sv_change_product_html( $price_html, $product ) {
           if ( 66 === $product->id ) {
               $price_html = '<span class="amount">€10.00</span>';
           }
   
           return $price_html;
       }
       add_filter( 'woocommerce_get_price_html', 'sv_change_product_html', 10, 2 );
       ```
   
 * The code above is only for product ID 66, but I need to write this code for every
   product. I can easily do this but everytime I want to change the display product
   price I need to change it in the functions.php and I don’t want that.
 * How can I make a XML file with all the display product prices and load them into
   my functions.php so I dont have to write all the prices in the PHP file but I
   can easily load them from a XML list.
 * Hope someone can help.

Viewing 1 replies (of 1 total)

 *  [Tanveer Sure](https://wordpress.org/support/users/tsure/)
 * (@tsure)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/load-xml-prices-into-php/#post-7509428)
 * Hi,
 * Not sure if the link below is helpful:
 * [https://wordpress.org/support/topic/build-in-xml-parser?replies=7](https://wordpress.org/support/topic/build-in-xml-parser?replies=7)
 * Up for giving it a read?

Viewing 1 replies (of 1 total)

The topic ‘Load XML prices into PHP’ is closed to new replies.

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)
 * [product price](https://wordpress.org/support/topic-tag/product-price/)
 * [xml](https://wordpress.org/support/topic-tag/xml/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Tanveer Sure](https://wordpress.org/support/users/tsure/)
 * Last activity: [9 years, 11 months ago](https://wordpress.org/support/topic/load-xml-prices-into-php/#post-7509428)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
