Add a coupon to the cart using a link (virtuemart + joomla)


  • Default avatar
    nicolò    
     4 years ago
    0

    Hi,

     I need to have a syntax for a link that add a product and his related coupon all in one.

    For the first part I made it and it's:

    https://doman.ext/index.php?option=com_virtuemart&view=cart&task=add&virtuemart_product_id[]=1&quantity[]=1


    but i can't find the sintax for a coupon, I try with this:

    https://doman.ext/index.php?option=com_virtuemart&view=cart&task=add&virtuemart_product_id[]=1&quantity[]=1?addcoupontocart=code

    But It doesn't work.

    Thanks

  • Your avatar
    seyi    
     4 years ago  last edited 4 years ago
    0

    In a url, you can only have one "?" to indicate the start of a query string.  In order to add other values, you would then use an "&".  So change the link above to this:


    And it should work.

  • Default avatar
    nicolò    
     4 years ago
    0

    It works, great! Thank you.