Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP7 Decoder for ionCube Encoder)
- *
- * @ Version : 4.1.0.1
- * @ Author : DeZender
- * @ Release on : 29.08.2020
- * @ Official site : http://DeZender.Net
- *
- */
- class ModelExtensionDreamFilter extends Model
- {
- protected $imagetypes = ['image', 'multiimage'];
- protected $getImages = true;
- protected $multitypes = ['type_single', 'radio', 'checkbox', 'image', 'multiimage'];
- protected $code = 'rdrf';
- private $_errors = [];
- private $_weights = [];
- private $_lengths = [];
- public $cacheDuration;
- public $view;
- public $settings;
- public $notavailable;
- public $module_id = '';
- public $cachePath;
- public $cacheFileSuffix = '.bin';
- public $sortTypes = ['p.date_added', 'p.date_available', 'p.date_modified', 'p.height', 'p.image', 'p.length', 'p.location', 'p.manufacturer_id', 'p.minimum', 'p.sku', 'p.upc', 'p.ean', 'p.jan', 'p.isbn', 'p.mpn', 'p.model', 'p.points', 'p.price', 'p.product_id', 'p.quantity', 'p.shipping', 'p.sort_order', 'p.stock_status_id', 'p.subtract', 'p.status', 'p.tax_class_id', 'p.viewed', 'p.weight', 'p.width', 'pd.description', 'pd.name', 'pd.tag', 'discount', 'rating', 'special'];
- private $types = [
- 'name' => ['name' => 'name', 'code' => 'name', 'key' => 'filter_name'],
- 'price' => [
- 'name' => 'price',
- 'code' => 'price',
- 'key' => 'filter_price',
- 'keys' => ['filter_price_min', 'filter_price_max']
- ],
- 'stock' => ['name' => 'stock', 'code' => 'stock', 'key' => 'filter_stock'],
- 'novelty' => ['name' => 'novelty', 'code' => 'new', 'key' => 'filter_new'],
- 'special' => ['name' => 'special', 'code' => 'spc', 'key' => 'filter_special'],
- 'length' => ['name' => 'length', 'code' => 'lgth', 'key' => 'filter_length'],
- 'width' => ['name' => 'width', 'code' => 'wdth', 'key' => 'filter_width', 'md5' => true],
- 'height' => ['name' => 'height', 'code' => 'hght', 'key' => 'filter_height'],
- 'weight' => ['name' => 'weight', 'code' => 'wght', 'key' => 'filter_weight'],
- 'rating' => ['name' => 'rating', 'code' => 'rtng', 'key' => 'filter_rating'],
- 'tags' => ['name' => 'tags', 'code' => 'tag', 'key' => 'filter_tag', 'md5' => true],
- 'model' => ['name' => 'model', 'code' => 'model', 'key' => 'filter_model', 'md5' => true],
- 'sku' => ['name' => 'sku', 'code' => 'sku', 'key' => 'filter_sku', 'md5' => true],
- 'upc' => ['name' => 'upc', 'code' => 'upc', 'key' => 'filter_upc', 'md5' => true],
- 'ean' => ['name' => 'ean', 'code' => 'ean', 'key' => 'filter_ean', 'md5' => true],
- 'jan' => ['name' => 'jan', 'code' => 'jan', 'key' => 'filter_jan', 'md5' => true],
- 'isbn' => ['name' => 'isbn', 'code' => 'isbn', 'key' => 'filter_isbn', 'md5' => true],
- 'mpn' => ['name' => 'mpn', 'code' => 'mpn', 'key' => 'filter_mpn', 'md5' => true],
- 'manufacturers' => [
- 'name' => 'manufacturers',
- 'code' => 'man',
- 'key' => 'filter_manufacturer_id',
- 'sort_keys' => ['count', 'name', 'sort']
- ],
- 'categories' => ['name' => 'categories', 'code' => 'ctg', 'key' => 'filter_category', 'sorted' => true],
- 'attributes' => ['name' => 'attributes', 'code' => 'attr', 'key' => 'filter_attributes', 'sorted' => true, 'md5' => true],
- 'options' => ['name' => 'options', 'code' => 'opt', 'key' => 'filter_options', 'sorted' => true],
- 'filters' => ['name' => 'filters', 'code' => 'fil', 'key' => 'filter_filter', 'sorted' => true]
- ];
- private $multiparams = ['attr', 'opt', 'fil'];
- public function __construct($registry)
- {
- parent::__construct($registry);
- if (version_compare(phpversion(), '5.6', '<')) {
- $this->_errors[] = $this->language->get('error_php');
- }
- $this->cachePath = DIR_CACHE . '../rdr-cache';
- $this->notavailable = $this->config->get('rdrf_notavailable');
- $cache_time = $this->config->get('rdrf_cachetime');
- if ($this->config->get('rdrf_cachestatus') && $cache_time) {
- $this->cacheDuration = $cache_time * 3600;
- }
- if ($this->cacheDuration) {
- if (!is_dir($this->cachePath)) {
- mkdir($this->cachePath, 509, true);
- }
- $this->cleanCache(false);
- }
- else if (is_dir($this->cachePath)) {
- $this->cleanCache();
- rmdir($this->cachePath);
- }
- }
- public function __debugInfo()
- {
- return [];
- }
- public function __call($name, $arguments)
- {
- return $name;
- }
- static public function __callStatic($name, $arguments)
- {
- return $name;
- }
- private function parseRequest($data = [])
- {
- $parsed = [];
- $default = ['filter_category_id', 'filter_sub_category', 'filter_manufacturer_id', 'filter_name', 'filter_tag', 'filter_description', 'filter_stock', 'special', 'sort', 'order', 'start', 'limit'];
- foreach ($default as $p) {
- if (isset($data[$p]) && ($data[$p] !== '')) {
- $parsed[$p] = $data[$p];
- }
- }
- if (isset($data['filter_filter']) && version_compare(VERSION, '1.5.5', '>=')) {
- if (strpos($data['filter_filter'], ',') !== false) {
- $parsed['filter_filter'] = explode(',', $data['filter_filter']);
- }
- else if ($data['filter_filter'] !== '') {
- $parsed['filter_filter'] = $this->obf_5qwIjmoq1qIOeiZuks6qjwLuws7E($data['filter_filter']);
- }
- }
- if (!empty($data[$this->code])) {
- if (is_string($data[$this->code])) {
- $data[$this->code] = $this->obf_5CUiaSiuISlq7yxspqIh6uubyvvqE($data[$this->code]);
- }
- $filters = $data[$this->code];
- if (!empty($filters['name']) && empty($parsed['filter_name']) && empty($parsed['filter_tag'])) {
- $parsed['filter_name'] = $this->obf_5qwIjmoq1qIOeiZuks6qjwLuws7E($filters['name']);
- }
- if (($this->customer->isLogged() || !$this->config->get('config_customer_price')) && !empty($filters['price']) && (stripos($filters['price'], ';') !== false)) {
- $parsed['filter_price_min'] = explode(';', $this->obf_5qwIjmoq1qIOeiZuks6qjwLuws7E($filters['price']))[0];
- $parsed['filter_price_max'] = explode(';', $this->obf_5qwIjmoq1qIOeiZuks6qjwLuws7E($filters['price']))[1];
- }
- if (isset($filters['new']) && is_array($filters['new'])) {
- foreach ($filters['new'] as $days => $new) {
- $parsed['filter_new'][$days] = $this->obf_66t7uykYuSmamOu7SsjpuYtLCvhbE($new);
- }
- }
- if (isset($filters['stock'])) {
- $parsed['filter_stock'] = $this->obf_66t7uykYuSmamOu7SsjpuYtLCvhbE($filters['stock']);
- }
- if (isset($filters['spc'])) {
- if ($filters['spc'] === 'true') {
- $parsed['filter_special'] = true;
- }
- else if ($filters['spc'] === 'false') {
- $parsed['filter_special'] = false;
- }
- else {
- $parsed['filter_special'] = $this->obf_66t7uykYuSmamOu7SsjpuYtLCvhbE($filters['spc']);
- }
- }
- if (isset($filters['rtng'])) {
- $parsed['filter_rating'] = $this->obf_66t7uykYuSmamOu7SsjpuYtLCvhbE($filters['rtng']);
- }
- if (!empty($filters['tag']) && empty($parsed['filter_name']) && empty($parsed['filter_tag'])) {
- $parsed['filter_tag'] = $this->obf_66t7uykYuSmamOu7SsjpuYtLCvhbE($filters['tag']);
- }
- if (isset($filters['model'])) {
- if (is_array($filters['model'])) {
- $parsed['filter_model'] = $this->obf_7qqiZipoawo5KNoqWSi4qoayrrE($filters['model']);
- }
- else {
- $parsed['filter_model'] = $this->obf_66t7uykYuSmamOu7SsjpuYtLCvhbE($filters['model']);
- }
- }
- if (!empty($filters['sku'])) {
- $parsed['filter_sku'] = $this->obf_66t7uykYuSmamOu7SsjpuYtLCvhbE($filters['sku']);
- }
- if (!empty($filters['upc'])) {
- $parsed['filter_upc'] = $this->obf_66t7uykYuSmamOu7SsjpuYtLCvhbE($filters['upc']);
- }
- if (!empty($filters['ean'])) {
- $parsed['filter_ean'] = $this->obf_66t7uykYuSmamOu7SsjpuYtLCvhbE($filters['ean']);
- }
- if (!empty($filters['jan'])) {
- $parsed['filter_jan'] = $this->obf_66t7uykYuSmamOu7SsjpuYtLCvhbE($filters['jan']);
- }
- if (!empty($filters['isbn'])) {
- $parsed['filter_isbn'] = $this->obf_66t7uykYuSmamOu7SsjpuYtLCvhbE($filters['isbn']);
- }
- if (!empty($filters['mpn'])) {
- $parsed['filter_mpn'] = $this->obf_66t7uykYuSmamOu7SsjpuYtLCvhbE($filters['mpn']);
- }
- if (!empty($filters['man']) && empty($parsed['filter_manufacturer_id'])) {
- $parsed['filter_manufacturer_id'] = $this->obf_66t7uykYuSmamOu7SsjpuYtLCvhbE($filters['man']);
- }
- if (!empty($filters['ctg'])) {
- $parsed['filter_category'] = $this->obf_66t7uykYuSmamOu7SsjpuYtLCvhbE($filters['ctg']);
- }
- if (!empty($filters['fil']) && empty($parsed['filter_filter']) && version_compare(VERSION, '1.5.5', '>=')) {
- $parsed['filter_filter'] = $this->obf_7qqiZipoawo5KNoqWSi4qoayrrE($filters['fil']);
- }
- if (!empty($filters['attr'])) {
- $parsed['filter_attributes'] = $this->obf_7qqiZipoawo5KNoqWSi4qoayrrE($filters['attr']);
- }
- if (!empty($filters['opt'])) {
- $parsed['filter_options'] = $this->obf_7qqiZipoawo5KNoqWSi4qoayrrE($filters['opt']);
- }
- if (isset($filters['lgth'])) {
- $parsed['filter_length'] = $this->obf_6qnk4KujIeosZaVwJ2XpJGNjLOznLE($filters['lgth'])[0];
- $parsed['length_decimals'] = $this->obf_6qnk4KujIeosZaVwJ2XpJGNjLOznLE($filters['lgth'])[1];
- }
- if (isset($filters['wdth'])) {
- $parsed['filter_width'] = $this->obf_6qnk4KujIeosZaVwJ2XpJGNjLOznLE($filters['wdth'])[0];
- $parsed['width_decimals'] = $this->obf_6qnk4KujIeosZaVwJ2XpJGNjLOznLE($filters['wdth'])[1];
- }
- if (isset($filters['hght'])) {
- $parsed['filter_height'] = $this->obf_6qnk4KujIeosZaVwJ2XpJGNjLOznLE($filters['hght'])[0];
- $parsed['height_decimals'] = $this->obf_6qnk4KujIeosZaVwJ2XpJGNjLOznLE($filters['hght'])[1];
- .................................................................
- .....................................
- ...............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement