Skip to content

Instantly share code, notes, and snippets.

View IP-CAM's full-sized avatar

Ernie IP-CAM

View GitHub Profile
@IP-CAM
IP-CAM / discount_interactive.xml
Last active May 23, 2021 18:57 — forked from eapdob/discount_interactive.xml
Product discount options
<?xml version="1.0" encoding="utf-8"?>
<modification>
<name>Product discount options</name>
<version>1.0.0</version>
<link>https://e-m.com.ua</link>
<author>em</author>
<code>product_discount_options</code>
<file path="catalog/model/catalog/product.php">
<operation error="skip">
<search><![CDATA[$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_discount WHERE product_id = '" . (int)$product_id . "' AND customer_group_id = '" . (int)$this->config->get('config_customer_group_id') . "' AND quantity > 1 AND ((date_start = '0000-00-00' OR date_start < NOW()) AND (date_end = '0000-00-00' OR date_end > NOW())) ORDER BY quantity ASC, priority ASC, price ASC");]]></search>
@IP-CAM
IP-CAM / remove all opencart products
Created May 23, 2021 18:56 — forked from eapdob/remove all opencart products
remove all opencart products - sql
DELETE t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15
FROM `oc_product` t1
LEFT JOIN `oc_product_attribute` t2 ON(t1.product_id=t2.product_id)
LEFT JOIN `oc_product_description` t3 ON(t1.product_id=t3.product_id)
LEFT JOIN `oc_product_discount` t4 ON(t1.product_id=t4.product_id)
@IP-CAM
IP-CAM / index.php
Created April 7, 2020 17:04
Product Import from csv to Opencart's database. Using native Opencart API
<?php
ini_set ("display_errors", 1);
$start_time = microtime(true);
// Configuration
if (file_exists('config.php')) {
require_once('config.php');
} else {
die("Config file is not exists");
@IP-CAM
IP-CAM / opencartBasics
Created April 7, 2020 17:02 — forked from slonyaka/opencartBasics
OpencartBasics
CACHE
$this->cache->delete($key) - Deletes cache [product, category, country, zone, language, currency,
manufacturer]
CART
$this->cart->getProducts() Gets all products currently in the cart including options, discounted prices, etc.
$this->cart->add( $product_id, $qty = 1, $options = array()) - Allows you to add a product to the cart
$this->cart->remove( $key ) - Allows you to remove a product from the cart
$this->cart->clear() - Allows you to remove all products from the cart
$this->cart->getWeight() - Sum of the weight of all products in the cart that have require shipping set to Yes
$this->cart->getSubTotal() - returns the subtotal of all products added together before tax
@IP-CAM
IP-CAM / encryption.php
Created April 3, 2020 22:52 — forked from giulianoriccio/encryption.php
opencart 1.5.6.4 PHP 7.2+
<?php
final class Encryption {
private $key;
public function __construct($key) {
$this->key = hash('sha256', $key, true);
}
public function encrypt($value) {
return strtr(base64_encode(openssl_encrypt($value, 'aes-128-cbc', $this->key)), '+/=', '-_,');
@IP-CAM
IP-CAM / fontawesome4to5.js
Created August 23, 2019 22:20 — forked from timint/fontawesome4to5.js
Migrate Fontawesome 4 to 5 using jQuery (For the CSS Webfont version)
/*
* Migrate Fontawesome 4 to Fontawesome 5
* @website https://www.litecart.net/
*/
(function(){
var icons = {
"fa-500px": "fab fa-500px",
"fa-address-book-o": "far fa-address-book",
"fa-address-card-o": "far fa-address-card",
{
_id: ObjectId("51174626b173c26d4d000006"),
product_description: {
name: "iPod Nano",
meta_description: "",
meta_keyword: "",
description: "&lt;div&gt;\r\n\t&lt;p&gt;\r\n\t\t&lt;strong&gt;Video in your pocket.&lt;/strong&gt;&lt;/p&gt;\r\n\t&lt;p&gt;\r\n\t\tIts the small iPod with one very big idea: video. The worlds most popular music player now lets you enjoy movies, TV shows, and more on a two-inch display thats 65% brighter than before.&lt;/p&gt;\r\n\t&lt;p&gt;\r\n\t\t&lt;strong&gt;Cover Flow.&lt;/strong&gt;&lt;/p&gt;\r\n\t&lt;p&gt;\r\n\t\tBrowse through your music collection by flipping through album art. Select an album to turn it over and see the track list.&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/p&gt;\r\n\t&lt;p&gt;\r\n\t\t&lt;strong&gt;Enhanced interface.&lt;/strong&gt;&lt;/p&gt;\r\n\t&lt;p&gt;\r\n\t\tExperience a whole new way to browse and view your music and video.&lt;/p&gt;\r\n\t&lt;p&gt;\r\n\t\t&lt;strong&gt;Sleek and colorful.&lt;/strong&gt;&lt;/p&gt;
@IP-CAM
IP-CAM / common_home_link.xml
Created June 19, 2019 04:23 — forked from SammyLin/common_home_link.xml
opencart common_home_link remove index.php?route=common/home
@IP-CAM
IP-CAM / minify.php
Created March 18, 2019 00:14 — forked from timw4mail/minify.php
HTML Minification
<?php
define('SAFE', 1);
define('EXTREME', 2);
define('EXTREME_SAVE_COMMENTS', 4);
define('EXTREME_SAVE_PRE', 3);
function minify($html, $level=2)
{
switch((int)$level)
@IP-CAM
IP-CAM / .htaccess
Created March 4, 2019 22:21 — forked from seoagentur-hamburg/.htaccess
UPDATE 2019: Perfect .htaccess file for highspeed and security. You can use it for every WordPress-Website without problems. Highspeed and Security - testet on hundreds of Websites. If you are using a WordPress Multisite, change the last part of this file.
########################################################################
# OPTIMAL .htaccess FILE FOR SPEED AND SECURITY @Version 2019
# ----------------------------------------------------------------------
# @Author: Andreas Hecht
# @Author URI: https://andreas-hecht.com
# License: GNU General Public License v2 or later
# License URI: http://www.gnu.org/licenses/gpl-2.0.html
########################################################################