Remove '/component/phocacart/' from search/query url

Phoca Cart - complex e-commerce extension
User avatar
dmlwebal
Phoca Enthusiast
Phoca Enthusiast
Posts: 92
Joined: 18 Sep 2019, 12:49

Remove '/component/phocacart/' from search/query url

Post by dmlwebal » 13 Jul 2020, 19:48

Joomla 3.9.19
PHP 7.4.7
Phoca Cart 3.5.2
Premiere Gantry 5 Template

Hi,

I'm sure this has been asked before but cannot find the answer via forum search.

I need to 'change' the way that the url is formed for my site search, specifically this part of the url:

[domain]/component/phocacart/{search query}

It is only visible when I use the Search Module or the links from the Phoca Cart Brands Module
There is no way that the Joomla router can mask these urls in the same way as regular menu items, but I notice that the search result url is formed without the component or component name in the url on the demo site:

https://www.phoca.cz/phocacartdemo/

If you enter a term in the search module here, the url is e.g. https://www.phoca.cz/phocacartdemo/items?search=audi

I cannot think how to mimic this shorter version without resorting to creating xml files as per the Joomla docs. Or is that the only solution?

I just prefer not to 'broadcast' any obvious ways of hacking the cart software, and it looks more professional in the shorter 'demo' site style.

Thanks :)

Tags:

User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 42734
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Remove '/component/phocacart/' from search/query url

Post by Jan » 15 Jul 2020, 15:10

Hi, in fact, routing has nothing to do with the component but with CMS itself. The format of url is made by Joomla! menu link. When you have component/phocacart in your url, this mostly means, the link to Phoca Cart in Joomla! menu link manager was not done. If yes, then some Joomla! routing feature is broken on your site. :idea:

Jan
If you find Phoca extensions useful, please support the project

User avatar
dmlwebal
Phoca Enthusiast
Phoca Enthusiast
Posts: 92
Joined: 18 Sep 2019, 12:49

Re: Remove '/component/phocacart/' from search/query url

Post by dmlwebal » 15 Jul 2020, 16:53

Hi Jan

Yes, I see what you mean.
So did you create search links in your menu on the demo site?

Regards
David

User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 42734
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Remove '/component/phocacart/' from search/query url

Post by Jan » 16 Jul 2020, 17:49

Hi, no, I just created one menu link to Phoca Cart - in this case to phoca cart items view. Such is then taken as a base for creating all Phoca Cart links.

Jan
If you find Phoca extensions useful, please support the project

User avatar
dmlwebal
Phoca Enthusiast
Phoca Enthusiast
Posts: 92
Joined: 18 Sep 2019, 12:49

Re: Remove '/component/phocacart/' from search/query url

Post by dmlwebal » 19 Jul 2020, 11:39

Hi Jan

Thanks, that is what I have missed.
:)
David

User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 42734
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Remove '/component/phocacart/' from search/query url

Post by Jan » 27 Jul 2020, 22:01

Ok
If you find Phoca extensions useful, please support the project

Post Reply