first commit

This commit is contained in:
sujan
2024-08-06 18:06:00 +05:45
commit a2fa49071a
2745 changed files with 391199 additions and 0 deletions

View File

@ -0,0 +1,19 @@
<?php
namespace Opencart\Catalog\Model\Design;
/**
* Class Banner
*
* @package Opencart\Catalog\Model\Design
*/
class Banner extends \Opencart\System\Engine\Model {
/**
* @param int $banner_id
*
* @return array
*/
public function getBanner(int $banner_id): array {
$query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "banner` b LEFT JOIN `" . DB_PREFIX . "banner_image` bi ON (b.`banner_id` = bi.`banner_id`) WHERE b.`banner_id` = '" . (int)$banner_id . "' AND b.`status` = '1' AND bi.`language_id` = '" . (int)$this->config->get('config_language_id') . "' ORDER BY bi.`sort_order` ASC");
return $query->rows;
}
}

View File

@ -0,0 +1,35 @@
<?php
namespace Opencart\Catalog\Model\Design;
/**
* Class Layout
*
* @package Opencart\Catalog\Model\Design
*/
class Layout extends \Opencart\System\Engine\Model {
/**
* @param string $route
*
* @return int
*/
public function getLayout(string $route): int {
$query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "layout_route` WHERE '" . $this->db->escape($route) . "' LIKE `route` AND `store_id` = '" . (int)$this->config->get('config_store_id') . "' ORDER BY `route` DESC LIMIT 1");
if ($query->num_rows) {
return (int)$query->row['layout_id'];
} else {
return 0;
}
}
/**
* @param int $layout_id
* @param string $position
*
* @return array
*/
public function getModules(int $layout_id, string $position): array {
$query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "layout_module` WHERE `layout_id` = '" . (int)$layout_id . "' AND `position` = '" . $this->db->escape($position) . "' ORDER BY `sort_order`");
return $query->rows;
}
}

View File

@ -0,0 +1,31 @@
<?php
namespace Opencart\Catalog\Model\Design;
/**
* Class Seo Url
*
* @package Opencart\Catalog\Model\Design
*/
class SeoUrl extends \Opencart\System\Engine\Model {
/**
* @param string $keyword
*
* @return array
*/
public function getSeoUrlByKeyword(string $keyword): array {
$query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "seo_url` WHERE (`keyword` = '" . $this->db->escape($keyword) . "' OR `keyword` LIKE '" . $this->db->escape('%/' . $keyword) . "') AND `store_id` = '" . (int)$this->config->get('config_store_id') . "' LIMIT 1");
return $query->row;
}
/**
* @param string $key
* @param string $value
*
* @return array
*/
public function getSeoUrlByKeyValue(string $key, string $value): array {
$query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "seo_url` WHERE `key` = '" . $this->db->escape($key) . "' AND `value` = '" . $this->db->escape($value) . "' AND `store_id` = '" . (int)$this->config->get('config_store_id') . "' AND `language_id` = '" . (int)$this->config->get('config_language_id') . "'");
return $query->row;
}
}

View File

@ -0,0 +1,19 @@
<?php
namespace Opencart\Catalog\Model\Design;
/**
* Class Theme
*
* @package Opencart\Catalog\Model\Design
*/
class Theme extends \Opencart\System\Engine\Model {
/**
* @param string $route
*
* @return array
*/
public function getTheme(string $route): array {
$query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "theme` WHERE `store_id` = '" . (int)$this->config->get('config_store_id') . "' AND `route` = '" . $this->db->escape($route) . "'");
return $query->row;
}
}

View File

@ -0,0 +1,19 @@
<?php
namespace Opencart\Catalog\Model\Design;
/**
* Class Translation
*
* @package Opencart\Catalog\Model\Design
*/
class Translation extends \Opencart\System\Engine\Model {
/**
* @param string $route
*
* @return array
*/
public function getTranslations(string $route): array {
$query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "translation` WHERE `store_id` = '" . (int)$this->config->get('config_store_id') . "' AND `language_id` = '" . (int)$this->config->get('config_language_id') . "' AND `route` = '" . $this->db->escape($route) . "'");
return $query->rows;
}
}