/**
  * Return params list to use for search
  *
  * @return \XLite\Core\CommonCell
  */
 protected function getSearchCondition()
 {
     $result = parent::getSearchCondition();
     $result->{\XLite\Model\Repo\OrderTrackingNumber::P_ORDER_ID} = $this->getParam(static::PARAM_ORDER_ID);
     foreach (static::getSearchParams() as $modelParam => $requestParam) {
         $paramValue = $this->getParam($requestParam);
         if ('' !== $paramValue && 0 !== $paramValue) {
             $result->{$modelParam} = $paramValue;
         }
     }
     return $result;
 }
Example #2
0
 /**
  * Return params list to use for search
  *
  * @return \XLite\Core\CommonCell
  */
 protected function getSearchCondition()
 {
     $result = parent::getSearchCondition();
     foreach (static::getSearchParams() as $modelParam => $requestParam) {
         $result->{$modelParam} = is_string($this->getParam($requestParam)) ? trim($this->getParam($requestParam)) : $this->getParam($requestParam);
     }
     $result->{\XLite\Model\Repo\Country::P_ORDER_BY} = array('translations.country', 'ASC');
     return $result;
 }
Example #3
0
 /**
  * Return params list to use for search
  * TODO refactor
  *
  * @return \XLite\Core\CommonCell
  */
 protected function getSearchCondition()
 {
     $result = parent::getSearchCondition();
     $result->{\XLite\Model\Repo\Payment\Transaction::SEARCH_ORDERBY} = $this->getOrderBy();
     foreach (static::getSearchParams() as $modelParam => $requestParam) {
         $paramValue = $this->getParam($requestParam);
         if ('' !== $paramValue && 0 !== $paramValue) {
             $result->{$modelParam} = $paramValue;
         }
     }
     return $result;
 }
Example #4
0
 /**
  * Return params list to use for search
  *
  * @return \XLite\Core\CommonCell
  */
 protected function getSearchCondition()
 {
     $result = parent::getSearchCondition();
     $result->{\XLite\Model\Repo\Payment\Method::P_ENABLED} = true;
     $result->{\XLite\Model\Repo\Payment\Method::P_MODULE_ENABLED} = true;
     $result->{\XLite\Model\Repo\Payment\Method::P_ADDED} = true;
     $result->{\XLite\Model\Repo\Payment\Method::P_POSITION} = array(\XLite\Model\Repo\Payment\Method::FIELD_DEFAULT_POSITION, static::SORT_ORDER_ASC);
     return $result;
 }
Example #5
0
 /**
  * Return params list to use for search
  *
  * @return \XLite\Core\CommonCell
  */
 protected function getSearchCondition()
 {
     $result = parent::getSearchCondition();
     foreach (static::getSearchParams() as $modelParam => $requestParam) {
         $result->{$modelParam} = $this->getParam($requestParam);
     }
     return $result;
 }
Example #6
0
 /**
  * Return params list to use for search
  * TODO refactor
  *
  * @return \XLite\Core\CommonCell
  */
 protected function getSearchCondition()
 {
     $result = parent::getSearchCondition();
     foreach (static::getSearchParams() as $modelParam => $requestParam) {
         $paramValue = $this->getParam($requestParam);
         if ('' !== $paramValue && 0 !== $paramValue) {
             $result->{$modelParam} = $paramValue;
         }
     }
     $result->{\XLite\Model\Repo\Category::SEARCH_PARENT} = \XLite\Core\Request::getInstance()->id ? intval(\XLite\Core\Request::getInstance()->id) : \XLite\Core\Database::getRepo('XLite\\Model\\Category')->getRootCategoryId();
     return $result;
 }
Example #7
0
 /**
  * Return params list to use for search
  *
  * @return \XLite\Core\CommonCell
  */
 protected function getSearchCondition()
 {
     $cnd = parent::getSearchCondition();
     $class = '\\XLite\\Module\\CDev\\XPaymentsConnector\\Model\\Repo\\Payment\\XpcTransactionData';
     $cnd->{$class::SEARCH_RECHARGES_ONLY} = true;
     $cnd->{$class::SEARCH_PAYMENT_ACTIVE} = true;
     $cnd->{$class::SEARCH_LOGIN} = $this->getCustomerProfile()->getLogin();
     return $cnd;
 }
