Page 1 of 1

PayPal add to cart buttons

PostPosted: December 20th, 2011, 4:51 am
by ericsyd
Can we add the relevant additional codes (notify_url=http://storiesandchildren.com/kids/?s2member_paypal_notify=1 etc) to the hosted encrypted PayPal buttons to add to cart using Independent Custom Capabilities.

We have several eBooks and want customers to be able to select 2, 3 or 6 (and so on) eBook items in one payment rather than forced to make separate purchases. As there are currently 7 eBooks, and hopefully more soon, I think it is too complex to add combination custom capabilities.

If so, which codes are required. Will the custom capabilities handle multiple items or is it simply a no show.

Thanks

Re: PayPal add to cart buttons

PostPosted: December 20th, 2011, 5:57 am
by Cristián Lávaque
I'm not sure I understand the question fully. You mean change the custom capabilities and payment amount dynamically in the button? Well, you couldn't do that because the buttons are encrypted, and the unencrypted version is not secure because the user could edit it.

You could have a 2 step process, in the first page the user selects the books he wants and submits to "update the cart", which would reload the page and the button would be updated via the shortcode. viewtopic.php?f=36&t=1604

I hope that helps!

Re: PayPal add to cart buttons

PostPosted: December 20th, 2011, 11:05 pm
by ericsyd
Thank you for the reply
I can use s2member - Button Code Generator For Independent Custom Capabilities - under PayPal Capability (buy now) Buttons. This generates the information needed for a single purchase, and we can also do groups to include multiple items. The later groups are not much use in my situation as there are currently around 50 combinations.

I can also use the PayPal button generator (in my paypal account - not in s2member) to create an encrypted button to add an item to the PayPal cart. In that I can add custom fields such as notify_url=whatever.

I am guessing there is a certain amount of information required to be sent from PayPal back to s2member for each item to allow s2member to allocate custom capabilities to the customer.

As there is no button generator in s2member (that I can see) that allows the adding of a "custom capability" to the PayPal Cart, I am wondering if I can get the required information from s2member buy creating a custom capability buy button and taking the additional form fields and adding them in the PayPal button generator which will then produce an encrypted PayPal hosted button - that will have enough info to respond correctly to s2member if two or more items are purchased.

At the moment I have simply set up PayPal Add to Cart buttons and am hoping it will do the trick. http://storiesandchildren.com/childrens-books/#list but I don't know what additional info needs to be added to the PayPal Add advanced variables where I currently have:

notify_url=http://storiesandchildren.com/kids/?s2member_paypal_notify=1
return=http://storiesandchildren.com/kids/?s2member_paypal_return=1
rm=2
item_number=*:itsfly

the variable item_number=*:itsfly I am guessing is the custom capability and is the custom capability code for for that particular ebook.

This way I should be able to add any combination of product to the cart and have paypal return enough info for s2m2mber - in a single purchase???

My question is - is this correct and if so, which additional variables do I need?
Thanks

Re: PayPal add to cart buttons

PostPosted: December 23rd, 2011, 4:15 am
by Cristián Lávaque
The data that the button needs to include is explained by Jason in this post: viewtopic.php?f=36&t=309#p1333

I'm not sure I understand the question. Do you mean editing item_number=*:itsfly dynamically to add/remove items from the order? You could, but you'd also need to update the amount to pay.

Maybe it'd be simpler to work with the button shortcode provided by s2Member and update its values as shown here: viewtopic.php?f=36&t=1604