Jump to content

Search the Community

Showing results for tags 'conditional statement'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. I have been told to add <?php if ( isset( $product->currency ) ) : ?> into the below code to check if the "currency" field has been set. If it hasn't been set (ie left empty) then I want to show the Aussie dollaras default <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_Australia.jpg" /> $AUD I've tried putting it in different places and all I get is a blank page. I think there might need to be an "else" somewhere so i put in all sorts of different elseif's and still ended up with a blank page. I am wondering if anybody could put me on the right track please. Thanks Rowan <?php if ($product->saleprice > 0 && $product->saleprice < $product->price) { ?> <div class="prc"> <small> On Sale: <span style="font-weight: bold; color:red;"><?php if ($product->currency == 'USD') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_the_United_States.jpg" /> $USD <?php elseif ($product->currency == 'USD$') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_the_United_States.jpg" /> $USD <?php elseif ($product->currency == 'GBP') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_the_United_Kingdom.jpg" /> £ <?php elseif ($product->currency == '£') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_the_United_Kingdom.jpg" /> £ <?php elseif ($product->currency == 'AUD') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_Australia.jpg" /> $AUD <?php elseif ($product->currency == 'AUD$') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_Australia.jpg" /> $AUD <?php elseif ($product->currency == 'CDN$') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_Canada.jpg" /> $CDN <?php elseif ($product->currency == 'RM') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_Malaysia.jpg" /> <?php elseif ($product->currency == 'CDN') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_Canada.jpg" /> $CDN <?php elseif ($product->currency == 'NZD') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_New_Zealand.jpg" /> $NZD <?php elseif ($product->currency == 'NZD$') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_New_Zealand.jpg" /> $NZD <?php endif; ?> [product.saleprice]</span> </small> </div> <?php } else { ?> <div class="prc"> <small> <?php if ($product->currency == 'USD') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_the_United_States.jpg" /> $USD <?php elseif ($product->currency == 'USD$') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_the_United_States.jpg" /> $USD <?php elseif ($product->currency == 'GBP') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_the_United_Kingdom.jpg" /> £ <?php elseif ($product->currency == '£') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_the_United_Kingdom.jpg" /> £ <?php elseif ($product->currency == 'AUD') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_Australia.jpg" /> $AUD <?php elseif ($product->currency == 'AUD$') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_Australia.jpg" /> $AUD <?php elseif ($product->currency == 'CDN$') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_Canada.jpg" /> $CDN <?php elseif ($product->currency == 'RM') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_Malaysia.jpg" /> <?php elseif ($product->currency == 'CDN') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_Canada.jpg" /> $CDN <?php elseif ($product->currency == 'NZD') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_New_Zealand.jpg" /> $NZD <?php elseif ($product->currency == 'NZD$') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_New_Zealand.jpg" /> $NZD <?php endif; ?> [product.price] </small> </div> <?php } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.