product_url not populated
13 years 3 weeks ago #129071
by DeeEmm
product_url not populated was created by DeeEmm
I'm putting together a Jomsocial plugin to display Hikamarket activity on the Jomsocial activity stream.
When products are added or edited I want to link back to the product from the activity. The issue I am facing is that the 'product_url' field is blank and so I am not able to form the link to the product. The product_canonical is also blank but I understand that this field is manually entered and I am not using it
Is it normal that the product_url field is blank?
Is there an easy method available for url creation?
/DM
TIA
/DM
When products are added or edited I want to link back to the product from the activity. The issue I am facing is that the 'product_url' field is blank and so I am not able to form the link to the product. The product_canonical is also blank but I understand that this field is manually entered and I am not using it
Is it normal that the product_url field is blank?
Is there an easy method available for url creation?
/DM
TIA
/DM
Please Log in or Create an account to join the conversation.
13 years 3 weeks ago #129086
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic product_url not populated
Hi,
"product_url" is also something that the user can enter in the product edition page.
Please explain me what you want to retrieve exactly.
Regards,
"product_url" is also something that the user can enter in the product edition page.
Please explain me what you want to retrieve exactly.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
13 years 3 weeks ago #129091
by DeeEmm
Replied by DeeEmm on topic product_url not populated
Ahh OK.
I disabled most of the non product related fields from the usermarket edition as it is just something else that they could break.
My reason for wanting the URL is as follows...
In the JomSocial activity stream the activities are reported like this...
" DeeEmm uploaded a new product ProductName "
I want 'ProductName' to link to the product page
You can see an example here - fizzfab.com/community (I'm testing it at the moment)
I'm using the onAfterProductCreate and onAfterProductUpdate methods in the plugin to trigger the Jomsocial stream API to create the activities.
Wondering why I could not get the url from the product listing I checked the database and found that the product_url fields were blank. I guessed that this was either normal or perhaps I had disabled a setting somewhere.
I've added a workaround by using the non SEF url
eg ?option=com_hikashop&ctrl=product&task=show&cid=$product->product_id
This works fine but I would prefer to use the SEF version.
Do you know if there are any methods available to the plugin to create the SEF url?
/DM
I disabled most of the non product related fields from the usermarket edition as it is just something else that they could break.
My reason for wanting the URL is as follows...
In the JomSocial activity stream the activities are reported like this...
" DeeEmm uploaded a new product ProductName "
I want 'ProductName' to link to the product page
You can see an example here - fizzfab.com/community (I'm testing it at the moment)
I'm using the onAfterProductCreate and onAfterProductUpdate methods in the plugin to trigger the Jomsocial stream API to create the activities.
Wondering why I could not get the url from the product listing I checked the database and found that the product_url fields were blank. I guessed that this was either normal or perhaps I had disabled a setting somewhere.
I've added a workaround by using the non SEF url
eg ?option=com_hikashop&ctrl=product&task=show&cid=$product->product_id
This works fine but I would prefer to use the SEF version.
Do you know if there are any methods available to the plugin to create the SEF url?
/DM
Please Log in or Create an account to join the conversation.
13 years 3 weeks ago #129092
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic product_url not populated
Hi,
To create a SEF url, you need an "itemId" (a menu id) in order to create a nice url (and associate it to a menu).
There is no one unique SEF url, it always depends on your menu.
So you can create a SEF link with
You can also use " JRoute::_() " with full url (index.php?option...).
Regards,
To create a SEF url, you need an "itemId" (a menu id) in order to create a nice url (and associate it to a menu).
There is no one unique SEF url, it always depends on your menu.
So you can create a SEF link with
Code:
hikashop_completeLink('product&task=show&cid=' . $product->product_id . '&itemId=' . $my_item_id):
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
The following user(s) said Thank You: DeeEmm
Please Log in or Create an account to join the conversation.
Moderators: Obsidev
Time to create page: 0.198 seconds