Skip to main content

Read More Button Not Available

More
15 years 6 months ago #10626 by petermorris
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.

More
15 years 6 months ago #10628 by nicolas
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.

More
15 years 6 months ago #10639 by petermorris
Thanks, I found the file. Any suggestions for the correct syntax?

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

More
15 years 6 months ago #10640 by nicolas
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.

More
15 years 6 months ago #10641 by petermorris
Great. Thanks!

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

More
15 years 6 months ago #12399 by cosmo
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.

More
15 years 6 months ago - 15 years 6 months ago #12415 by nicolas
You should use:
Code:
echo '<a href="'.$link;.'">Read more</a>';
Last edit: 15 years 6 months ago by nicolas.

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

More
15 years 6 months ago #12421 by cosmo
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.

More
15 years 6 months ago #12446 by nicolas
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.

More
15 years 6 months ago #12522 by cosmo
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.

More
15 years 6 months ago - 15 years 5 months ago #12527 by nicolas
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: 15 years 5 months ago by nicolas.

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

More
15 years 5 months ago - 15 years 5 months ago #12692 by cosmo
So the code I'm using right now is
Code:
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: 15 years 5 months ago by cosmo.

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

More
15 years 5 months ago #12694 by nicolas
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.

More
15 years 5 months ago #12717 by cosmo
Great, this works fine now! Thanks for your help.

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

More
15 years 3 months ago #17973 by webarts
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.

More
15 years 3 months ago #17976 by nicolas
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.

More
15 years 3 months ago #17978 by webarts
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.

More
15 years 3 months ago - 15 years 3 months ago #17979 by nicolas
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: 15 years 3 months ago by nicolas.

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

More
15 years 3 months ago #17980 by webarts
in which line i have to insert the code?

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

More
15 years 3 months ago #17982 by nicolas
I've changed my message.

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

Time to create page: 0.254 seconds
Powered by Kunena Forum