This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script> | |
<script type="text/javascript"> | |
jQuery.cookie = function(name, value, options) { | |
// @author Klaus Hartl/[email protected] | |
if (typeof value != 'undefined') { | |
options = options || {}; | |
if (value === null) { | |
value = ''; | |
options.expires = -1; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- assuming Magento 1.6.1 data model | |
SELECT DISTINCT customer_email, | |
COUNT(*) AS purchases, | |
(SELECT LEFT(created_at,11) FROM `sales_flat_order` WHERE customer_email = a.customer_email ORDER BY created_at DESC LIMIT 0,1) AS last_purchase, | |
(SELECT COUNT(*) FROM sales_flat_order_item WHERE product_type = 'simple' AND sku LIKE '%IB%' AND order_id IN (SELECT entity_id FROM `sales_flat_order` WHERE customer_email = a.customer_email)) AS icebreaker, | |
(SELECT COUNT(*) FROM sales_flat_order_item WHERE product_type = 'simple' AND sku LIKE '%TNF%' AND order_id IN (SELECT entity_id FROM `sales_flat_order` WHERE customer_email = a.customer_email)) AS the_north_face, | |
(SELECT COUNT(*) FROM sales_flat_order_item WHERE product_type = 'simple' AND sku LIKE '%MHW%' AND order_id IN (SELECT entity_id FROM `sales_flat_order` WHERE customer_email = a.customer_email)) AS mountain_hardwear, | |
(SELECT COUNT(*) FROM sales_flat_order_item WHERE product_type = 'simple' AND sku LIKE '%MAR%' AND order_id IN (SELECT entity_id FROM `sales |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/****** Object: StoredProcedure [dbo].[sproc_exportObjectToCSV] Script Date: 03/02/2012 21:00:39 ******/ | |
SET ANSI_NULLS ON | |
GO | |
SET QUOTED_IDENTIFIER ON | |
GO | |
sp_configure 'Ad Hoc Distributed Queries', 1; | |
RECONFIGURE; | |
GO |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT b.email, c.value AS name, a.updated_at, d.added_at, d.product_id, e.name, SUM(g.qty_ordered) AS purchased | |
FROM `wishlist` AS a | |
INNER JOIN customer_entity AS b ON a.customer_id = b.entity_id | |
INNER JOIN customer_entity_varchar AS c ON a.customer_id = c.entity_id AND c.attribute_id = (SELECT attribute_id FROM eav_attribute WHERE attribute_code = 'firstname' AND entity_type_id = b.entity_type_id) | |
INNER JOIN wishlist_item AS d ON a.wishlist_id = d.wishlist_id | |
INNER JOIN catalog_product_flat_1 AS e ON d.product_id = e.entity_id | |
LEFT JOIN sales_flat_order AS f ON f.customer_email = b.email | |
LEFT JOIN sales_flat_order_item AS g ON (f.entity_id = g.order_id AND g.sku LIKE CONCAT(e.sku,'%') AND g.product_type = 'simple') | |
GROUP BY b.email, c.value, a.updated_at, d.added_at, d.product_id, e.name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Zyn_Common_Block_Adminhtml_Catalog_Product_Grid extends Mage_Adminhtml_Block_Catalog_Product_Grid { | |
protected function _prepareColumns() { | |
$this->addColumn('zyn_featured', | |
array( | |
'header'=> 'Show on Homepage', | |
'width' => '50px', | |
'index' => 'zyn_featured', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Zyn_Common_Block_Adminhtml_Catalog_Product_Grid extends Mage_Adminhtml_Block_Catalog_Product_Grid { | |
protected function _prepareColumns() { | |
$this->addColumn('zyn_featured', | |
array( | |
'header'=> 'Show on Homepage', | |
'width' => '50px', | |
'index' => 'zyn_featured', | |
'type' => 'options', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<input type="hidden" name="uenc" value="<?= Mage::helper('core')->urlEncode(Mage::app()->getStore()->getBaseUrl() . 'your_page_url_key') ?>"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<config> | |
<modules> | |
<Dg_Pricerulesextended> | |
<version>0.1</version><platform>ce</platform> | |
</Dg_Pricerulesextended> | |
</modules> | |
<global> | |
<models> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Dg_Pricerulesextended_Model_Observer { | |
public function newsletterSubscriberSave(Varien_Event_Observer $observer) { | |
$helper = Mage::helper('pricerulesextended'); | |
$subscriber = $observer->getEvent()->getSubscriber(); | |
$email = $subscriber->getEmail(); | |
$promo_value = Mage::getStoreConfig('pricerulesextended/promocode/dollarvalue'); | |
$promo_min = Mage::getStoreConfig('pricerulesextended/promocode/minpurchase'); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Dg_Pricerulesextended_GenerateController extends Mage_Core_Controller_Front_Action | |
{ | |
public function promocodeAction() { | |
$helper = Mage::helper('pricerulesextended'); | |
$params = $this->getRequest()->getParams(); | |
$email = $params['email']; | |
$email = explode(',',$email); | |
$email = $email[0]; |