Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP

PHP Paypal Automated Pages Issue

Hi there! So right now we are learning how to add paypal buttons on each product page. We only have 1 product page that is linked to an array that has the name/price/image. We use a standard form that has 3 sizes and it appears on every product. Here's my question, if I want to have a text box or another paypal button on one of these product pages, how do i do it? Do I have to restructure the site so that every product has it's own page? Thanks, Eliot

Randy Hoyt

1 Answer

For starters, I highy HIGHLY recommend you go back and repeat the "Integrating with Paypal" stage of Randy's "Build a Simple PHP Application". It literally explains exactly what you want to do.

To put it shortly, your only going to need one page for these products but every time you visit it, it needs to pull the specific information about whichever product the viewer is interested in. This is done by feeding (most likely) an ID number from your array linked to the specific product via a $_GET variable. You will also need the paypal item number in order to add unique products to the paypal shopping cart.

Again, review the paypal stage and if you don't want to go through all of it again, at least download the final code project and fiddle around with that to get an understanding.

Good luck!