How to assign the url of product page

  • Posts: 107
  • Thank you received: 1
11 years 10 months ago #82270

Hi there,

I realized that the url of product page reflects the "product_id".

If I hope the url reflects the "product title", such like: "mydomain.com/product/product_title"

How can I do that? Any code I should adjust?

Thank you so much. :)

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

  • Posts: 13201
  • Thank you received: 2322
11 years 10 months ago #82434

Hi,

By default you should have the product id and the product name. Like '1132-myProduct'.
Are you using a component to manage the sef of your Joomla ?

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

  • Posts: 107
  • Thank you received: 1
11 years 10 months ago #82521

Hi there,

Yes I do see a dash like "product_id-".

But there is nothing behind the dash.

I guess maybe it's because my product name is in Traditional CHinese?

Did you test if it works for chinese name too?

Thank you for the reply. :)

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

  • Posts: 13201
  • Thank you received: 2322
11 years 10 months ago #82563

Hi,

Yes the problem is due to the Traditional Chinese, I just tried on my end and I have the same problem.
It come from Joomla which did not support UTF-8 before J2.5.

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

  • Posts: 107
  • Thank you received: 1
11 years 10 months ago #82570

Dear,

Is it possible to make the url containing the product_code rather than product_id?

Thank you. :)

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

  • Posts: 13201
  • Thank you received: 2322
11 years 10 months ago #82622

The product id is usefull to redirect the customer to the good page :)
Whet you can do is set the product name instead of the product alias for the url.

Try to replace the code:

$link = hikashop_completeLink('product&task=show&cid='.$this->row->product_id.'&name='.$this->row->alias.$this->itemid.$this->category_pathway);
By:
if(empty($this->row->alias))$this->row->alias = urlencode(strip_tags($this->row->product_name));
$this->row->alias2 = $this->row->alias;
$link = hikashop_completeLink('product&task=show&cid='.$this->row->product_id.'&name='.$this->row->alias.$this->itemid.$this->category_pathway);
$this->row->alias = $this->row->alias2;

in the view "product / listing_img_title" (or another depending on which listing you are using), you can edit this view in "HikaShop > Display > views".

Last edit: 11 years 10 months ago by Xavier.
The following user(s) said Thank You: tinachou

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

  • Posts: 107
  • Thank you received: 1
11 years 10 months ago #82642

Dear,

You are my savior!

It works. I adjusted the code in product/listing_img.

Thank you. :kiss:

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

Time to create page: 0.051 seconds
Powered by Kunena Forum