- Posts: 6
- Thank you received: 0
Link function for product item
10 years 11 months ago #216623
by solrac
Link function for product item was created by solrac
-- HikaShop version -- : 2.6.0
Hello,
I am a developer and I am creating a module to use a gallery images of products.
The images are ok for the module but I can't find the function to associate the correct link
I see several $this->getlink( on files but I can't find where is this function and I can't call it as it is inside the module.
Can anyone help me out how to create the correct link for products?
What files I need to include, the query I need and the function to use.
Thanks and regards
Hello,
I am a developer and I am creating a module to use a gallery images of products.
The images are ok for the module but I can't find the function to associate the correct link
I see several $this->getlink( on files but I can't find where is this function and I can't call it as it is inside the module.
Can anyone help me out how to create the correct link for products?
What files I need to include, the query I need and the function to use.
Thanks and regards
Please Log in or Create an account to join the conversation.
10 years 11 months ago #216637
by nicolas
Replied by nicolas on topic Link function for product item
Hi,
So, suppose that your product data is an object in the variable $product.
You can use such code:
So, suppose that your product data is an object in the variable $product.
You can use such code:
Code:
include_once(rtrim(JPATH_ADMINISTRATOR,DIRECTORY_SEPARATOR).'/components/com_hikashop/helpers/helper.php'); //load the main helper of HikaShop
$Itemid = XXX; //where XXX is the id of a product/category listing menu item
$productClass = hikashop_get('class.product');
$productClass->addAlias($product);
echo hikashop_contentLink('product&task=show&cid='.$product->product_id.'&name='.$product->alias.$Itemid, $product);
The following user(s) said Thank You: solrac
Please Log in or Create an account to join the conversation.
Time to create page: 0.144 seconds