VirtueMart Forum

VirtueMart 2 + 3 + 4 => Security (https) / Performance / SEO, SEF, URLs => Topic started by: scriner on August 11, 2022, 19:06:02 PM

Title: ?clearCart=0 on the end of URL, how to remove?
Post by: scriner on August 11, 2022, 19:06:02 PM
Hello.

In J3+VM4 had no problems, but after upgrade to J4, I have got tail of URL on every menu item (VM category type) - ?clearCart=0.

I tryed to change state of option in menu item settings but it changes only between ?clearCart=0 and ?clearCart=1.

Now I have URL like website.com/category?clearCart=0 and I need only website.com/category

Please, anybody say how to remove ?clearCart=0 from URL?

I don't understand, why ?clearCart=0 is needed at all.
Title: Re: ?clearCart=0 on the end of URL, how to remove?
Post by: GJC Web Design on August 12, 2022, 12:08:11 PM
see answer to your other post
Title: Re: ?clearCart=0 on the end of URL, how to remove?
Post by: Maurizio67 on October 04, 2022, 23:43:35 PM
Hello,
searching for "clearCart=0" I found this thread that ends with GJC Web Design inviting to read somewhere else... but I can't find any other answer.
Perhaps the solution is written but I can't find it.

Is there a way to remove the URL termination (clearCart=0)?

Thanks in advance.
Maurizio

VirtueMart 4.0.7 10701
J4.2.2
Title: Re: ?clearCart=0 on the end of URL, how to remove?
Post by: jenkinhill on October 05, 2022, 11:22:40 AM
GJC wrote   http://forum.virtuemart.net/index.php?topic=148714.msg530703#msg530703
Title: Re: ?clearCart=0 on the end of URL, how to remove?
Post by: Milbo on October 08, 2022, 22:53:03 PM
Thank you jenkinhill
Title: Re: ?clearCart=0 on the end of URL, how to remove?
Post by: Maurizio67 on November 04, 2022, 09:47:15 AM
Quote from: jenkinhill on October 05, 2022, 11:22:40 AM
GJC wrote   http://forum.virtuemart.net/index.php?topic=148714.msg530703#msg530703
Hello jenkinhill, I see your reply to my question but I don't get the meaning.
Your quote brings to a topic that invites to be patient about the routing and be careful to mention the exact VM version when posting question.
Since I did the last one, I guess you mean the first one (I have to be patient).

Ok, but... how will I know when is this fixed?

Thanks in advance
Maurizio
Title: Re: ?clearCart=0 on the end of URL, how to remove?
Post by: sirius on November 04, 2022, 11:04:11 AM
Hi
in the meantime, if you want the rewrite for htaccess
RewriteCond %{QUERY_STRING} "clearCart=" [NC]
RewriteRule (.*) /$1? [R=301,L]

but this will certainly invalidate the empty basket function if you are in a category.
Title: Re: ?clearCart=0 on the end of URL, how to remove?
Post by: jenkinhill on November 04, 2022, 11:07:30 AM
I intend to wait at least another year for J4 to be fixed as J3 works perfectly well for me and will most likely do so for years to come.

Best approach to find out when/if your VM on J4 router issue is fixed is to test new development versions as they are released, eg VM from http://dev.virtuemart.net/projects/virtuemart/files  and Joomla from https://downloads.joomla.org/latest

You can also check the revision comments on http://dev.virtuemart.net/projects/virtuemart/repository  - although the comments don't list all changes.

Title: Re: ?clearCart=0 on the end of URL, how to remove?
Post by: Maurizio67 on November 04, 2022, 12:42:10 PM
Thank you jenkinhill and thank you sirius

Title: Re: ?clearCart=0 on the end of URL, how to remove?
Post by: scriner on November 29, 2022, 07:37:11 AM
Quote from: sirius on November 04, 2022, 11:04:11 AM
Hi
in the meantime, if you want the rewrite for htaccess
RewriteCond %{QUERY_STRING} "clearCart=" [NC]
RewriteRule (.*) /$1? [R=301,L]

but this will certainly invalidate the empty basket function if you are in a category.

After some time I returned to this issue and see that nothing changed.

Joomla ‎4.2.5‎ / VirtueMart 4.0.8 10748

