I’m working on an e-commerce solution for one of my clients that will not involve any type of checkout functionality; but instead, the user will have the choice to submit a form that requests a quote. The user will also have the option to click on a product display, and then view a more detailed description about that product.
Here is a sample page that shows these options for each product:
http://dev.welcome2solutions.com/magnetfactory/store/products/category/awareness/
Although it’s not active at the moment, I created a custom page for when the user clicks “VIEW PRODUCT DETAILS” – it will show a simple image along with some detailed info about the product. I need the custom page to somehow populate the product details of the product that was selected by the user.
What is the best way to call the product details on the product details page so that it is auto-populated? Can I do this without having to “GET” the information through a form submission and posting it into the new page?
It’s perfectly acceptable to build the URL to the product with the associated productId, so that you can call $_GET[‘id’] on the detail page. Once you have localized the productId on the detail page, you can issue a query to your products database to pull in the associated product data, via the productId. Obviously a better solution than attempting to pass in all product data via the url.
Example:
I suggest you read up on PHP PDO (from which the above is based) for your database access. There are 100 ways to accomplish the same objective, but I think the above example should be enough to get you started in the right direction.