Skip to content

Instantly share code, notes, and snippets.

View NateJLewis's full-sized avatar
🎯
Focusing

Nate Lewis NateJLewis

🎯
Focusing
View GitHub Profile
@NateJLewis
NateJLewis / oc_cart_lib
Created May 14, 2015 23:46
OpenCart - Cart Lib
<?php
class Cart {
private $config;
private $db;
private $data = array();
public function __construct($registry) {
$this->config = $registry->get('config');
$this->customer = $registry->get('customer');
$this->session = $registry->get('session');
@NateJLewis
NateJLewis / old_cart.php
Created May 16, 2015 00:42
This is the old cart...if you look on line 47 you can see where I started editing it...maybe I should continue down that road??
public function add() {
$this->load->language('checkout/cart');
$json = array();
if (isset($this->request->post['product_id'])) {
$product_id = (int)$this->request->post['product_id'];
} else {
$product_id = 0;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
<title>Teestyle</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="apple-touch-icon" sizes="57x57" href="/themes/third_party/teestyle/img/favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/themes/third_party/teestyle/img/favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/themes/third_party/teestyle/img/favicons/apple-touch-icon-72x72.png">
@NateJLewis
NateJLewis / add-hidden-to-all-active-to-first
Created July 9, 2015 20:30
jQuery-selection-iteration-issue
// ok here is my issue...
// I am trying to add hidden to all the .product-image div's then add .active to the first one
// each set is nested in a tr td...
// ALL the .product-image end up with .active
// when I do this -->
$(document).ready(function() {
var productImg = $('.product-image'),
campaignRow = $('.campaign-row'),
oddRowProductImg = $('tr.odd .product-image'),
<?php
ee()->load->helper('url');
if(!ee()->uri->segment(3))
{
redirect("production");
}
$segment_3 = ee()->uri->segment(3);
@NateJLewis
NateJLewis / ez_on_mobile
Created July 22, 2015 14:48
elevateZoom on mobile
(function (a) {
var img = $(".product-viewport .full-shirt");
// ZACK: looking at - https://github.com/elevateweb/elevatezoom/issues/8 (horvathantal commented on Apr 28) at the bottom of the page
// it says:
// 1) create elevateZoom
// 2) destroy (remove / remove data attribute rather)
// 3) recreate
// but if I use an else wouldn't that be sufficient as below
@NateJLewis
NateJLewis / goal.html
Last active August 29, 2015 14:27
goals.html
<!--PUT THIS IN PLACE OF THE NAVBAR-HEADER :) -->
<div class="navbar-header">
<a class="navbar-brand logo" href="http://dev.teestyle.com:81/">
<img class="logo_img logo_tee" src="http://dev.teestyle.com:81/themes/third_party/teestyle/img/logo/logo_tee.png" alt="Teestyle">
<img class="logo_img logo_letters" src="http://dev.teestyle.com:81/themes/third_party/teestyle/img/logo/logo_letters.png">
</a>
</div>
<!--All I did was remove the title from the form and put it in its own row :) -->
<div class="stage">
@NateJLewis
NateJLewis / date_range_picker.js
Created August 17, 2015 16:45
date_range_picker for teestyle
var details_form = $("form#campaign_details");
var campaign_end_date_input = $("input#campaign_end_date");
var select_five_days = $("#campaign_end_date_range #five_days");
var select_seven_days = $("#campaign_end_date_range #seven_days");
var select_ten_days = $("#campaign_end_date_range #ten_days");
var select_fourteen_days = $("#campaign_end_date_range #fourteen_days");
var select_twentyone_days = $("#campaign_end_date_range #twentyone_days");
var campaign_end_date_picker = $("button#campaign_end_date_picker");
var find_date_range_span = $("span.date_range");
var date_range_template_start = '<span class="hidden-xs hidden-sm date_type">Campaign Ending: </span><span class="date">';
@NateJLewis
NateJLewis / goals_active_styles.json
Created August 19, 2015 16:14
Goals Active Style JSON
{
"field_id_8":"store",
"product_details[price]":"0",
"product_details[weight]":"0",
"ct_order":"1",
"style[]":[
"Classic Tee",
"V-Neck Tee"
],
"ct_instructions":"Pick A Style",
@NateJLewis
NateJLewis / order_form.php
Created August 23, 2015 22:44
order form nested loop
ee()->load->helper('url');
if(!ee()->uri->segment(3))
{
redirect("production");
}
$q = ee()->db->query("call get_order_count(".ee()->uri->segment(3).")");
$result = $q->result_array();
$q->next_result();
$q->free_result();