Stupid question on product alias

  • Posts: 78
  • Thank you received: 5
  • Hikashop Business
11 years 10 months ago #82860

I apologize in advance, because I'm sure it's easy, but I just can't find the answer...

How do you set the alias for the product? It seems to be dynamically set by the title, but our processes change the name of our products after a set period of time (We sell event registrations, so the title changes after the event has initially run). But when I do that, the alias changes. Any help?

Thanks!

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

  • Posts: 26152
  • Thank you received: 4027
  • MODERATOR
11 years 10 months ago #82974

Hi,

What do you called "product alias" ?
Products have a product code which is automatically generated by HikaShop is empty but it could be change in the product editing page.
In the left column, you would see the option "Code" (just before "tax category", "brand"... quantity, etc).

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: 78
  • Thank you received: 5
  • Hikashop Business
11 years 10 months ago #82986

I see the product code, but as far as I can tell, it does not change the main URL of the product. In other words, when I'm clicking through my shop, the URL that is used for the products does not seem to be derived from the "Code" field - they are still using the URL structure from the product title.

I want to find out if Hikashop uses an alias like the core joomla articles does.

Does that make sense?

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

  • Posts: 82817
  • Thank you received: 13357
  • MODERATOR
11 years 10 months ago #83015

Products don't have an alias for the URL like articles. The text in the URL directly comes from the product name.

It's not easy to change. You would have to create a custom field of the table "product" in order to enter the alias for each product and then change the code:
stringURLSafe(strip_tags($element->product_name))
in the different files of HikaShop and replace product_name by the column name of your custom product field.
The main file where to change that is components/com_hikashop/views/product/view.html.php but it is at several places, including other files, and not always with the same $element variable name...

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

  • Posts: 78
  • Thank you received: 5
  • Hikashop Business
11 years 10 months ago #83057

Thanks for the update, Nicolas. Would love to see this feature in a later version.

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

  • Posts: 36
  • Thank you received: 6
11 years 10 months ago #83328

This isn't a stupid question. And this is certainly an important feature for SEO and should be a high priority.

I have been very careful to craft my product codes into meaningful aliases and am very surprised and disappointed there is not an option to use them in the url.

Please consider some sort of alias support as a feature in the near future.

Thanks!

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

  • Posts: 82817
  • Thank you received: 13357
  • MODERATOR
11 years 10 months ago #83634

It's in the TODO list.

Usually, product names should be perfect for SEO...

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

  • Posts: 36
  • Thank you received: 6
11 years 10 months ago #83756

Glad to hear this will be officially supported soon.

In some quick testing, it appears that everything after the product id in the url is ignored. Therefore, I should be able to make changes to URL with very little danger of breaking anything. Is this true?

I have attached a grep of the locations where the alias is computed from the product_name. Is it safe to simply change all these locations to use product_code instead of name? Changes in the cart and plugins concern me a little.

Sure will be nice once this alias code is consolidated some place :)

Thanks for all your help!

Attachments:

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

  • Posts: 36
  • Thank you received: 6
11 years 10 months ago #84562

Hello? Can I get some help here? I can figure out the changes, but want to make sure something unexpected isn't going to bite me.

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

  • Posts: 82817
  • Thank you received: 13357
  • MODERATOR
11 years 10 months ago #85193

Hi,

Indeed, the places that you found in your grep is where you should change the product_name to the product_code if you want the code instead of the name of the product in the URL.
There shouldn't be any surprise if you change the product_name by product_code there.

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

Time to create page: 0.068 seconds
Powered by Kunena Forum