VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: jordy123 on November 06, 2015, 15:58:39 PM

Title: Order url of a product
Post by: jordy123 on November 06, 2015, 15:58:39 PM
I want to use a price table, which redirect to an order url of a product. But whats the order url of a product? i only know the standard url that redirect you to the product but not the order url (that puts the product in your cart)

Anyone that knows it?
Title: Re: Order url of a product
Post by: GJC Web Design on November 06, 2015, 16:08:36 PM
its not a "url" .. it is an ajax call with parameters to a function

e.g. index.php?option=com_virtuemart&nosef=1&view=cart&task=addJS&format=json&lang=&Itemid=101 + parameters from the form

study how e.g. add to cart works from a cat page.. it is a series of forms

Title: Re: Order url of a product
Post by: jordy123 on November 06, 2015, 16:36:00 PM
:/ ehhh
Title: Re: Order url of a product
Post by: Milbo on November 06, 2015, 18:42:18 PM
Quote from: GJC Web Design on November 06, 2015, 16:08:36 PM
its not a "url" .. it is an ajax call with parameters to a function

e.g. index.php?option=com_virtuemart&nosef=1&view=cart&task=addJS&format=json&lang=&Itemid=101 + parameters from the form

Which is an URL, but you are right it is not a common URL and our code uses a form, but imho we use the request, so it should work with a pure url
Title: Re: Order url of a product
Post by: jordy123 on November 06, 2015, 18:52:11 PM
index.php?option=com_virtuemart&nosef=1&view=cart&task=addJS&format=json&lang=&Itemid=101 + parameters from the form

What are those parameters than?
Title: Re: Order url of a product
Post by: GJC Web Design on November 06, 2015, 21:14:05 PM
e.g

Itemid   101
customProductData[71][15]   70
customProductData[71][16]   72

pid   71
pname   Classic Jacket
quantity[]    1

virtuemart_product_id[]    71

index.php?option=com_virtuemart&nosef=1&view=cart&task=add&lang=&customProductData%5B71%5D%5B16%5D=72&quantity%5B%5D=1&virtuemart_product_id%5B%5D=71&pname=Classic+Jacket&pid=71&Itemid=101

yes.. does work .. and returns to cart...  interesting :)
Title: Re: Order url of a product
Post by: Milbo on November 07, 2015, 11:57:23 AM
Yepp. that is on purpose, so that people can use it almost like an API.
Title: Re: Order url of a product
Post by: GJC Web Design on November 07, 2015, 13:49:13 PM
yes.. could be called from anywhere.. nice...
Title: Re: Order url of a product
Post by: jordy123 on November 07, 2015, 14:01:02 PM
What does this mean?

customProductData[71][15]   70
customProductData[71][16]   72

pid   71

How do you knows this data?

:)
Title: Re: Order url of a product
Post by: GJC Web Design on November 07, 2015, 14:03:09 PM
hey come on .. be more proactive from your side.. 

Quotestudy how e.g. add to cart works from a cat page.. it is a series of forms

use firebug etc to study the calls
Title: Re: Order url of a product
Post by: jordy123 on November 07, 2015, 14:09:02 PM
I tested it out and works :)

Thank you very much <3