Ultimate SEO Urls

Remove cpath - Ultimate SEO Urls

Remove cpath

by mhsuffolk » Sat Mar 11, 2023 4:09 pm

App version 3.0.4 Phoenix 1.0.8.4 PHP 7.4
In the readme.html included with the app there is an option in the instructions to "Add cPath to product URLs"
However in Admin->Configuration->USU no such option exists.
My test shop and live shop both display the cpath in their URLs,
I would like them removed, is this possible?
Martin
Live shop Phoenix 1.0.9.0 on PHP 8.0
User avatar
mhsuffolk
VIP Member
VIP Member
Posts: 146
Joined: Sat Oct 26, 2019 9:13 am
Contact:

Re: Remove cpath

by Piernas » Sun Mar 12, 2023 12:02 am

Yes, there is a way - I removed the option but kept cPath instead of removing it. Change line 141 of includes\apps\ultimate_seo_urls\page_modules\product_info.php from

Code: Select all

      $extract =  array( 'manufacturers_id'); // removes manufacturers_id
to

Code: Select all

      $extract =  ['cPath', 'manufacturers_id']; // removes cPath and manufacturers_id
I'll make it default for future versions.
Piernas
Posts: 96
Joined: Thu Mar 11, 2021 2:16 am
Contact:

Re: Remove cpath

by Piernas » Sun Mar 12, 2023 12:10 am

I have also noticed that category listing also introduces 'sort' query when acessing a product. For removing it the word can be added to the extract array, too:

Code: Select all

      $extract =  ['cPath', 'manufacturers_id', 'sort']; // removes cPath and manufacturers_id
Piernas
Posts: 96
Joined: Thu Mar 11, 2021 2:16 am
Contact:

Re: Remove cpath

by mhsuffolk » Sun Mar 12, 2023 8:42 am

Excellent, thank you. That has worked. I prefer a nice clean URL without the cpath and sort. Punters can now see the important info, IMO the cpath and sort are not required to be visible.
Live shop Phoenix 1.0.9.0 on PHP 8.0
User avatar
mhsuffolk
VIP Member
VIP Member
Posts: 146
Joined: Sat Oct 26, 2019 9:13 am
Contact: