Page 1 of 1

Products Module - URL Slug

Posted: Sat Jul 07, 2018 1:24 am
by gnegne74
Hello to all, I'm using Products module 2.28.4 on cmsms 2.2.7
I'm tryin to use URL SLug Template but I' have some issues.
I set hierarchy and category for each item.
It works if I insert:
- {$name}
- {$hierarchy}/{$name}
- {$hierarchy3}/{$name}
and similar....
but If I use
- {$first_category}/{$name} : only "Name" part is filled.
- {$first_category} : the URL Slug remain empty, it seems doesn't catch that data in any manner
or
{$category_parts[0]}/{$name} : I get an error "Undefined offset"
How can I put category name into URL Slug?
i'm driving nuts!
thank you for support

Re: Products Module - URL Slug

Posted: Sat Jul 07, 2018 6:12 am
by Rolf
Untested, you should probably need to do something like
{$category_parts[0]['name']}

Re: Products Module - URL Slug

Posted: Sat Jul 07, 2018 10:15 am
by gnegne74
Thanks but it doesn't works.
After some test I've noticed that issue is related to "category" field. Syntax seems ok.
If I write
{$hier_parts[1]}
I catch the expected sublevel of the first hierarchy item (i.e. subcategory1, child of category1)

If I apply the same syntax logic to
$category_parts
and I write
{$category_parts[0]} or {$category_parts[1]}
I get an error.

Trying with
$first_category
(that variable is not an array) I get an empty value.
{$first_category}/{$name} -> returns only "name"

It's very strange. I've seen this behaviour in previous versions too.

Anyone use in right mode URL Slug with category name?

Re: Products Module - URL Slug

Posted: Mon Jul 09, 2018 10:22 pm
by gnegne74
Does anybody have a solution? Or a working example?

Re: Products Module - URL Slug

Posted: Mon Jul 16, 2018 10:46 pm
by gnegne74
Maybe I've found a code error into action.admin_ajax_getslug.php on row 78:
there's a variable array $callcats, but in other row is referred as $allcats (without initial "c"). It's a typo?
Unfortunately after doing a correction the URL slug still doesn't work