Example #8
0
 /**
  * Return params list to use for search
  *
  * @return \XLite\Core\CommonCell
  */
 protected function getSearchCondition()
 {
     $result = parent::getSearchCondition();
     $result->{\XLite\Model\Repo\Payment\Method::P_ORDERBY} = array('m.orderby, translations.name', 'asc');
     $result->{\XLite\Model\Repo\Payment\Method::P_TYPE} = array(\XLite\Model\Payment\Method::TYPE_ALLINONE, \XLite\Model\Payment\Method::TYPE_CC_GATEWAY, \XLite\Model\Payment\Method::TYPE_ALTERNATIVE);
     $result->{\XLite\Model\Repo\Payment\Method::P_NAME} = trim($this->getParam(static::PARAM_SUBSTRING));
     $result->{\XLite\Model\Repo\Payment\Method::P_COUNTRY} = trim($this->getParam(static::PARAM_COUNTRY));
     $result->{\XLite\Model\Repo\Payment\Method::P_EX_COUNTRY} = trim($this->getParam(static::PARAM_COUNTRY));
     return $result;
 }
Example #9
0
 /**
  * Return params list to use for search
  *
  * @return \XLite\Core\CommonCell
  */
 protected function getSearchCondition()
 {
     $result = parent::getSearchCondition();
     $result->{\XLite\Module\XC\PitneyBowes\Model\Repo\ProductRestriction::SEARCH_PRODUCT} = $this->getProductId();
     return $result;
 }
Example #10
0
 /**
  * Return params list to use for search
  *
  * @return \XLite\Core\CommonCell
  */
 protected function getSearchCondition()
 {
     $result = parent::getSearchCondition();
     $result->{\XLite\Model\Repo\Shipping\Method::P_CARRIER} = '';
     $result->{\XLite\Model\Repo\Shipping\Method::P_ADDED} = true;
     $result->{\XLite\Model\Repo\Shipping\Method::P_ORDER_BY} = array('m.position', 'ASC');
     return $result;
 }
Example #11
0
 /**
  * Return params list to use for search
  *
  * @return \XLite\Core\CommonCell
  */
 protected function getSearchCondition()
 {
     $result = parent::getSearchCondition();
     $result->{\XLite\Model\Repo\AddressField::CND_WITHOUT_CSTATE} = true;
     return $result;
 }
Example #12
0
 /**
  * Return params list to use for search
  *
  * @return \XLite\Core\CommonCell
  */
 protected function getSearchCondition()
 {
     $result = parent::getSearchCondition();
     $result->{\XLite\Module\XC\PitneyBowes\Model\Repo\ParcelItem::P_PARCEL} = $this->getParcel();
     return $result;
 }
Example #13
0
 /**
  * Return params list to use for search
  *
  * @return \XLite\Core\CommonCell
  */
 protected function getSearchCondition()
 {
     $result = parent::getSearchCondition();
     $result->{\XLite\Model\Repo\Zone::P_ORDER_BY} = array('z.zone_name', 'ASC');
     return $result;
 }
Example #14
0
 /**
  * Return params list to use for search
  *
  * @return \XLite\Core\CommonCell
  */
 protected function getSearchCondition()
 {
     $result = parent::getSearchCondition();
     // We initialize structure to define order (field and sort direction) in search query.
     $result->{\XLite\Module\XC\CanadaPost\Model\Repo\ProductsReturn::P_ORDER_BY} = $this->getOrderBy();
     foreach (static::getSearchParams() as $modelParam => $requestParam) {
         $value = $this->getParam($requestParam);
         if (isset($value) && '' !== $value && 0 !== $value) {
             $result->{$modelParam} = $this->getParam($requestParam);
         }
     }
     return $result;
 }
