tpl *}
{load_presentation_object filename="amazon_products_list" assign="obj"}
{$obj->mDepartmentName}
{$obj->mDepartmentDescription}
2. Create a new file named amazon_products_list.php in the presentation folder, and add the following
code in it:
// Class that handles receiving AWS data
class AmazonProductsList
{
// Public variables available in smarty template
public $mProducts;
public $mDepartmentName;
public $mDepartmentDescription;
// Constructor
public function __construct()
{
$this->mDepartmentName = AMAZON_DEPARTMENT_TITLE;
$this->mDepartmentDescription = AMAZON_DEPARTMENT_DESCRIPTION;
}
public function init()
{
$amazon = new Amazon();
$this->mProducts = $amazon->GetProducts();
for ($i = 0;$i < count($this->mProducts); $i++)
$this->mProducts[$i]['link_to_product'] =
'http://www.
Pages:
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797