when I add this to htaccess it redirects any page to index.php

rewrite mode is on, no other changes in htaccess. I am checking it on really clear website, J+VM instaled from blank.

may be you know another way to fix it?
Title: Re: ?clearCart=0 on the end of URL, how to remove?
Post by: sirius on December 01, 2022, 09:25:21 AM
Hi
try this one
RewriteCond %{QUERY_STRING} clearCart=0 [NC]
RewriteRule (.*) /$1? [R=302,L]
Title: Re: ?clearCart=0 on the end of URL, how to remove?
Post by: Milbo on December 04, 2022, 20:02:33 PM
as I already wrote in another thread. I am happy if someone can explain me, why it sometimes appears, or not. We never need clearCart=0 for example. We only need clearCart=1.
Title: Re: ?clearCart=0 on the end of URL, how to remove?
Post by: scriner on December 06, 2022, 11:12:26 AM
Quote from: sirius on December 01, 2022, 09:25:21 AM
Hi
try this one
RewriteCond %{QUERY_STRING} clearCart=0 [NC]
RewriteRule (.*) /$1? [R=302,L]


Didn't helped. It just become to redirect to index.php from any page. Only browser cache cleaning helpen to return.
Title: Re: ?clearCart=0 on the end of URL, how to remove?
Post by: scriner on December 06, 2022, 11:21:56 AM
Quote from: Milbo on December 04, 2022, 20:02:33 PM
as I already wrote in another thread. I am happy if someone can explain me, why it sometimes appears, or not. We never need clearCart=0 for example. We only need clearCart=1.

For find reason I made clean install of J+VM.

J 4.2.5, VM / 4.0.8 10748 / PHP 8.0

I just restored database for products and categories and added menu item as VM category. Now I still have ?clearCart=0 in URL.
Title: Re: ?clearCart=0 on the end of URL, how to remove?
Post by: l_hendriksen on December 10, 2022, 13:07:58 PM
I am wondering as well why that clearcart=0 is added to the URL. My provider wants all websites to go to PHP 8.1 since the websites are still on 7.4 and that clearcart is giving me a problem.

I have two websites with both Joomla 3.10.11 and VirtueMart 4.0.6 10690

The link in the first website is like this:
index.php?option=com_virtuemart&view=category&virtuemart_category_id=172&virtuemart_manufacturer_id=0

And the other one is like this:
index.php?option=com_virtuemart&view=category&virtuemart_category_id=9&virtuemart_manufacturer_id=0&clearCart=0

They are both operating fine with PHP 7.4 but once I switch to PHP 8.1 then the first keeps operating fine while the other website (with the clearcart in the link) throws this error: Unknown named parameter $title

Does anyone know which setting in VirtueMart is causing it to be added to the link?

Title: Re: ?clearCart=0 on the end of URL, how to remove?
Post by: jenkinhill on December 10, 2022, 13:32:44 PM
Maybe time to test with the latest release, VM 4.0.10, which has many fixes, including for PHP8+

http://dev.virtuemart.net/attachments/download/1355/com_virtuemart.4.0.10.10767_package_or_extract.zip
Title: Re: ?clearCart=0 on the end of URL, how to remove?
Post by: pinochico on December 10, 2022, 21:57:36 PM
Hmm, I am wondering that the hosting provider determines if a PHP upgrade is done or not.
He will pay to upgrade the whole eshop?
Title: Re: ?clearCart=0 on the end of URL, how to remove?
Post by: jenkinhill on December 11, 2022, 12:13:54 PM
Quote from: pinochico on December 10, 2022, 21:57:36 PM
Hmm, I am wondering that the hosting provider determines if a PHP upgrade is done or not.
He will pay to upgrade the whole eshop?

Does not bother me as I have a good host with a muti-version PHP manager for each domain which I control. Any main release between 5.6 and 8.2.
Title: Re: ?clearCart=0 on the end of URL, how to remove?
Post by: pinochico on December 11, 2022, 22:54:31 PM
QuoteDoes not bother me as I have a good host with a muti-version PHP manager for each domain which I control. Any main release between 5.6 and 8.2.

Yes, we have own dedicated server with some configuration - multiple PHP for every domain between 5.6 and 8.2 too.
Games from external hosting are ended before 12 years :D