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

Torger Angeltveit
Torger Angeltveit
11,228 Points

Paypal shopping cart with PHP

Hi, is it possible to add a number to the paypal shoppingcart holder displaying how many items you have added to the cart?

i want to display it on the original site and not on the paypal checkout form.

2 Answers

Codin - Codesmite
Codin - Codesmite
8,600 Points

I'm not sure if there is an command to pull this value from the Paypal API. But you could try creating a function that increments a variable when an item has been added to a cart then return the value in a custom icon.

To store the value of the variable you could use PHP setcookie() function to store it in the users cookies.

Personally I do not like the API for Paypal Cart in more advanced designs and prefer to use services such as Shopify or many of the other availible e-commerce platforms.

Torger Angeltveit
Torger Angeltveit
11,228 Points

Thanks for answer, ill try it out :)