searls03 Posted January 7, 2013 Share Posted January 7, 2013 I am using paypal to integrate a shopping cart into my site. I would like to know if anyone knows how paypal sends POST variables when there are multiple items. So my customer orders 2 items, I know how to get one item, but how does paypal send both? do they use an array? an item_name_1/2? how do they post back? does anyone here know?if you can help me, that would be awesome. Quote Link to comment https://forums.phpfreaks.com/topic/272809-paypal-integration/ Share on other sites More sharing options...
searls03 Posted January 7, 2013 Author Share Posted January 7, 2013 so I do use item_name1/2/3/etc....but how can I dynamically create this list is my next question then. Quote Link to comment https://forums.phpfreaks.com/topic/272809-paypal-integration/#findComment-1404014 Share on other sites More sharing options...
scootstah Posted January 7, 2013 Share Posted January 7, 2013 Without really knowing what you're doing, since you haven't really given any such information, a for loop perhaps? for($i = 1; $i <= 5; $i++) { echo '<input type="hidden" name="item_name' . $i . '" />'; } Quote Link to comment https://forums.phpfreaks.com/topic/272809-paypal-integration/#findComment-1404015 Share on other sites More sharing options...
searls03 Posted January 7, 2013 Author Share Posted January 7, 2013 I thought about a for loop, but the issue here being that how do I know what number to end on....there could be 1 item, there could be 100 items ordered. I plan to insert into a database each item that is sold individually for tracking purposes. So I guess I am asking, does paypal send a variable of how many items were purchased? I have been looking and can't seem to find one. Quote Link to comment https://forums.phpfreaks.com/topic/272809-paypal-integration/#findComment-1404017 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.