Hi dear ;
If we search for a item or if we click a category the querystring of the urls get passed on to all products listed which seems to make the URLS on the page look odd.
Eg:if i search fruit
?keyword=fruit should get assigned only to the advanced search page link but it gets assigned to the products too-
https://phoenixcart.org/demo/advanced_s ... ords=fruit
Same for the category page the cPath gets assigned as a querystring to all products-
Like in demo- Each product URL has the cPath
https://phoenixcart.org/demo/index.php?cPath=1_3
Please can you help fix this issue??
Thank you in advance;
Very Warm Regds./
radhavallabh
Query Strings of a category index or advanced search page
-
radhavallabh
- Senior Contributor
- Posts: 466
- Joined: Tue Oct 27, 2020 4:09 am
- Phoenix Version: 1.1.0.6
- Has thanked: 29 times
- Been thanked: 3 times
-
ecartz
- Core Team
- Posts: 3084
- Joined: Tue Nov 05, 2019 6:02 pm
- Phoenix Version:
- Has thanked: 4 times
- Been thanked: 208 times
Re: Query Strings of a category index or advanced search page
If you want to change the product listing template links, override the product listing template and change line 62: https://github.com/CE-PhoenixCart/Phoen ... ng.php#L62
E.g.would have no extra query parameters.
Note that if you do this, some breadcrumb links will then be broken, as they won't know the previous links to show.might be somewhat better.
E.g.
Code: Select all
$listing['link'] = Product::build_link($listing['products_id'], []);Note that if you do this, some breadcrumb links will then be broken, as they won't know the previous links to show.
Code: Select all
$listing['link'] = Product::build_link($listing['products_id'], [])->retain_query_except(['keyword', 'cPath']);-
radhavallabh
- Senior Contributor
- Posts: 466
- Joined: Tue Oct 27, 2020 4:09 am
- Phoenix Version: 1.1.0.6
- Has thanked: 29 times
- Been thanked: 3 times
Re: Query Strings of a category index or advanced search page
Hi dear;ecartz wrote: ↑Mon Aug 01, 2022 10:18 am If you want to change the product listing template links, override the product listing template and change line 62: https://github.com/CE-PhoenixCart/Phoen ... ng.php#L62
E.g.would have no extra query parameters.Code: Select all
$listing['link'] = Product::build_link($listing['products_id'], []);
Note that if you do this, some breadcrumb links will then be broken, as they won't know the previous links to show.might be somewhat better.Code: Select all
$listing['link'] = Product::build_link($listing['products_id'], [])->retain_query_except(['keyword', 'cPath']);
Code: Select all
$listing['link'] = Product::build_link($listing['products_id'], [])->retain_query_except(['keywords', 'cPath']);Thank you so much!!!
Very warm Regds./
radhavallabh