Post by Wardy_118 » Wed Nov 21, 2018 7:32 am

I am using the location field to add an RRP price.

Having looked through the forum I have managed to add this to the product page without any issues but I also want this showing on the category page next to the price and I am struggling.

The Opencart version is 2.0.3.1.

If anyone can help or point me in the right direction that would be much appreciated.

New member

Posts

Joined
Tue Apr 13, 2010 5:50 pm

Post by IP_CAM » Wed Nov 21, 2018 8:45 am

in the THEME template/product/category.tpl File,
after:

Code: Select all

<h4><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></h4>
add:

Code: Select all

Product Location:  <strong><?php echo $product['location']; ?></strong><p>
and in the: catalog/controller/product/category.php File,
after:

Code: Select all

'thumb'       => $image,
add:

Code: Select all

'location'        => $result['location'],
And if you want it just above the price, you need to place it in the
category.tpl File just above:

Code: Select all

<?php if ($product['price']) { ?> 
Or then, create a simple OcMod or VqMod out of this above ... :D
AT LEAST, if the Variable LOCATION already exists in the Database Product Table,
which I don't recall momentarely. :'(
But I was too lazy, to check on this in a default DB, and/or get a proper translation
Code, and so hardcoded the Words Product Location in english words only.
Good Luck! ;)
Ernie
---
momentarely to be seen here:
http://www.gratisangebote.ch/shop/en/Co ... 25c30.html
---
Image

Attachments

add_product_location_to_category_oc_v2031.jpg

add_product_location_to_category_oc_v2031.jpg (61.5 KiB) Viewed 113 times


For Sale: Top URL's, including an OpenCart V-Pro Shop!
A wide range of matching Designs can be seen here: http://www.opencart.li
For Information on URL's offered, please contact me at: jti@jacob.ch
Hundreds of Mods in 380+ Repositories for OC v.1.5.x - v.2.3.x
to be found on my Github Site: https://github.com/IP-CAM
Image


User avatar
Legendary Member

Posts

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

Post by Wardy_118 » Wed Nov 21, 2018 5:09 pm

Thanks Ernie.

All is working now.

Before I added some of the code further down (after the special) the product array in the category controller file so I guess that is why it was not working.

Thanks again

New member

Posts

Joined
Tue Apr 13, 2010 5:50 pm
Who is online

Users browsing this forum: No registered users and 13 guests