Skip to content

Instantly share code, notes, and snippets.

View gist:cfe445facd8f22a2a8c3

Josh is a catalyst within the Magento community, having started MageUnity (a forum for discussing community issues), released open source addons to N98-MageRun, as well as a load testing tool for Magento 2. He's also working to release a book on Magento 2, has given a number of talks on test-driven development and deployment best practices, and is continually leading and encouraging innovation in the community.

View gist:1af4582ec82f38e475ed

I'd like to throw my hat into the ring here and mention a few specific features that you may be interested in around the topic of discounts via email.

Rely upon Magento core auto-generated coupon codes - Some extensions sort of work around the core auto generated coupon code functionality and this can introduce unnecessary complexities.

Include the coupon code in the email - In addition to a link that magically associates the discount to the shopping cart, it's good to have the coupon included in the email as well as a fall back. That way if they want to place an order over the phone they have the coupon and can give it to the customer service rep.

Magically apply the coupon code - While the manual coupon code is a nice fallback, you want to automatically apply the discount as well, which is the main feature that you're asking about here.

Remind the customer they've unlocked a coupon - Even if the coupon has been applied to their cart, it may not be obvious to them that that has happened, so yo

View post.html
<p><strong>If you're not yet using triggered email as part of your marketing strategy, it's quite an effective incremental revenue stream that you may want to consider.</strong></p>
<h3>What is Triggered Email?</h3>
<p>Triggered email is any email that's sent to a customer or visitor to your store, which is triggered by some action the customer has take or event in their lifecycle.</p>
<p><em>An abandoned cart email is a good example of a triggered email</em> - a visitor gets to your store and begins to checkout but ends up abandoning the cart for one reason or another. This is an important point in the life cycle of that customer - reaching out to them with a timely email and perhaps a discount can help to save a lost customer.</p>
<p>Other examples of triggered email are:</p>
<li>Review requests</li>
<li>Product recommendations</li>
<li>New product announcements</li>
<li>Birthday or purchase anniversary emails</li>
View gist:5b47f7c6d91037d1e1b0
fswatch partial/ 'sassc app.scss > ../css/app.css'
View orders-with-category-data.sql
# Get the category name attribute id
SELECT attribute_id
FROM eav_attribute
WHERE entity_type_id = 3
AND attribute_code = 'name';
# Get recent orders with category data
SELECT o.created_at
, o.entity_id
, i.sku
View order-volume-by-hour.sql
SELECT count(*), date_format(date_sub(created_at, INTERVAL 7 HOUR), "%h %p PST")
FROM sales_flat_order
# WHERE created_at > date_sub(now(), INTERVAL 1 year)
GROUP BY date_format(date_sub(created_at, INTERVAL 7 HOUR), "%h %p PST")
ORDER BY date_format(date_sub(created_at, INTERVAL 7 HOUR), "%H") ASC
View Clean_Api_Model_Sales_Order_Api_Abstract.php
if ((string)Mage::getConfig()-&gt;getModuleConfig('Acme_OrderApi')-&gt;active == 'true') {
class Clean_Api_Model_Sales_Order_Api_Abstract extends Acme_OrderApi_Model_Order_Api { }
} else {
class Clean_Api_Model_Sales_Order_Api_Abstract extends Mage_Sales_Model_Order_Api { }
View Clean-Api-Model-Sales-Order-Api.php
class Clean_Api_Model_Sales_Order_Api extends Clean_Api_Model_Sales_Order_Api_Abstract
protected function _getAttributes($object, $type, array $attributes = null)
$result = parent::_getAttributes($object, $type, $attributes);
// Add properties to $result
return $result;

Easy Content Management for Magento

Wondering whether anything like this already exists out there already. What I want to do is allow content for static blocks and CMS pages to be defined in specific content blocks that have individual fields with the content in them.

So, when editing a CMS Page, you would have a list of N content blocks which each contain their own set of fields based on the schema definition for that particular content block.

For example, imagine a page that has a hero section at the top with a hero image + title + subtitle, then below it a simple set of paragraphs, then below that a feature image set with a grid of feature images that have image + name + description.

That would look like: