Post by toad78 » Wed May 20, 2015 3:46 am

I have a product page (based upon one category item) in a Grid system. I want to add a 'Details' link next to the 'Add to Cart' button.

I have created this,
<input type="button" value="Details" onclick="('<?php echo $product['href']; ?>');" class="button" />
But nothing seems to be displaying on the frontend.

Anyone have any advice?

New member

Posts

Joined
Sun Dec 08, 2013 8:30 am

Post by fido-x » Wed May 20, 2015 5:23 pm

The product image and product name already provide links to the product description page.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by viethemes » Wed May 20, 2015 8:53 pm

toad78 wrote:I have a product page (based upon one category item) in a Grid system. I want to add a 'Details' link next to the 'Add to Cart' button.

I have created this,
<input type="button" value="Details" onclick="('<?php echo $product['href']; ?>');" class="button" />
But nothing seems to be displaying on the frontend.

Anyone have any advice?
Could you attach file catalog/view/theme/default/template/product/category.tpl, so we can take a look it closer?

http://www.viethemes.com - OpenCart turtorials, news, tips and stricks, extension

Our extensions:
Visual Theme Editor - Powerful tool for customizing style of any theme visually
Live Theme Editor - Customize layout, colors, backgrounds, fonts of the default theme
Theme Animation - Animation Editor for any theme

Extra Positions PRO, Custom JavaScript, Custom CSS and others


User avatar
Active Member

Posts

Joined
Thu Jan 08, 2015 12:17 pm


Post by toad78 » Wed May 20, 2015 10:55 pm

Attached is my category.tpl file. Thank you.

New member

Posts

Joined
Sun Dec 08, 2013 8:30 am

Post by viethemes » Wed May 20, 2015 11:08 pm

I have tried to add the code in my local store. It seems that everything is working properly.
I can see the detail button.

Attachments

category.png

category.png (77.96 KiB) Viewed 1671 times


http://www.viethemes.com - OpenCart turtorials, news, tips and stricks, extension

Our extensions:
Visual Theme Editor - Powerful tool for customizing style of any theme visually
Live Theme Editor - Customize layout, colors, backgrounds, fonts of the default theme
Theme Animation - Animation Editor for any theme

Extra Positions PRO, Custom JavaScript, Custom CSS and others


User avatar
Active Member

Posts

Joined
Thu Jan 08, 2015 12:17 pm


Post by toad78 » Wed May 20, 2015 11:10 pm

Yes, I can see it too, but the link doesn't work.

New member

Posts

Joined
Sun Dec 08, 2013 8:30 am

Post by viethemes » Wed May 20, 2015 11:21 pm

toad78 wrote:Yes, I can see it too, but the link doesn't work.
You can replace the above code with code below

Code: Select all

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

http://www.viethemes.com - OpenCart turtorials, news, tips and stricks, extension

Our extensions:
Visual Theme Editor - Powerful tool for customizing style of any theme visually
Live Theme Editor - Customize layout, colors, backgrounds, fonts of the default theme
Theme Animation - Animation Editor for any theme

Extra Positions PRO, Custom JavaScript, Custom CSS and others


User avatar
Active Member

Posts

Joined
Thu Jan 08, 2015 12:17 pm


Post by toad78 » Wed May 20, 2015 11:33 pm

Thank you, viethemes.

Then how can I make this adaptable to the language file? Say I want to change the text 'Details' to something else, but without have to edit the template? How can this be accomplished?

New member

Posts

Joined
Sun Dec 08, 2013 8:30 am

Post by viethemes » Wed May 20, 2015 11:50 pm

toad78 wrote:Thank you, viethemes.

Then how can I make this adaptable to the language file? Say I want to change the text 'Details' to something else, but without have to edit the template? How can this be accomplished?
You can try this code

Code: Select all

<a href="<?php echo $product['href']; ?>" class="button"><?php echo $this->language->get('text_details'); ?></a>
and open file catalog/language/english/english.php and code below after <?php

Code: Select all

$_['text_details'] = 'Details';

http://www.viethemes.com - OpenCart turtorials, news, tips and stricks, extension

Our extensions:
Visual Theme Editor - Powerful tool for customizing style of any theme visually
Live Theme Editor - Customize layout, colors, backgrounds, fonts of the default theme
Theme Animation - Animation Editor for any theme

Extra Positions PRO, Custom JavaScript, Custom CSS and others


User avatar
Active Member

Posts

Joined
Thu Jan 08, 2015 12:17 pm


Post by toad78 » Wed May 20, 2015 11:56 pm

Would this file be overwritten if I was to update it via OpenCart's upgrader?

New member

Posts

Joined
Sun Dec 08, 2013 8:30 am

Post by viethemes » Thu May 21, 2015 2:48 pm

The change will be lost if you upgrade OpenCart. You should create a VQMOD extension to do that.

http://www.viethemes.com - OpenCart turtorials, news, tips and stricks, extension

Our extensions:
Visual Theme Editor - Powerful tool for customizing style of any theme visually
Live Theme Editor - Customize layout, colors, backgrounds, fonts of the default theme
Theme Animation - Animation Editor for any theme

Extra Positions PRO, Custom JavaScript, Custom CSS and others


User avatar
Active Member

Posts

Joined
Thu Jan 08, 2015 12:17 pm


Post by fawadzia » Mon Jul 13, 2015 5:02 pm

I want to add DETAIL button on my site " http://94.136.40.103/~codeclean.co.uk/i ... ommon/home "

Can you please let me know how i can add Detail button in this site?

Thank you

Newbie

Posts

Joined
Wed Mar 25, 2015 6:11 pm
Who is online

Users browsing this forum: No registered users and 5 guests