/** * getOffersList */ public function getOffersList() { /** * initialize */ require_once 'models/ecommerce/ecommerce_offer.php'; $Offer = new ecommerce_offer(); /** * get special offer list */ $records = $Offer->getActiveOffers(); return $records; }
/** * main action */ public function mainAction() { $Offer = new ecommerce_offer(); $includeForthcoming = $_SESSION['fe_edit_mode'] == 'edit'; $offers = $Offer->getActiveOffers($includeForthcoming); foreach ($offers as $offer) { $offer['price_formatted'] = $this->formatPrice($offer['price'], $offer['currency_code']); $offer['title'] = $this->getRoundelText($offer); $offer['image'] = $this->getRoundelImageSource($offer); $this->tpl->assign("ITEM", $offer); $this->tpl->parse("content.item"); } return true; }
/** * get data */ public function getData() { $data = ''; /** * initialize */ require_once 'models/ecommerce/ecommerce_offer.php'; $Offer = new ecommerce_offer(); /** * get special offer list */ $records = $Offer->getActiveOffers(); $data = array(); foreach ($records as $record) { $item = $this->formatItem($record); $data[] = $item; } return $data; }
/** * get data */ public function getData() { $data = ''; /** * initialize */ require_once 'models/ecommerce/ecommerce_offer.php'; $Offer = new ecommerce_offer(); /** * get special offer list */ $records = $Offer->getActiveOffers(); $data = array(); foreach ($records as $record) { $item = $this->formatItem($record); //API 1.0 is showing expiry date without time and as day when the offer is taken down $item['expiry_date'] = date('Y-m-d', strtotime($item['expiry_date']) + 86400); $data[] = $item; } return $data; }