Post by dirtboy » Sat Jun 02, 2012 1:31 pm

i need add a custom link to the category page, next to the product name. the link will be another product link code and will read "More Information". any ideas how i can do this?

“Anyone who stops learning is old, whether at twenty or eighty. Anyone who keeps learning stays young. The greatest thing in life is to keep your mind young.”
- Henry Ford


User avatar
Active Member

Posts

Joined
Wed Mar 07, 2012 3:04 pm

Post by florinsith » Sat Jun 02, 2012 4:50 pm

If that link goes to product page, then just copy the product name link:

Code: Select all

<a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a>
and instead of displaying product's name , checnge it to text 'More info' like:

Code: Select all

<a href="<?php echo $product['href']; ?>">More Information</a>
and if you need to make it a button, add that class to it like:

Code: Select all

<a href="<?php echo $product['href']; ?>" class="button">More Information</a>

Image
My Extensions - SuperTheme - Opencart templates - Opencart modules


User avatar
Expert Member

Posts

Joined
Fri May 14, 2010 2:36 am


Post by dirtboy » Sun Jun 03, 2012 7:59 am

thank you, works perfectly

“Anyone who stops learning is old, whether at twenty or eighty. Anyone who keeps learning stays young. The greatest thing in life is to keep your mind young.”
- Henry Ford


User avatar
Active Member

Posts

Joined
Wed Mar 07, 2012 3:04 pm

Post by amirasyura » Sat Nov 15, 2014 6:47 pm

florinsith wrote:If that link goes to product page, then just copy the product name link:

Code: Select all

<a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a>
and instead of displaying product's name , checnge it to text 'More info' like:

Code: Select all

<a href="<?php echo $product['href']; ?>">More Information</a>
and if you need to make it a button, add that class to it like:

Code: Select all

<a href="<?php echo $product['href']; ?>" class="button">More Information</a>
Im sorry im new with opencart.. where should i place the code? ???

User avatar
Newbie

Posts

Joined
Sat Jun 22, 2013 7:23 am
Location - Malaysia

Post by nobreak » Tue May 19, 2015 1:50 pm

Тo me does not work...page not found - ver 1.5.6.4

Attachments

1.jpg

1.jpg (84.69 KiB) Viewed 2030 times


Newbie

Posts

Joined
Wed Jul 02, 2014 3:23 pm

Post by IP_CAM » Thu Mar 29, 2018 4:03 am

Well, the Question was originally, how to display a link on a Category Page, so, the
file involved is the category.tpl File, and not the product.tpl file.
But how you managed, to get the source Code on a link, is a mystery to me. :D
Image
---
Anyway, you can see on the image below, where the Code needs to be added in the
category.tpl File, I just added a link to one of the information Pages, but any
other Page could be linked oc-internally or href-externally. And since I added a
Manufacturer VqMod, it displays the link below the manufacturer, and not directly
below the Title, as coded in the Source File..., just to mention this too.
---
It's Bootstrap-3 Theme Code, so it looks a little different from 1.5.6.x default Theme Code.
And this link will be shown in ALL Category Product Pages , as is exists, be aware of this!
On Product Pages, such a Link, with HTTP Linking, could be placed, to only display a Page,
related to the Product itself.
And for such, a free Extension for v.1.5.6.x already exists:
Custom Link in Products free, OC v.1.5.4 - 1.5.6.5_rc:
https://www.opencart.com/index.php?rout ... n_id=21139
---
Good Luck! ;)
Ernie
---
Image

Attachments

product_href.jpg

product_href.jpg (23.78 KiB) Viewed 914 times

external_link_in_category_pages_1564.jpg

external_link_in_category_pages_1564.jpg (133.06 KiB) Viewed 914 times


Please don't send me OC Forum Personal Messages, just contact: jti@jacob.ch
---
OC 1.5.6.5 LIGHT Test Site: http://www.bigmax.ch/shop/
OC 1.5.6.5 V-PRO Test Site: http://www.jacob.ch/shop/
My Github OC Site: https://github.com/IP-CAM
2'600+ FREE OC Extensions on the World's largest Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland
Who is online

Users browsing this forum: No registered users and 59 guests