Example #15
0
 /**
  * Return params list to use for search
  *
  * @return \XLite\Core\CommonCell
  */
 protected function getSearchCondition()
 {
     $result = parent::getSearchCondition();
     // We initialize structure to define order (field and sort direction) in search query.
     $result->{\XLite\Model\Repo\Profile::SEARCH_ORDERBY} = $this->getOrderBy();
     foreach (static::getSearchParams() as $modelParam => $requestParam) {
         $paramValue = $this->getParam($requestParam);
         if (is_string($paramValue)) {
             $paramValue = trim($paramValue);
         }
         if ('' !== $paramValue && 0 !== $paramValue) {
             $result->{$modelParam} = $paramValue;
         }
     }
     $result->{\XLite\Model\Repo\Profile::SEARCH_ONLY_REAL} = true;
     if ($result->{\XLite\Model\Repo\Profile::SEARCH_MEMBERSHIP}) {
         $membershipCondition = $result->{\XLite\Model\Repo\Profile::SEARCH_MEMBERSHIP};
         if (is_array($membershipCondition)) {
             $membershipIds = array_reduce($membershipCondition, function ($carry, $item) {
                 $item = explode('_', $item);
                 if (2 == count($item)) {
                     $carry[$item[0]][] = $item[1];
                 }
                 return $carry;
             }, array());
             $result->{\XLite\Model\Repo\Profile::SEARCH_MEMBERSHIP} = $membershipIds;
         }
     }
     $permittedUserTypes = $this->getPermittedUserTypes();
     if (isset($result->{\XLite\Model\Repo\Profile::SEARCH_USER_TYPE}[0]) && '' !== $result->{\XLite\Model\Repo\Profile::SEARCH_USER_TYPE}[0]) {
         $userTypes = array_filter($result->{\XLite\Model\Repo\Profile::SEARCH_USER_TYPE}, function ($type) use($permittedUserTypes) {
             return in_array($type, $permittedUserTypes);
         });
         $result->{\XLite\Model\Repo\Profile::SEARCH_USER_TYPE} = $userTypes;
     } elseif (!\XLite\Core\Auth::getInstance()->isPermissionAllowed('manage admins')) {
         $result->{\XLite\Model\Repo\Profile::SEARCH_USER_TYPE} = $permittedUserTypes;
     }
     return $result;
 }
Example #16
0
 /**
  * Return params list to use for search
  *
  * @return \XLite\Core\CommonCell
  */
 protected function getSearchCondition()
 {
     $result = parent::getSearchCondition();
     foreach (static::getSearchParams() as $modelParam => $requestParam) {
         $result->{$modelParam} = $this->getParam($requestParam);
     }
     if (empty($result->{\XLite\Model\Repo\State::P_COUNTRY_CODE})) {
         $result->{\XLite\Model\Repo\State::P_COUNTRY_CODE} = $this->getCountryCode();
     }
     $result->{\XLite\Model\Repo\State::P_ORDER_BY} = array('s.state', 'ASC');
     return $result;
 }
Example #17
0
 /**
  * Return params list to use for search
  *
  * @return \XLite\Core\CommonCell
  */
 protected function getSearchCondition()
 {
     $cnd = parent::getSearchCondition();
     $class = '\\XLite\\Module\\CDev\\XPaymentsConnector\\Model\\Repo\\Payment\\BackendTransaction';
     $cnd->{$class::SEARCH_ORDER_ID} = $this->getOrder()->getOrderId();
     return $cnd;
 }
Example #18
0
 /**
  * Return params list to use for search
  *
  * @return \XLite\Core\CommonCell
  */
 protected function getSearchCondition()
 {
     $cnd = parent::getSearchCondition();
     $cnd->{\XLite\Model\Repo\Payment\Method::P_CLASS} = 'Module\\CDev\\XPaymentsConnector\\Model\\Payment\\Processor\\XPayments';
     $cnd->{\XLite\Model\Repo\Payment\Method::P_ORDERBY} = array('translations.name', 'asc');
     return $cnd;
 }
Example #19
0
 /**
  * Return params list to use for search
  * TODO refactor
  *
  * @return \XLite\Core\CommonCell
  */
 protected function getSearchCondition()
 {
     $result = parent::getSearchCondition();
     $result->{\XLite\Model\Repo\Product::P_ORDER_BY} = $this->getOrderBy();
     $result->{static::PARAM_SEARCH_IN_SUBCATS} = true;
     foreach (static::getSearchParams() as $modelParam => $requestParam) {
         $paramValue = $this->getParam($requestParam);
         if (is_string($paramValue)) {
             $paramValue = trim($paramValue);
         }
         if (static::PARAM_CATEGORY_ID === $requestParam && '0' === $paramValue) {
             $paramValue = 0;
         }
         if ('' !== $paramValue && 0 !== $paramValue) {
             $result->{$modelParam} = $paramValue;
         }
     }
     return $result;
 }
