deadend Posted March 22, 2013 Share Posted March 22, 2013 Hi, The following code shows a short description that is entered for the product. Since i have alot of products, and want to use the short description as a notice, i would like it to show only some text i.e. "This is custom text for field". if (!empty($this->product->product_s_desc)) { ?> <div class="product-short-description"> <?php I tryed alot of things but allways show a server error. echo "This is custom text for field"; Thank you in advance. Link to comment https://forums.phpfreaks.com/topic/276005-php-if-function/ Share on other sites More sharing options...
DaveyK Posted March 22, 2013 Share Posted March 22, 2013 Do you have error reporting turned on? If not, turn it on: error_reporting(E_ALL); ini_set("display_errors", 1); Link to comment https://forums.phpfreaks.com/topic/276005-php-if-function/#findComment-1420282 Share on other sites More sharing options...
deadend Posted March 22, 2013 Author Share Posted March 22, 2013 Hi, Thank you for the quick response. My mistake in the first post, i did not copy the full code for that part: // Product Short Description if (!empty($this->product->product_s_desc)) { ?> <div class="product-short-description"> <?php /** @todo Test if content plugins modify the product description */ echo nl2br($this->product->product_s_desc); ?> </div> <?php } // Product Short Description END I don't know what to write so that allways shows my text line instead of $this->product->product_s_desc Thank you. Link to comment https://forums.phpfreaks.com/topic/276005-php-if-function/#findComment-1420296 Share on other sites More sharing options...
Jessica Posted March 22, 2013 Share Posted March 22, 2013 Remove the entire section you've shown us...And put in your text. Link to comment https://forums.phpfreaks.com/topic/276005-php-if-function/#findComment-1420297 Share on other sites More sharing options...
DaveyK Posted March 22, 2013 Share Posted March 22, 2013 Also, you say you are getting a 500 error (server error). What I want to know, is if you show errors? Do you have error reporting turned on? Link to comment https://forums.phpfreaks.com/topic/276005-php-if-function/#findComment-1420298 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.