?clearCart=0 on the end of URL, how to remove?

Started by scriner, August 11, 2022, 19:06:02 PM

Previous topic - Next topic

scriner

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.

GJC Web Design

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Maurizio67

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

jenkinhill

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Maurizio67

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

sirius

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.
J3.10.12 | PHP 7.4.33 + APC + Opcode
VM Prod : 3.8.6 | VM Test : 4.4.0.11095

jenkinhill

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.

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Maurizio67


scriner

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?

sirius

#10
Hi
try this one
RewriteCond %{QUERY_STRING} clearCart=0 [NC]
RewriteRule (.*) /$1? [R=302,L]
J3.10.12 | PHP 7.4.33 + APC + Opcode
VM Prod : 3.8.6 | VM Test : 4.4.0.11095

Milbo

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.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

scriner

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.

scriner

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.

l_hendriksen

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?