- Posts: 3
- Thank you received: 0
product_url in listing_img_desc.php view
14 years 10 months ago - 14 years 10 months ago #31342
by gareth
product_url in listing_img_desc.php view was created by gareth
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
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: 14 years 10 months ago by gareth.
Please Log in or Create an account to join the conversation.
14 years 10 months ago #31364
by nicolas
Replied by nicolas on topic Re: product_url in listing_img_desc.php view
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.
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.
14 years 10 months ago #31397
by gareth
Replied by gareth on topic Re: product_url in listing_img_desc.php view
That worked. Thank you!
Please Log in or Create an account to join the conversation.
Time to create page: 0.149 seconds