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 Build a Simple PHP Application Integrating with PayPal Creating Paypal Buttons

Konstantinos Pedarakis
Konstantinos Pedarakis
21,301 Points

what we would do if we had thousands of products?

Hi everyone!! i was confused here with PayPal since it is something new to me, as far as payment services are concerned. anyway my question is if we had lets say to deal hundreds or thousands of products, what we would do? i mean, its imposible to set up thousands of those PayPal buttons.

Thanks.

1 Answer

Maximillian Fox
PLUS
Maximillian Fox
Courses Plus Student 9,236 Points

This depends if you want to set up an online store, which is the way to go like how say Amazon do it.

A typical e-commerce site would have an 'add to cart' button on each of the pages, which would select the product most likely by its ID from a database, and then when you click View Cart, the IDs are called again to perform the addition and total price to the cart. This is easier to set up in PHP and a database like MySQL, because the way your site would be set up would be largely template based. Then you have 1 PayPal button, and you are done :)

Konstantinos Pedarakis
Konstantinos Pedarakis
21,301 Points

yeah. thanks! that has a lot more sense. that was actually what i had in mind. Thanks Maximillian Fox