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 brand, name, style, color, size, season, initial_qty, current_qty, sell_through, price, avg_price, cost, avg_cost FROM ( | |
SELECT | |
initial_qty.sm_product_id, brand, name, style, color, size, season, initial_qty.qty AS initial_qty, current_qty.qty AS current_qty, ROUND(IF(initial_qty.qty < current_qty.qty, 0, current_qty.qty / initial_qty.qty), 2) AS sell_through, ROUND(price,2) AS price, ROUND(cost,2) AS cost, | |
(SELECT ROUND(AVG(price),2) FROM sales_flat_order_item WHERE price != 0 AND sku = initial_qty.sku) AS avg_price, | |
(SELECT ROUND(AVG((pop_price_ht * (IF(pop_discount > 0, pop_discount, 100) / 100))),2) FROM purchase_order_product WHERE pop_product_id = initial_qty.sm_product_id) AS avg_cost | |
FROM ( | |
SELECT a.sm_product_id, b.sku, b.manufacturer_value AS brand, b.name, b.vendor_product_id AS style, b.image_label AS color, b.choose_size_value AS size, b.season, SUM(IF(sm_source_stock = 1, -sm_qty, sm_qty)) AS qty, price, cost | |
FROM stock_movement AS a | |
INNER JOIN catalog_product_flat_1 AS b O |
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_Helper_Data extends Mage_Core_Helper_Abstract { | |
private function generatePromoCode($length = null) { | |
$rndId = crypt(uniqid(rand(),1)); | |
$rndId = strip_tags(stripslashes($rndId)); | |
$rndId = str_replace(array(".", "$"),"",$rndId); | |
$rndId = strrev(str_replace("/","",$rndId)); | |
if (!is_null($rndId)){ | |
return strtoupper(substr($rndId, 0, $length)); | |
} |
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]; |
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
<?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
<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
<?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
<?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
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
/****** 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 |