product_url not populated

  • Posts: 114
  • Thank you received: 14
10 years 5 months ago #129071

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

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
10 years 5 months ago #129086

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,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 114
  • Thank you received: 14
10 years 5 months ago #129091

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 - http://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.

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
10 years 5 months ago #129092

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

hikashop_completeLink('product&task=show&cid=' . $product->product_id . '&itemId=' . $my_item_id):
You can also use " JRoute::_() " with full url (index.php?option...).

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
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.067 seconds
Powered by Kunena Forum