Пример #1
0
 public function __construct()
 {
     parent::__construct();
     $filter = '';
     $filter_prostatus = '';
     $filter_data_frm = '';
     $filter_data_to = '';
     $from = null;
     $to = null;
     $userId = Mage::getSingleton('customer/session')->getCustomer()->getId();
     $collection = Mage::getModel('marketplace/product')->getCollection()->addFieldToFilter('userid', array('eq' => $userId));
     $products = array();
     foreach ($collection as $data) {
         array_push($products, $data->getMageproductid());
     }
     if (isset($_GET['s'])) {
         $filter = $_GET['s'] != "" ? $_GET['s'] : "";
     }
     if (isset($_GET['prostatus'])) {
         $filter_prostatus = $_GET['prostatus'] != "" ? $_GET['prostatus'] : "";
     }
     if (isset($_GET['from_date'])) {
         $filter_data_frm = $_GET['from_date'] != "" ? $_GET['from_date'] : "";
     }
     if (isset($_GET['to_date'])) {
         $filter_data_to = $_GET['to_date'] != "" ? $_GET['to_date'] : "";
     }
     if ($filter_data_to) {
         $todate = date_create($filter_data_to);
         $to = date_format($todate, 'Y-m-d 23:59:59');
     }
     if ($filter_data_frm) {
         $fromdate = date_create($filter_data_frm);
         $from = date_format($fromdate, 'Y-m-d H:i:s');
     }
     $collection = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect('*')->addFieldToFilter('name', array('like' => "%" . $filter . "%"));
     if ($filter_prostatus) {
         $collection->addFieldToFilter('status', array('like' => "%" . $filter_prostatus . "%"));
     }
     $collection->addFieldToFilter('created_at', array('datetime' => true, 'from' => $from, 'to' => $to))->addFieldToFilter('entity_id', array('in' => $products))->setOrder('entity_id', 'DESC');
     $this->setCollection($collection);
 }
Пример #2
0
 public function __construct()
 {
     parent::__construct();
     $userId = Mage::getSingleton('customer/session')->getCustomer()->getId();
     $wholedata = $this->getRequest()->getParams();
     $childIds = Mage::getModel('catalog/product_type_configurable')->getChildrenIds($wholedata['id']);
     $products = array();
     foreach ($childIds[0] as $key => $val) {
         array_push($products, $key);
     }
     $searchid = $this->getRequest()->getParam('searchid') != "" ? $this->getRequest()->getParam('searchid') : "";
     $filter = $this->getRequest()->getParam('s') != "" ? $this->getRequest()->getParam('s') : "";
     $proattrset = $this->getRequest()->getParam('proattrset') != "" ? $this->getRequest()->getParam('proattrset') : "";
     $collection = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect('*')->addFieldToFilter('name', array('like' => "%" . $filter . "%"));
     $collection->addFieldToFilter('entity_id', array('in' => $products));
     if ($searchid) {
         $collection->addFieldToFilter('entity_id', array('eq' => $searchid));
     }
     if ($proattrset) {
         $collection->addFieldToFilter('attribute_set_id', array('eq' => $proattrset));
     }
     $collection->setOrder('entity_id', 'AESC');
     $this->setCollection($collection);
 }
 public function __construct()
 {
     parent::__construct();
     $this->setTemplate('customer/form/newsletter.phtml');
 }
Пример #4
0
 public function __construct()
 {
     Mage_Customer_Block_Account_Dashboard::__construct();
     $this->setTemplate('advancednewsletter/customer/subscriptions.phtml');
 }
Пример #5
0
 function __construct()
 {
     parent::__construct();
     $this->setTemplate('braintree/creditcard/index.phtml');
     $this->braintree = Mage::getModel('braintree/paymentmethod');
 }