Add-to-cart as link

If you are runnig Joomla 3.x and Virtuemart 3.x please post to this forum your questions or support tickets about One Page Checkout

Add-to-cart as link

Postby a.chess@.....it » Thu Sep 03, 2020 7:55 am

Hello
I have activated "add to cart as link", as explained in this link

https://www.rupostel.com/one-page-check ... -as-a-link

but it doesn't work with the latest versions of Virtuemart(VirtueMart 3.8.4 10335) and Onepage ( 2.0.400.170720)

am I wrong?

or

is it a problem to be solved?

thank you
a.chess@.....it
 
Posts: 3
Joined: Thu Sep 03, 2020 7:47 am

Re: Add-to-cart as link

Postby admin » Mon Sep 07, 2020 11:35 am

hello, i would need to check your site particularly as i just tested this (on VirtueMart 3.8.0 10324 + VirtueMart 3.8.5 10337) and i don't see any problem with the feature. the feature uses VM core "add to cart" function and thus it should be forward-compatible with VM versions.

let me know by email - pls send me what URL you are using for the add to cart.

thank you, best regards, stan, rupostel.com
admin
Site Admin
 
Posts: 2715
Joined: Wed Jan 06, 2010 11:43 pm

Re: Add-to-cart as link

Postby a.chess@.....it » Fri Sep 11, 2020 7:46 am

Hello
my mistake !!

the test site was in a test subfolder ...

When I created the link it was pointing to the main site ....

and then the empty cart came out ...

I think because the functionality was not active in rupostel

So everything works perfectly fine.

Thanks for your answer.
a.chess@.....it
 
Posts: 3
Joined: Thu Sep 03, 2020 7:47 am

Re: Add-to-cart as link

Postby admin » Wed Oct 07, 2020 8:02 pm

hello, no problem,
you can also alter "article above basket" per this feature OR autocoupon per this feature if needed.

best regards, stan
admin
Site Admin
 
Posts: 2715
Joined: Wed Jan 06, 2010 11:43 pm

Re: Add-to-cart as link

Postby d0ublezer0 » Sat Oct 04, 2025 10:00 pm

Hi. Unfortunately, I wasn’t able to use the “Add to cart as link” function in VirtueMart 4 + Joomla 4.
Calling the link does not add products to the cart, even though this option is enabled in the OPC settings.

I ended up with a link like this:

/index.php?option=com_virtuemart&page=shop.cart&add_id[]=2294&quadd_2294=3&add_id[]=3466&quadd_3466=1


But it doesn’t work — nothing happens.
What am I doing wrong? Could it be that in VirtueMart 4 the link format is different? I couldn’t find anything about such changes in the documentation.
d0ublezer0
 
Posts: 16
Joined: Tue Mar 24, 2015 9:26 am

Re: Add-to-cart as link

Postby d0ublezer0 » Mon Oct 06, 2025 9:00 pm

So, here's the workaround I came up with:

components/com_onepage/helpers/addtocartaslink.php
around line 286
Code: Select all
if (defined('VM_VERSION') && (VM_VERSION >= 3)) {
//, add this:
      foreach ($newp as $p) {
        $post['quantity'][$p] = $post['quadd_' . $p];
      }
....
and change
      $rr = $ref->cart->add($newp);
to
      $rr = $ref->cart->add($newp, $post);

   
d0ublezer0
 
Posts: 16
Joined: Tue Mar 24, 2015 9:26 am


Return to One Page Checkout for Virtuemart 3 on Joomla 3.x