Jump to content

PHP - if function


deadend

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.