Skip to content

Instantly share code, notes, and snippets.

View steverobbins's full-sized avatar

Steve Robbins steverobbins

View GitHub Profile
<?php
$code = 'color';
$opts = Mage::getSingleton('eav/config')
->getAttribute('catalog_product', $code)
->getSource()
->getAllOptions(false);
foreach($opts as $opt) {
<?php
/**
* Short description of module
*
* PHP version 5
*
* @category Kering
* @package Kering_Modulename
* @author Kering Magento Team <magento@kering.com>
* @copyright 2015 Kering
select
eu_flat.entity_id,
eu_flat.sku,
def_eav.value default_eav_price,
eu_eav.value eu_eav_price,
eu_flat.price eu_flat_price
from catalog_product_flat_3 eu_flat
inner join catalog_product_entity_decimal eu_eav
on eu_flat.entity_id = eu_eav.entity_id
and eu_eav.attribute_id = 75
#!/bin/bash
DOMAIN=example.com
wget -w 2 -r --spider --delete-after -nd -nc --domains=$DOMAIN $DOMAIN > /dev/null 2>&1 &
-- Make sure to uncomment one of the where conditions below or your query will take forever
select
lu.visit_time,
inet_ntoa(lvi.server_addr) server_addr,
inet_ntoa(lvi.remote_addr) remote_addr,
lui.url,
lc.customer_id,
ce.email,
cs.name store,
lvi.http_user_agent,
<script>
var settings = {
exclude: ["US"],
regionselector: "example.com/regionselector",
homepages: {
"US": "example.com",
"DE": "example.com/de",
"FR": "example.com/fr",
"EU": "example.com/eu"
}
-- This takes about 30 seconds, but will make the next query a billion times faster
alter table sales_flat_order_item add index (product_id);
-- This takes about 5 seconds with the index added
select
cpe.entity_id product_id,
cpe.sku,
at_style_number.value style_number,
cpe.created_at product_created_date,
sum(sfoi.qty_ordered) total_ordered,
select
sfo.entity_id,
sfo.increment_id,
sfo.created_at,
sfo.status,
sfo.state,
sfo.customer_id,
sfo.ap21_order_id,
sfo.ap21_person_id,
ce.email,
jQuery('.nestedlisting .give-gold').each(function (i, that) {
setTimeout(function() {
jQuery(that).click();
}, i * 1000);
});
jQuery('button.btn.gold-button[type=button]:visible').each(function (i, that) {
setTimeout(function() {
jQuery(that).click();
}, i * 1000);
});
set @lifecycle_attr_id = 144;
set @isorderable_attr_id = 151;
set @ispreorderable_attr_id = 186;
set @lifecycle_attr_value_active = 23;
set @lifecycle_attr_value_prerelease = 155;
select
cpe.entity_id product_id,
cpe.sku