Example #20
0
 /**
  * Return params list to use for search
  *
  * @return \XLite\Core\CommonCell
  */
 protected function getSearchCondition()
 {
     $result = parent::getSearchCondition();
     foreach (static::getSearchParams() as $modelParam => $requestParam) {
         $result->{$modelParam} = is_string($this->getParam($requestParam)) ? trim($this->getParam($requestParam)) : $this->getParam($requestParam);
     }
     $codes = array(static::getDefaultLanguage(), $this->getLanguageCode());
     $result->{\XLite\Model\Repo\LanguageLabel::SEARCH_CODES} = array_unique($codes);
     if (\XLite\Core\Session::getInstance()->added_labels) {
         $result->{\XLite\Model\Repo\LanguageLabel::ORDER_FIRST_BY_IDS} = \XLite\Core\Session::getInstance()->added_labels;
     }
     $result->{\XLite\Model\Repo\LanguageLabel::P_ORDER_BY} = array('l.name', 'ASC');
     return $result;
 }
Example #21
0
 /**
  * Return params list to use for search
  *
  * @return \XLite\Core\CommonCell
  */
 protected function getSearchCondition()
 {
     $result = parent::getSearchCondition();
     foreach (static::getSearchParams() as $modelParam => $requestParam) {
         $paramValue = $this->getParam($requestParam);
         if (is_string($paramValue)) {
             $paramValue = trim($paramValue);
         }
         if ('' !== $paramValue) {
             $result->{$modelParam} = $paramValue;
         }
     }
     $result->{\XLite\Module\XC\Reviews\Model\Repo\Review::SEARCH_ORDERBY} = $this->getOrderBy();
     // Comment this line to search reviews and ratings
     // $result->{\XLite\Module\XC\Reviews\Model\Repo\Review::SEARCH_TYPE} =
     //    \XLite\Module\XC\Reviews\Model\Repo\Review::SEARCH_TYPE_REVIEWS_ONLY;
     return $result;
 }
Example #22
0
 /**
  * Return params list to use for search
  *
  * @return \XLite\Core\CommonCell
  */
 protected function getSearchCondition()
 {
     $result = parent::getSearchCondition();
     $result->methodId = \XLite\Core\Request::getInstance()->methodId;
     return $result;
 }
Example #23
0
 /**
  * Return params list to use for search
  *
  * @return \XLite\Core\CommonCell
  */
 protected function getSearchCondition()
 {
     $result = parent::getSearchCondition();
     $result->{\XLite\Module\XC\PitneyBowes\Model\Repo\PBParcel::P_ORDER} = $this->getOrder();
     return $result;
 }
Example #24
0
 /**
  * Return params list to use for search
  *
  * @return \XLite\Core\CommonCell
  */
 protected function getSearchCondition()
 {
     $result = parent::getSearchCondition();
     foreach (static::getSearchParams() as $modelParam => $requestParam) {
         $result->{$modelParam} = $this->getParam($requestParam);
     }
     $carrierParam = \XLite\Model\Repo\Shipping\Method::P_CARRIER;
     if (!empty($result->{$carrierParam}) && 'offline' == $result->{$carrierParam}) {
         $result->{$carrierParam} = '';
     }
     $result->{\XLite\Model\Repo\Shipping\Method::P_ORDER_BY} = array('m.position', 'ASC');
     return $result;
 }
Example #25
0
 /**
  * Return params list to use for search
  * TODO refactor
  *
  * @return \XLite\Core\CommonCell
  */
 protected function getSearchCondition()
 {
     $result = parent::getSearchCondition();
     foreach (static::getSearchParams() as $modelParam => $requestParam) {
         $paramValue = $this->getParam($requestParam);
         if ('' !== $paramValue && 0 !== $paramValue) {
             $result->{$modelParam} = $paramValue;
         }
     }
     $result->product = $this->getProduct();
     return $result;
 }
Example #26
0
 /**
  * Return params list to use for search
  * TODO refactor
  *
  * @return \XLite\Core\CommonCell
  */
 protected function getSearchCondition()
 {
     $result = parent::getSearchCondition();
     foreach (static::getSearchParams() as $modelParam => $requestParam) {
         $paramValue = $this->getParam($requestParam);
         if ('' !== $paramValue && 0 !== $paramValue) {
             $result->{$modelParam} = $paramValue;
         }
     }
     $result->productClass = $this->getProductClass();
     if (\XLite\Core\Request::getInstance()->isGet()) {
         $result->attributeGroup = $this->getAttributeGroup();
         $result->productClass = $this->getProductClass();
     }
     $result->product = null;
     return $result;
 }