Jump to content

Custom Url must be {id}-{rewrite}


Recommended Posts

Hi everybody;

 

I found a bug of prestashop but nobody answered me. 

When you make a custom url  for categories like {id}/{rewrite}, breadcrumb doesn't work properly on product pages. It always show default category.

 

It is the report page of this bug: http://forge.prestashop.com/browse/PSCFV-10313

 

Why I can't use "/" instead of "-" Why I can't prepend or append anything to {id}?

 

Are there some rules to create these custom urls?

Link to comment
Share on other sites

I found the reason. The reason is preg_match in controllers/productcontroller on row 144. It works with "-".

 

preg_match('!^(.*)\/([0-9]+)\-(.*[^\.])|(.*)id_category=([0-9]+)(.*)$!', $_SERVER['HTTP_REFERER'], $regs)

 

You can see the structure of regular expression here: https://www.debuggex.com/r/6eRU9tSphDvY9Pzu

 

If you change this regular expression you can do whatever you want.

Link to comment
Share on other sites

×
×
  • Create New...