Skip to content

Instantly share code, notes, and snippets.

View dubrod's full-sized avatar

Wayne Roddy dubrod

View GitHub Profile
@dubrod
dubrod / Magento Advanced Import Dataflow SQL Database
Last active December 17, 2015 08:29
Here I have exported my Magento Advanced Import Dataflow Empty SQL Database. I wrote a PHP application to take values from various sources to create this master sheet. I then exported as csv and imported with no problems using the System->Import->Advanced Dataflows inside Magento
CREATE TABLE `master` (
`mst_id` int(100) NOT NULL AUTO_INCREMENT,
`store` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`websites` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`attribute_set` varchar(75) COLLATE utf8_unicode_ci NOT NULL,
`type` varchar(75) COLLATE utf8_unicode_ci NOT NULL,
`category_ids` int(50) NOT NULL,
`sku` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`has_options` int(50) NOT NULL,
`name` varchar(300) COLLATE utf8_unicode_ci NOT NULL,
@dubrod
dubrod / Magento Custom XML Sitemap Creator
Created May 15, 2013 18:02
Get Collections for products, categories, and pages. Filter them, use any custom PHP you like and create an XML file. Couldn't find it so I built it. Very useful for carts that only have configurable "main" products and don't want all the bits and pieces "simple products" showing in the sitemap. 1. create a my_sitemap.xml to be overwritten. 2. K…
<?php
/* Compilation includes configuration file */
define('MAGENTO_ROOT', getcwd());
$compilerConfig = MAGENTO_ROOT . '/includes/config.php';
if (file_exists($compilerConfig)) {
include $compilerConfig;
}
$mageFilename = MAGENTO_ROOT . '/app/Mage.php';
@dubrod
dubrod / Using Radio Buttons on Color Selector Plus for Magento
Last active February 19, 2018 14:38
Configurable.phtml File for Magento that will switch SELECT to RADIO Buttons. Some customization required. This is not an automated extension but rather a hack. Working on a live site and tested on Magento 1.7 -- Full Instructions will be available on our blog, http://www.revitalagency.com/blog This file is at: template/colorselectorplus/catalog…
<?php
$_product = $this->getProduct();
$_attributes = Mage::helper('core')->decorateArray($this->getAllowAttributes());
$swatch_attributes = Mage::helper('colorselectorplus')->getSwatchAttributes();
$title = Mage::getStoreConfig('color_selector_plus/colorselectorplusgeneral/title', Mage::app()->getStore());
$hide = Mage::getStoreConfig('color_selector_plus/colorselectorplusgeneral/hidedropdown', Mage::app()->getStore());
?>
<?php if ($_product->isSaleable() && count($_attributes)): ?>
<dl>
@dubrod
dubrod / Run a PHP or jQuery Function after jQuery UI Dialog Confirmation
Created August 23, 2013 17:08
Run a PHP or jQuery Function after jQuery UI Dialog Confirmation. You can read the supporting article at : https://www.revitalagency.com/blog/run-a-php-or-jquery-function-after-jquery-ui-dialog-confirmation/
<script>
$(function() {
//run function after jquery dialong confirm
//step 1 - the action
$(".deleteBtn").click(function(e) {
e.preventDefault();
pid = $(this).attr("title"); // the id of the photo i want to delete
//console.log($(this).attr("title")); // check you get it first
@dubrod
dubrod / jQuery Over 21 Dialog Checker
Last active January 25, 2016 14:09
Completely jQuery Over 21 Dialog Check
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Over 21 script</title>
<style type="text/css">
#ageCheckWrapper{
@dubrod
dubrod / Call Google Geocoding API with jQuery
Created August 30, 2013 17:32
Call the Google Geocoding API with jQuery. Get the formatted address, the LAT & LONG, the County, all the official google map data for an address.
<label>Street Address #: <small>123</small></label><br>
<input type="text" id="stAddNum"><br>
<label>Street Address Name: <small>Elm</small></label><br>
<input type="text" id="stAdd"><br>
<label>Address Type: <small>St, Ave, Ln, Rd, etc</small></label><br>
<input type="text" id="stAddPrefix"><br>
<label>City: </label><br>
<input type="text" id="city"><br>
<label>State: <small>Abbreviation</small></label><br>
<input type="text" id="state"><br>
@dubrod
dubrod / zap-banner-engine
Last active August 29, 2015 13:58
Zap Banner Engine
<?php
//BOOSTRAP FILE CODE
//ZAP Banner Engine
include_once('zap.banner.engine.php');
$ZAP_banner_engine = new ZAP_banner_engine;
$banner_html = $ZAP_banner_engine->get_unseen();
?>
<?php
@dubrod
dubrod / jquery-device-detect
Created June 17, 2014 15:59
jQuery Device Detect via User Agent
//touch/mobile detection
if (
navigator.userAgent.match(/Phone/i) ||
navigator.userAgent.match(/DROID/i) ||
navigator.userAgent.match(/Android/i) ||
navigator.userAgent.match(/webOS/i) ||
navigator.userAgent.match(/iPhone/i) ||
navigator.userAgent.match(/iPod/i) ||
navigator.userAgent.match(/BlackBerry/) ||
navigator.userAgent.match(/Windows Phone/i) ||
@dubrod
dubrod / gist:3e6276350bd5ee27f232
Created December 14, 2015 19:15
Firebase DB to Static File for React JS
// first you have included your FireBase client JS
var leaguesNode = new Firebase("https://XXXX.firebaseio.com/Leagues");
jsonLeagues = '{"leagues": []}';
leaguesNode.once("value", function(snapshot) {
snapshot.forEach(function(childSnapshot) {
var key = childSnapshot.key();
var val = childSnapshot.val();
@dubrod
dubrod / Commonly Used MODX Head Tags
Last active January 7, 2019 17:51
Commonly Used MODX Head Tags for use in my Public Snapshots
<title>[[*pagetitle]]</title>
<title>[[*longtitle:default=`[[*pagetitle]]`]]</title>
<meta name="description" content="[[*description]]">
<meta name="keywords" content="[[*keywords]]">
<meta itemprop="url" content="[[~[[*id? &scheme=`full`]]]]">
<meta itemprop="name headline" content="[[*pagetitle]]">
<meta itemprop="description" content="[[*description]]">
<meta itemprop="image" content="">
<!-- Twitter -->