Skip to content

Instantly share code, notes, and snippets.

View amacgregor's full-sized avatar
:shipit:
Working on Side Projects

Allan MacGregor amacgregor

:shipit:
Working on Side Projects
View GitHub Profile
<?xml version="1.0"?>
<config>
<modules>
<Demac_Childsku>
<active>true</active>
<codePool>local</codePool>
</Demac_Childsku>
</modules>
</config>
<?php
/**
* Customerreviewimport.php
* CommerceExtensions @ InterSEC Solutions LLC.
*
* NOTICE OF LICENSE
*
* This source file is subject to the EULA
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
@amacgregor
amacgregor / Observer.php
Created October 13, 2011 16:35
checkout_cart_update_items_before
<?php
public function checkout_cart_update_items_before($observer)
{
$event = $observer->getEvent();
$products = $event->getInfo();
$customer = Mage::getSingleton('customer/session');
$items = $observer->getCart()->getQuote();
foreach($products as $key => $value){
$product = $items->getItemById($key);
@amacgregor
amacgregor / mageavcat.php
Created October 25, 2011 00:45 — forked from anonymous/mageavcat
Magento EAV Attribute for Category
INSERT INTO `eav_attribute` VALUES(132, 3, 'include_in_left_menu', NULL, NULL, 'int', NULL, NULL, 'select', 'Include in Left Navigation Menu', NULL, 'eav/entity_attribute_source_boolean', 0, 0, '1', 0, NULL);
<?php
$parentid = 3; //Parent category ID
$parentCat = Mage::getModel('catalog/category')->load($parentid);
$childCategories = explode(',',$parentCat->getChildren()); //Child category IDs separated by commas
?>
@amacgregor
amacgregor / config.xml
Last active December 16, 2015 13:39 — forked from anonymous/config
<?xml version="1.0"?>
<!--
/**
* @category Signifyd
* @package Signifyd_Connect
* @author Alex Manelis
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
-->
<config>
delimiter ;;
drop procedure if exists build_catalog;;
create procedure build_catalog(IN categories INT, IN products INT)
begin
SET @category_count = 1;
SET @CATNAMEPREFIX = "Category ";
SET @CATURLKEYPREFIX = "cat-";
SET @CATURLPATHPREFIX = "catpath-";
SET @ROOTCATEGORY = 2;
SET @INCLUDEINMENU = 1;
delimiter ;;
drop procedure if exists build_catalog;;
create procedure build_catalog(IN categories INT, IN products INT)
begin
SET @category_count = 1;
SET @CATNAMEPREFIX = "Category ";
SET @CATURLKEYPREFIX = "cat-";
SET @CATURLPATHPREFIX = "catpath-";
SET @ROOTCATEGORY = 2;
SET @INCLUDEINMENU = 1;

Project

Description: What does this project do and who does it serve?

Project Setup

How do I, as a developer, start working on the project?

  1. What dependencies does it have (where are they expressed) and how do I install them?
  2. How can I see the project working before I change anything?
var CreditCard = {
CARDS: {
Visa: /^4[0-9]{12}(?:[0-9]{3})?$/,
MasterCard: /^5[1-5][0-9]{14}$/,
DinersClub: /^3(?:0[0-5]|[68][0-9])[0-9]{11}$/,
Amex: /^3[47][0-9]{13}$/,
Discover: /^6(?:011|5[0-9]{2})[0-9]{12}$/
},
TEST_NUMBERS: $w('378282246310005 371449635398431 378734493671000 '+
'30569309025904 38520000023237 6011111111111117 '+
<?php
/**
* Simple Magento integration test PHPUnit bootstrap
*/
chdir(__DIR__ . '/../..');
$mageFile = 'htdocs/app/Mage.php';
umask(0);