Joomla v2.5
Virtuemart v2.0.18
Chroforoms v4
I am trying to build a functionality in which a user can order a product from virtuemart using a form generated by chronoforms(v4). I am stuck and I don't know how to post the $form->data variables. I tried cURL but it didn't work out because the virtuemart form uses $_POST to add items in the cart.
Can someone suggest anything?
Thanks in advance.
Virtuemart v2.0.18
Chroforoms v4
I am trying to build a functionality in which a user can order a product from virtuemart using a form generated by chronoforms(v4). I am stuck and I don't know how to post the $form->data variables. I tried cURL but it didn't work out because the virtuemart form uses $_POST to add items in the cart.
Can someone suggest anything?
Thanks in advance.
Hello,
Let me assume that you want the form to submit data to a VM page ?
if yes then you have to get the VM URL used to receive the POST data, once you have this url, you can configure the form to send the data to it in different ways, 2 of them:
#1- set this url as the action url of the form, simple solution but Chronoforms can't do any "on submit" processing.
#2- use a CURL action in the "on submit" event and configure it to send the data to that url, you must have CURL enabled on the server.
Regards,
Max
Let me assume that you want the form to submit data to a VM page ?
if yes then you have to get the VM URL used to receive the POST data, once you have this url, you can configure the form to send the data to it in different ways, 2 of them:
#1- set this url as the action url of the form, simple solution but Chronoforms can't do any "on submit" processing.
#2- use a CURL action in the "on submit" event and configure it to send the data to that url, you must have CURL enabled on the server.
Regards,
Max
OK I have used the cURL [GH] action but without success. I am going throught the output of the debugger and I would like to know if the [curl_gh] array should contain anything (mine doesn't) and if the Response should be empty. Below I have the cURL [GH] debug data.
cURL OK : the cURL function was found on this server.
cURL Target URL: http://demo.something.com.gr//el/component/virtuemart/cart.html
Names + values (urldecoded)
Itemid : 489
option : com_virtuemart
view : cart
task : add
pname : Δωροεπιταγή αξίας 478 €
virtuemart_product_id[] : 244
quantity[] : 1
cURL Values: Itemid=489&option=com_virtuemart&view=cart&task=add&pname=Δωροεπιταγή αξίας 478 €&virtuemart_product_id[]=244&quantity[]=1
cURL:Resource id #111
cURL info: Array ( [url] => http://demo.something.com.gr//el/component/virtuemart/cart.html [content_type] => text/html; charset=utf-8 [http_code] => 303 [header_size] => 444 [request_size] => 307 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 2.57342 [namelookup_time] => 0.001653 [connect_time] => 0.001713 [pretransfer_time] => 0.001765 [size_upload] => 0 [size_download] => 0 [speed_download] => 0 [speed_upload] => 0 [download_content_length] => 0 [upload_content_length] => 0 [starttransfer_time] => 2.573393 [redirect_time] => 0 )
Response:
I finally made it work using two forms. In the first form I am doing some inserts in the db on the event 'On submit', then the required data are stored in the session and I redirect to the second form where I load the data from the session and post them as hidden fields i the vm cart.
Maybe there is a more elegant approach but this worked for me.
For once more chronoforms save the day.
Maybe there is a more elegant approach but this worked for me.
For once more chronoforms save the day.
This topic is locked and no more replies can be posted.