News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

set custom field (customPrice) using URL

Started by psee, January 04, 2012, 02:50:24 AM

Previous topic - Next topic

psee

I'm trying to add products to the cart using an url, but I can't figure out how to set a customField (e.g. an boolean).

URL Example:
/index.php?option=com_virtuemart&nosef=1&view=cart&task=addJS&format=json&customPlugin[20][textinput][comment]=&customPrice[0][24]=54&quantity[]=1&option=com_virtuemart&view=cart&virtuemart_product_id[]=3

The custom field:


The product:


In this case it's about &customPrice[0][24]=54
- 0 is the product of course (first in row, i'm adding multiple at once)
- 24 is the custom field id (a boolean)
- 54 seems to be yes (and 55 for example will be no)

My problem is with the values 54/55.. these seem to change (from time to time or when other custom field are added?), so I can't rely on them.

So my question basically is: Is there another reliable way to set custom field using URL parameters?


siggio76

Hi, thanks for the useful link.

Since I had many problems due to SEF settings I did use the form post. It should be better

Now I am mobile and I can't find the link to the thread where it's explained. Next post...

Do you know how do the customPlugin and customPrice fields work?

I mean, in my case they don't have the same field id: customPlugin[19] and customPrice[13] with value="19"

The cart only add the product when I use those fields in that way... But I can't understand from where the 13 value is coming.
I can't find anything to