Skip to content

Instantly share code, notes, and snippets.

kalenjordan / repurchase-rate.sql
Last active Jan 1, 2016
Magento Repurchase Rate Note: This assumes you don't use guest checkout - if you do, you could probably group by customer_email and get relatively accurate results.
View repurchase-rate.sql
# The number of customers who haveve only purchased once from December 2012 to December 2013
SELECT customers_in_segment
SELECT count(*) AS customers_in_segment, order_count
SELECT customer_id, min(created_at) AS first_order_at, count(*) AS order_count
FROM sales_flat_order
kalenjordan /
Last active Aug 29, 2015
Magento Admin Gamification

Magento Admin Gamification

The Idea

The idea is to use gamification in the Magento backend to help to train admins who are new to using Magento with some kind of interactive tutorial along with earning points for doing things like updating their store address in system config and creating a new product, etc.

How Would It Work

Not totally sure, just a rough idea right now. But my thinking is - some combination of an interactive tutorial with points and badges earned for different actions.

kalenjordan / gist:9085832
Created Feb 19, 2014
3 Easy Steps To Get Rich Using SEO
View gist:9085832
1. Make something cool
2. Write stuff
3. Don't suck

For any problem that can be encountered in Magento, a solution has already been discovered by @philwinkle.

View bootstrap-example.html
<div class="block-item cleanse col-md-12 visible-desktop">
<div class="content">
<div class="clearfix">
<div class="program-image visible-phone-tablet">
<h3 class="visible-phone">Start Here</h3>
<img class="img-responsive" src="" alt="Clean Cleanse">
<div class="program-detail col-sm-6 col-md-6 col-lg-12">
<h3 class="hidden-phone">Start Here</h3>
<img class="visible-desktop center-block-element" src="" alt="Clean Cleanse">

Edit Content over the Frontend


Content editing is always a little bit of a hassle. Sometimes your team might not know where a given piece of content exists - whether in CMS Pages, Static Blocks, Product content, or static HTML.

The Idea

Give admins the ability to edit content directly through the frontend via something like a blogger-style interface (you guys remember the blogger days, right?).

The Featuh's

  • Load via AJAX after page load - only shows if the admin is viewing the page.
View custom-reports.sql
/* Here are some example custom report queries for use with the custom
* reports module
* Number of items in order
* Useful to find out whether customers are buying a given product
kalenjordan / admin-grid-status.js
Last active Aug 29, 2015
Gray out rows in a grid if a status column is inactive
View admin-grid-status.js
// Drop this javascript in the page where your grid is - maybe using a .phtml
// in before_body_end or whatever.
var statuses = document.querySelectorAll(".admin-autoemail-adminhtml-rule-index td");
[], function (status) {
if (status.textContent.indexOf("Inactive") > -1) {
status.up('tr').style.color = "#aaa";
status.up('tr').down('a').style.color = "#aaa";
tar --exclude="media" --exclude="includes" --exclude="var" -cvf var/files.tar .
View public-key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC2vHCsJ9mmtA2c7gSdmJtpL91tBPhdlKv3liIO/FLKUZugfNNv7p+p/xJ8ZUiEMPMYroaw4vAWu99wsRMiwCkoIExhQj5duNQaE0ZJmM/7fX3uTCICNdEQd7vS8vvoN0XelHRbmZ5Ut7ZXjRnc6v6uYnJEboZhtVLFD/sfbGmZ8Pz8HRi1K4U+YpTDf4CLVyiDd8byL6dJv4KMio/LngSkncaLHZcA959U9baomi/zziYCOFSy8QN9J7APefvodFYIhRD4ynOFeQwr96eJqfJU7a2Rf9kIrdEjbnteY6yE7EdQiifLiidRTdydgB5ZBdxyfmTp0Ay30c8t7zEHkTi7 kalenj@Kalens-Mac-mini.local