This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<modification> | |
<name>Extended layout</name> | |
<version>1.2.3</version> | |
<author>halfhope</author> | |
<code>extended_layout</code> | |
<link>https://shth.me/</link> | |
<file path="admin/view/template/design/layout_form.twig"> | |
<!-- add popup form --> | |
<operation error="skip"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// opencart 2.3, 3.x | |
private $_route = 'extension/module/pmp'; | |
private $_model = 'model_extension_module_pmp'; | |
$class_name = preg_replace('/[^a-zA-Z0-9]/', '', $this->_model); | |
if (is_callable([$class_name, 'getCachePrecomputedParams'])) { | |
$result = $this->{$this->_model}->getCachePrecomputedParams(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// generate sample of symmetry set (matrix) | |
$samlpes = []; | |
$items = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; | |
foreach ($items as $k => $v) { | |
foreach ($items as $k2 => $v2) { | |
$samples[$k][$k2] = abs($v - $v2); | |
} | |
} | |
// init symmetric set storage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$st = $this->db->query("SELECT product_id FROM oc_product WHERE 1"); | |
// Categories | |
$this->load->model('catalog/category'); | |
$this->load->model('catalog/product'); | |
$data['categories'] = $this->model_catalog_category->getAllCategories(); | |
$filtered_categories = array(); | |
function cmp($a, $b) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function getProductAttributes($product_id) { | |
$product_attribute_group_data = array(); | |
$product_attribute_group_query = $this->db->query("SELECT a.attribute_id, ad.name as attribute_name, pa.text, ag.attribute_group_id, agd.name as attribute_group_name FROM " . DB_PREFIX . "product_attribute pa | |
LEFT JOIN " . DB_PREFIX . "attribute a ON (pa.attribute_id = a.attribute_id) | |
LEFT JOIN " . DB_PREFIX . "attribute_description ad ON (a.attribute_id = ad.attribute_id) | |
LEFT JOIN " . DB_PREFIX . "attribute_group ag ON (a.attribute_group_id = ag.attribute_group_id) | |
LEFT JOIN " . DB_PREFIX . "attribute_group_description agd ON (ag.attribute_group_id = agd.attribute_group_id) | |
WHERE pa.product_id = " . (int)$product_id . " | |
AND ad.language_id = agd.language_id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function getProductOptions($product_id) { | |
$product_option_data = array(); | |
$product_option_query = $this->db->query("SELECT pov.product_option_value_id, pov.option_value_id, ovd.name as product_option_value_name, od.name as option_name, ov.image, pov.quantity, pov.subtract, pov.price, pov.price_prefix, pov.points, pov.points_prefix, pov.weight, pov.weight_prefix, pov.product_option_id, pov.option_id, o.type, po.required | |
FROM " . DB_PREFIX . "product_option_value pov | |
LEFT JOIN " . DB_PREFIX . "option_value ov ON (pov.option_value_id = ov.option_value_id) | |
LEFT JOIN " . DB_PREFIX . "option_value_description ovd ON (ov.option_value_id = ovd.option_value_id) | |
LEFT JOIN " . DB_PREFIX . "product_option po ON (pov.product_option_id = po.product_option_id) | |
LEFT JOIN `" . DB_PREFIX . "option` o ON (po.option_id = o.option_id) | |
LEFT JOIN " . DB_PREFIX . "option_description od ON (o.option_id = od.option_id) | |
WHERE po.product |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected function getProductOptions($product_id) { | |
$product_option_query = $this->db->query("SELECT po.product_option_id, po.option_id, od.name as option_name, ovd.name as product_option_value_name, o.type, po.required | |
FROM " . DB_PREFIX . "product_option_value pov | |
LEFT JOIN " . DB_PREFIX . "option_value ov ON (pov.option_value_id = ov.option_value_id) | |
LEFT JOIN " . DB_PREFIX . "option_value_description ovd ON (ov.option_value_id = ovd.option_value_id) | |
LEFT JOIN " . DB_PREFIX . "product_option po ON (pov.product_option_id = po.product_option_id) | |
LEFT JOIN `" . DB_PREFIX . "option` o ON (po.option_id = o.option_id) | |
LEFT JOIN " . DB_PREFIX . "option_description od ON (o.option_id = od.option_id) | |
WHERE pov.product_id = " . (int)$product_id); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |