product_url in listing_img_desc.php view

  • Posts: 3
  • Thank you received: 0
12 years 11 months ago #31342

Hi, firstly thanks for the excellent component. I love how configurable it is. I'm pretty certain it's perfect for the type of site I want to build, I just have one issue I can't seem to resolve myself.

I've been editting the listing_img_desc.php view and I'd like to add the Manufacturer URL, but I can't seem to get the actual url to appear. I've added the following code to that view... (I pulled this from the product "show" view)

<?php
echo JText::sprintf('MANUFACTURER_URL','<a href="'.$this->element->product_url.'" target="_blank">'.$this->element->product_url.'</a>');
?>

I've searched through the forums for a solution and in one previous post you mentioned that the data may need to be loaded for this to work...

www.hikashop.com/support/forum/4-how-to/...-after-purchase.html

You might have to load the data of the product:
$p = hikashop::get('class.product');
$data = $p->get($product->product_id);

and then use $data instead of $product in your code.


Is this what I'm missing??

You can see what I'm trying to do here...

www.twentyisplenty.com/

Thank you for your help!!

Gareth

Last edit: 12 years 11 months ago by gareth.

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
12 years 11 months ago #31364

Hi,

in listing_img_desc, the data of the product is in $this->row so you should use $this->row instead of $this->element in your code.

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

  • Posts: 3
  • Thank you received: 0
12 years 11 months ago #31397

That worked. Thank you!

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

Time to create page: 0.040 seconds
Powered by Kunena Forum