Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

Tiffany McAllister
Tiffany McAllister
25,806 Points

Mobile-friendly PayPal Shopping Cart

I have a PayPal shopping cart button set up and it works fine, however, when I'm browsing the site on my iPhone and click the button it takes me to the desktop checkout. Does anyone know how to make it mobile-friendly?

I haven't used the PayPal API before and I believe that is the only way to do it.

2 Answers

Hi Tiffany,

I currently have the same problem and so far I found this on the Paypal developer site: "Merchants that are integrated with the “Donate”, “Add to Cart”, or “Subscribe” buttons will not benefit from the mobile optimized experience at all at this time."

Paypal suggests: "For now only merchants integrated with 'Buy Now' buttons or third party shopping carts (using “Cart Upload”) will benefit from Mobile PayPal Payments Standard (...)."

(https://developer.paypal.com/docs/classic/products/mobile-paypal-payments-standard/ )

  • scroll down to the section "Unsupported Use Cases"

For now I am thinking of displaying different buttons for different display sizes - "Buy Now" for phones and "Add to Cart" for larger screens, but not quite sure how to implement that yet.

Let me know how you solve this issue eventually. all the best

Tiffany McAllister
Tiffany McAllister
25,806 Points

Hi Marco,

Thanks for your response. I finally got it working. What I had to do was change my button from a Shopping Cart button to a Buy Now button and not activate any of the advanced options. If you have any advanced options activated (like letting the buyer choose the quantity) when you create the button it will not be mobile optimised. So what I had to do was create a separate "quantity" input before my button and dynamically change it in the form.

It's a lot more hassle than it should be but at least I have it working!

Hi Tiffany,

thanks for your reply. Good to know how you got it to work in the end.