Title: Compare 2 fields with inline PHP?
Last modified: March 22, 2022

---

# Compare 2 fields with inline PHP?

 *  [thvx](https://wordpress.org/support/users/thvx/)
 * (@thvx)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/compare-2-fields-with-inline-php-2/)
 * I’m currently adding a Feed Module from a pharmacist website, given that the 
   CSV file doesn’t have a typical sale price and a regular price tag, I was wondering
   if I could make inline PHP if statement in the “sale price (optional)” field 
   to decide when to show the sale price and when not to.
 * The CSV file instead has a fromPrice and a Price tag. If there’s a sale, the 
   Price tag is lower than the fromPrice tag. I have a inline PHP for this in my
   woocommerce products import:
    [IF({price[.<../fromprice]})]{price}[ENDIF]
 * In brief, price should only be showcased if it’s lower than fromprice. I would
   like to make an if statement or anything that would accomplish this!

Viewing 1 replies (of 1 total)

 *  Plugin Author [keywordrush](https://wordpress.org/support/users/keywordrush/)
 * (@keywordrush)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/compare-2-fields-with-inline-php-2/#post-15483893)
 * It’s ony possible with customisation. Please contact our support by email [https://www.keywordrush.com/contact](https://www.keywordrush.com/contact)

Viewing 1 replies (of 1 total)

The topic ‘Compare 2 fields with inline PHP?’ is closed to new replies.

 * ![](https://ps.w.org/content-egg/assets/icon.svg?rev=2546039)
 * [Content Egg – Affiliate Product Importer & Price Comparison](https://wordpress.org/plugins/content-egg/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/content-egg/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/content-egg/)
 * [Active Topics](https://wordpress.org/support/plugin/content-egg/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/content-egg/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/content-egg/reviews/)

## Tags

 * [all import](https://wordpress.org/support/topic-tag/all-import/)
 * [Import](https://wordpress.org/support/topic-tag/import/)

 * 1 reply
 * 2 participants
 * Last reply from: [keywordrush](https://wordpress.org/support/users/keywordrush/)
 * Last activity: [4 years, 2 months ago](https://wordpress.org/support/topic/compare-2-fields-with-inline-php-2/#post-15483893)
 * Status: not resolved