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

Edited by deadend
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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