I am trying to set up a form (I started with the PayPal demo form) and I need 2 options, a 4x8 brick that is $100 and an 8x8 brick that is $250. I have created a field where they select the option, then I also added 2 fields where they type in the text they want (2 lines). I was able to get the brick they choose to show as the item when it goes to Paypal, but how can I have it show their text and the price? I have included screen shots of what I have set up. I think my PHP is not right plus I am not sure how to make it show in the amount field in the Paypal redirect.







You SHOULD store all your products in a database, and the dropdown should have the ID of the product. But that may not be necessary if you only have two products.
SO what you need to do is fix all your PHP.
SO what you need to do is fix all your PHP.
if($this->data("BRICK") == "4X8 Brick")Then you need to use the NAME you gave that php block, in your case "php11", for the amount. It's not form data it's action data so you use {var:php11} for the amount.
return 100;
else
return 250;
if you want to pass one item only to PayPal then do your processing in the PHP action and return an array of the item data:
Best reagrds
if($this->data("BRICK") == "4X8 Brick"){Then use {var:php_name.name} in Item name, {var:php_name.number} in item number and same for amount
return ["name" => "4x8", "number" => "48x", "amount" => 100.00];
}else{
return ["name" => "8x8", "number" => "88x", "amount" => 250.00];
}
Best reagrds
Yes, or do that. That's better.
Thank you so much! That is awesome! Works like a charm!!
This topic is locked and no more replies can be posted.