Read More Button Not Available

  • Posts: 52
  • Thank you received: 0
11 years 5 months ago #10626

I can't figure out how to display the "Read More" button in the product DIVs on the front end. "Read More" is enabled in the main configuration and I have also added the "Read More" dividers in the product descriptions. Any suggestions?

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

  • Posts: 76113
  • Thank you received: 11909
  • MODERATOR
11 years 5 months ago #10628

There is no button read more in HikaShop. When you add the divider in the product description, it cuts the description on the listings but since you already have a link on the product name and on the product image we didn't add an additional button to it. If you want to add one, you will have to edit the file listing_img_desc of the view product via the menu Display->Views and add it yourself.

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

  • Posts: 52
  • Thank you received: 0
11 years 5 months ago #10639

Thanks, I found the file. Any suggestions for the correct syntax?

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

  • Posts: 76113
  • Thank you received: 11909
  • MODERATOR
11 years 5 months ago #10640

Something like this:
echo $this->cart->displayButton('Read more','read_more',$this->params,$link,'window.location=\''.$link.'\';return false;');

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

The following user(s) said Thank You: bootfair

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

  • Posts: 52
  • Thank you received: 0
11 years 5 months ago #10641

Great. Thanks!

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

  • Posts: 19
  • Thank you received: 0
11 years 4 months ago #12399

Thanks a lot, it's working fine for me as well. Only thing is, I want it to be just a simple textlink not a button. What should the syntax look like?

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

  • Posts: 76113
  • Thank you received: 11909
  • MODERATOR
11 years 4 months ago #12415

You should use:

echo '<a href="'.$link;.'">Read more</a>';

Last edit: 11 years 4 months ago by nicolas.

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

  • Posts: 19
  • Thank you received: 0
11 years 4 months ago #12421

The code I was using looked like this:

<?php
echo preg_replace('#<hr *id="system-readmore" */>.*#is','',$this->row->product_description);
echo $this->cart->displayButton('Read More','read_more',$this->params,$link,'window.location=\''.$link.'\';return false;');
?>


According to your answer I changed the code into:

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


For some reason it's not working.

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

  • Posts: 76113
  • Thank you received: 11909
  • MODERATOR
11 years 4 months ago #12446

What do you mean by it's not working ?
Note that you don't have the same code as I posted. You have a < in the link URL.

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

  • Posts: 19
  • Thank you received: 0
11 years 4 months ago #12522

To be honest; I don't see any difference between the codes? All I did was copy-paste.

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

  • Posts: 76113
  • Thank you received: 11909
  • MODERATOR
11 years 4 months ago #12527

My mistake, I had it as well in my code. It should be:
echo '<a href="'.$link.'">Read more</a>';
not:
echo '<a href="<'.$link;.'">Read more</a>';

Last edit: 11 years 4 months ago by nicolas.

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

  • Posts: 19
  • Thank you received: 0
11 years 4 months ago #12692

So the code I'm using right now is

echo preg_replace('#<hr *id="system-readmore" */>.*#is','',$this->row->product_description);
echo '<a href="'.$link;.'">Read more</a>';

For some reason my products listing gives a blanc page only showing the category-title. Does this mean there is a problem with some plug-in or is it something else? I've de-activated all of the content plug-ins, but this didn't change anything.

Last edit: 11 years 4 months ago by cosmo.

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

  • Posts: 76113
  • Thank you received: 11909
  • MODERATOR
11 years 4 months ago #12694

The problem comes from the code.

I really wasn't fresh when in wrote it. It should be:
echo '<a href="'.$link.'">Read more</a>';

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

  • Posts: 19
  • Thank you received: 0
11 years 4 months ago #12717

Great, this works fine now! Thanks for your help.

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

  • Posts: 149
  • Thank you received: 0
11 years 2 months ago #17973

hi Nicolas ,

we use the 1.5.0 version and we cant figure out the readmore link.

i try the method above with no luck, any other quide lines please to fix it?

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

  • Posts: 76113
  • Thank you received: 11909
  • MODERATOR
11 years 2 months ago #17976

The method above works with all the versions. There is no other line. If you don't see it, it's because you didn't do the modification properly.

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

  • Posts: 149
  • Thank you received: 0
11 years 2 months ago #17978

the <hr id="system-readmore" /> is the correct "Read More code" in the product description?

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

  • Posts: 76113
  • Thank you received: 11909
  • MODERATOR
11 years 2 months ago #17979

That code just make a separation for the listing description.
If you also want a read more link, you need to add also the PHP code below in the file listing_img_desc of the view product via the menu Display->Views :
echo '<a href="'.$link.'">Read more</a>';
after the line:
echo preg_replace('#<hr *id="system-readmore" */>.*#is','',$this->row->product_description);

Last edit: 11 years 2 months ago by nicolas.

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

  • Posts: 149
  • Thank you received: 0
11 years 2 months ago #17980

in which line i have to insert the code?

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

  • Posts: 76113
  • Thank you received: 11909
  • MODERATOR
11 years 2 months ago #17982

I've changed my message.

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

Time to create page: 0.103 seconds
Powered by Kunena Forum