How can I display a short description?

  • Posts: 222
  • Thank you received: 1
11 years 7 months ago #94537

How can I display a short product description on category product listing pages? On the product page I have a long description. But I can't find an option for a short description.
Vero

Last edit: 11 years 7 months ago by Vero. Reason: fout

Please Log in or Create an account to join the conversation.

  • Posts: 82785
  • Thank you received: 13353
  • MODERATOR
11 years 7 months ago #94558

Please Log in or Create an account to join the conversation.

  • Posts: 222
  • Thank you received: 1
11 years 7 months ago #94595

I have added and ... nothing

I have added in this place:
<!-- PRODUCT NAME -->
<span class="hikashop_product_name">
<?php echo preg_replace('#<hr*id="system-readmore"*/>.*#is',",$this->row->product_description);?>
<?php if($this->params->get('link_to_product_page',1)){ ?>

P.S. I show my products in tabel and I wil under the product name to show a short description (listing_img_title)

Last edit: 11 years 7 months ago by Vero.

Please Log in or Create an account to join the conversation.

  • Posts: 82785
  • Thank you received: 13353
  • MODERATOR
11 years 7 months ago #94608

If you're using the "table" layout, it's the file "listing_table" that you need to edit, not "listing_img_title".

Please Log in or Create an account to join the conversation.

  • Posts: 222
  • Thank you received: 1
11 years 7 months ago #94632

I did. At beginning of file, nothing changes. At the end of file... nothing changes.
(product listing_table)
In which place of file exactly have I to add this code?

Vero

Last edit: 11 years 7 months ago by Vero.

Please Log in or Create an account to join the conversation.

  • Posts: 222
  • Thank you received: 1
11 years 7 months ago #94639

P.S. It changed, crashed my template. I removed this code.
I am not a prof. Can you, please, explain, in which place of file have I to add this code.
Vero

Last edit: 11 years 7 months ago by Vero.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 7 months ago #94669

Hi,

Where you have placed it was ok.
Had you an error returned ? (thanks to set the Joomla error reporting to maximum)

Please Log in or Create an account to join the conversation.

  • Posts: 222
  • Thank you received: 1
11 years 7 months ago #94687

Xavier wrote: Hi,

Where you have placed it was ok.
Had you an error returned ? (thanks to set the Joomla error reporting to maximum)


I had no error message. Just my website was on white background, all the items in a row as a list, with other sizes and font family.
Vero

Please Log in or Create an account to join the conversation.

  • Posts: 222
  • Thank you received: 1
11 years 7 months ago #94815

Can somebody make an advice?

Please Log in or Create an account to join the conversation.

  • Posts: 82785
  • Thank you received: 13353
  • MODERATOR
11 years 7 months ago #94820

If you had turned on the error reporting you should have had an error when you did your change.

The problem is that you should not at it at the beginning or at the end of the listing_table file.

You should add the line

<?php echo preg_replace('#<hr*id="system-readmore"*/>.*#is',",$this->row->product_description);?>
after
if($this->params->get('link_to_product_page',1)){ ?>
								</a>
							<?php } ?>
in listing_table.

Please Log in or Create an account to join the conversation.

  • Posts: 222
  • Thank you received: 1
11 years 7 months ago #94836

That same.

On the first image my corect website, on the second image, what happened if I add this code, and on the third image where I added code





Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 7 months ago #94957

Hi,

Thanks to use this code:

<?php echo preg_replace('#<hr*id="system-readmore"*/>.*#is','',$this->row->product_description); ?>

Please Log in or Create an account to join the conversation.

  • Posts: 222
  • Thank you received: 1
11 years 7 months ago #94981

Xavier wrote: Hi,

Thanks to use this code:

<?php echo preg_replace('#<hr*id="system-readmore"*/>.*#is','',$this->row->product_description); ?>


I don't understand what you mean. I use this code. That can you see on image. I have placed above 3 images. Sorry, but I don't understand.

Vero

Please Log in or Create an account to join the conversation.

  • Posts: 2334
  • Thank you received: 403
11 years 7 months ago #95010

Hi Vero,

It's not exactly the same code. Try this one instead of the one given by Nicolas and it should work :)

The following user(s) said Thank You: Vero

Please Log in or Create an account to join the conversation.

  • Posts: 222
  • Thank you received: 1
11 years 7 months ago #95030

Now I have this finally, but the whole description. So, not just a short, but a short description + black line + a long description...

Who can I have just a short description in product listing? A short description has to be not a link. Links are image and the name of product. Because my link is of pink color, than is enough just the name us a link. A short description I wil in normal grey color. Others the all text pink is not nice and too much pink color.

Can you help me?

Vero



Vero

Please Log in or Create an account to join the conversation.

  • Posts: 82785
  • Thank you received: 13353
  • MODERATOR
11 years 7 months ago #95101

The code proposed by Xavier will display the short description.
If you want the full description, then simply use that code instead:
<?php echo $this->row->product_description; ?>

Please Log in or Create an account to join the conversation.

  • Posts: 222
  • Thank you received: 1
11 years 7 months ago #95124

nicolas wrote: The code proposed by Xavier will display the short description.
If you want the full description, then simply use that code instead:
<?php echo $this->row->product_description; ?>


I know that my Englisch is not good, I try again.
I wil only! short description on product listig table pages. With the code proposed by Xavier I have a short description + black line + a long description on those pages. So I have all! on those pages, but I wil only! a short description that is above the readmore link.

That is the image what I have now:
you see the black line and under this line the whole description is shown. I need only the first three lines of text and don't need this black line and the rest of the text under that line.


Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 82785
  • Thank you received: 13353
  • MODERATOR
11 years 7 months ago #95171

Then it means that the description of the product doesn't have a valid read more tag.
Please make sure that it uses:

<hr id="system-readmore" />

Please Log in or Create an account to join the conversation.

  • Posts: 222
  • Thank you received: 1
11 years 7 months ago #95228

nicolas wrote: Then it means that the description of the product doesn't have a valid read more tag.
Please make sure that it uses:

<hr id="system-readmore" />


It uses, of course. Do you see that black line? If it not uses, will be no line. I made sure.

Attachments:
Last edit: 11 years 7 months ago by Vero.

Please Log in or Create an account to join the conversation.

  • Posts: 2334
  • Thank you received: 403
11 years 7 months ago #95268

Hi there,

Here the right line, sorry about the first mistakes:

<?php echo preg_replace('#<hr *id="system-readmore" */>.*#is','',$this->row->product_description); ?>

The following user(s) said Thank You: Vero

Please Log in or Create an account to join the conversation.

Time to create page: 0.128 seconds
Powered by Kunena Forum