O'Reilly logo

PHP 5 e-commerce Development by Michael Peacock

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Embedding products

As with featured products, we can make use of the directCall parameter in our products controller to include product details in other pages (and even in other controllers). If we have a specific area of our site where we wish to embed specific products, we can simply include the products controller, pass a directCall parameter of false, which prevents the controller from performing its default actions, and then do our relevant logic.

One example would be to include a specific product on a specific page.

  1. We would need to modify our page controller to detect when we were viewing that particular page, if we were, then the products controller would be included.
  2. We would need to create a new method in the products controller to lookup ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required