Author Topic: ?clearCart=0 on the end of URL, how to remove?  (Read 5863 times)

scriner

  • Beginner
  • *
  • Posts: 33
  • A beginner
?clearCart=0 on the end of URL, how to remove?
« 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.

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 10882
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.8.8
Re: ?clearCart=0 on the end of URL, how to remove?
« Reply #1 on: August 12, 2022, 12:08:11 PM »
see answer to your other post
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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

  • Beginner
  • *
  • Posts: 38
  • A beginner
Re: ?clearCart=0 on the end of URL, how to remove?
« Reply #2 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

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 28746
  • Always on vacation
    • Jenkin Hill Internet
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

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

Currently using VirtueMart 4.2.5 10924 J! 3.10.11 PHP 8.2.7

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10663
  • VM4.0.232 Eagle Owl
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 4 on joomla 3
Re: ?clearCart=0 on the end of URL, how to remove?
« Reply #4 on: October 08, 2022, 22:53:03 PM »
Thank you jenkinhill
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

  • Beginner
  • *
  • Posts: 38
  • A beginner
Re: ?clearCart=0 on the end of URL, how to remove?
« Reply #5 on: November 04, 2022, 09:47:15 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

  • Jr. Member
  • **
  • Posts: 201
    • OCTeam
  • VirtueMart Version: 3.8.6
Re: ?clearCart=0 on the end of URL, how to remove?
« Reply #6 on: November 04, 2022, 11:04:11 AM »
Hi
in the meantime, if you want the rewrite for htaccess
Code: [Select]
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 + memcached + Opcode
VM Prod : 3.8.6 | VM Test : 4.0.12.10777

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 28746
  • Always on vacation
    • Jenkin Hill Internet
Re: ?clearCart=0 on the end of URL, how to remove?
« Reply #7 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.

Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

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

Currently using VirtueMart 4.2.5 10924 J! 3.10.11 PHP 8.2.7

Maurizio67

  • Beginner
  • *
  • Posts: 38
  • A beginner
Re: ?clearCart=0 on the end of URL, how to remove?
« Reply #8 on: November 04, 2022, 12:42:10 PM »
Thank you jenkinhill and thank you sirius


scriner

  • Beginner
  • *
  • Posts: 33
  • A beginner
Re: ?clearCart=0 on the end of URL, how to remove?
« Reply #9 on: November 29, 2022, 07:37:11 AM »
Hi
in the meantime, if you want the rewrite for htaccess
Code: [Select]
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

  • Jr. Member
  • **
  • Posts: 201
    • OCTeam
  • VirtueMart Version: 3.8.6
Re: ?clearCart=0 on the end of URL, how to remove?
« Reply #10 on: December 01, 2022, 09:25:21 AM »
Hi
try this one
Code: [Select]
RewriteCond %{QUERY_STRING} clearCart=0 [NC]
RewriteRule (.*) /$1? [R=302,L]
J3.10.12 | PHP 7.4.33 + APC + memcached + Opcode
VM Prod : 3.8.6 | VM Test : 4.0.12.10777

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10663
  • VM4.0.232 Eagle Owl
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 4 on joomla 3
Re: ?clearCart=0 on the end of URL, how to remove?
« Reply #11 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.
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

  • Beginner
  • *
  • Posts: 33
  • A beginner
Re: ?clearCart=0 on the end of URL, how to remove?
« Reply #12 on: December 06, 2022, 11:12:26 AM »
Hi
try this one
Code: [Select]
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

  • Beginner
  • *
  • Posts: 33
  • A beginner
Re: ?clearCart=0 on the end of URL, how to remove?
« Reply #13 on: December 06, 2022, 11:21:56 AM »
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

  • Beginner
  • *
  • Posts: 3
  • A beginner
Re: ?clearCart=0 on the end of URL, how to remove?
« Reply #14 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?