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 / cache_category_data.xml
Created February 27, 2018 19:16 — forked from weismannweb/cache_category_data.xml
Caches category data for Opencart to make it faster. Opencart installs with alot of categories are really slow. http://forum.opencart.com/viewtopic.php?f=161&t=126241
<modification>
<id>Cache category data to speed up page load for store with many categories and sub categories.</id>
<version>1.0.1</version>
<vqmver>2.3.2</vqmver>
<author>Weismann Web - www.weismannweb.com</author>
<file name="catalog/controller/module/category.php">
<operation>
<search position="after"><![CDATA[
@IP-CAM
IP-CAM / indexes_to_add.sql
Created April 23, 2018 17:00 — forked from mitio/indexes_to_add.sql
OpenCart SQL profiler and indexes for improved speed and page load time. Requires vqMod to be installed. Place it in <project-root>/vqmod/xml/ and that's it. Copy and paste the indexes once in PhpMyAdmin, in the database for your store.
-- Add these to speed up OpenCart
ALTER TABLE `oc_product` ADD INDEX(`date_available`, `status`);
ALTER TABLE `oc_product` ADD INDEX(`status`);
ALTER TABLE `oc_url_alias` ADD UNIQUE(`query`);
ALTER TABLE `oc_product_to_store` ADD INDEX(`store_id`);
ALTER TABLE `oc_category_path` ADD INDEX(`path_id`, `category_id`);
ALTER TABLE `oc_category_path` ADD INDEX(`category_id`, `path_id`);
ALTER TABLE `oc_product_description` ADD INDEX(`language_id`);
ALTER TABLE `oc_category` ADD INDEX (`parent_id`, `status`, `sort_order`);
ALTER TABLE `oc_category` ADD INDEX(`sort_order`);
@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 / 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
{
_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 / 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",
@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 / 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 / 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 / .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
########################################################################