This file contains 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 | |
define('MAGENTO_ROOT', "/var/www/hatsbythe100.com.au/web"); | |
$mageFilename = MAGENTO_ROOT . '/app/Mage.php'; | |
require_once $mageFilename; | |
umask(0); | |
Mage::app(); | |
Mage::app()->getStore()->setId(0); |
This file contains 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
update | |
sales_flat_order_grid as sfog | |
inner join ( | |
select entity_id, status | |
from sales_flat_order as sfotmp | |
) as sfo on sfo.entity_id = sfog.entity_id | |
set sfog.status = sfo.status | |
#where sfog.entity_id in (111194) |
This file contains 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 email, customer_id, product_id, sku, cpev.value, add_date from product_alert_stock as pas | |
left join catalog_product_entity as cpe on pas.product_id = cpe.entity_id | |
left join catalog_product_entity_varchar as cpev on cpev.`entity_id` = cpe.entity_id | |
where add_date > '2017-03-16 00:00:00' | |
and send_date is NULL | |
and cpev.attribute_id = 71 | |
order by cpev.value; |
This file contains 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 * from catalog_category_entity_int | |
UPDATE catalog_category_entity_int | |
SET value = 1 | |
WHERE attribute_id = (SELECT attribute_id | |
FROM eav_attribute | |
WHERE attribute_code = 'is_anchor' | |
LIMIT 1) | |
AND entity_id in (select entity_id from catalog_category_entity where path like ('2297%')) and value = 0; |
This file contains 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
UPDATE am_shopby_value | |
SET img_medium = Concat(Lower(REPLACE (meta_title, ' ', '-')), '.jpg') | |
WHERE img_medium = '' | |
AND filter_id = 1 | |
AND meta_title NOT LIKE ( "a:%" ); |
This file contains 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
#Copy from Store 6 into Store 5 where position = 2; | |
INSERT INTO catalog_product_entity_media_gallery_value | |
( | |
value_id, | |
store_id, | |
label, | |
position, | |
disabled | |
) |
This file contains 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
Attribute IDs 32, 178 for Fax | |
Attribute IDs 31, 175 for Phone | |
update customer_address_entity_varchar set value = '' where attribute_id in (32,178) and value != ''; | |
update customer_address_entity_varchar set value = '' where attribute_id in (31,175) and (value REGEXP '^[A-Za-z]+$' OR value like ('%@%')); |
This file contains 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 | |
type_id,sku, cpev.value, | |
CASE when cpei2.value = 1 THEN "Enabled" ELSE "Disabled" END | |
from catalog_product_entity a | |
left join catalog_category_product cp on cp.`product_id` = a.entity_id | |
left join catalog_product_relation cpr on cpr.child_id = a.entity_id | |
left join catalog_product_entity_int cpei on cpei.`entity_id` = a.entity_id AND cpei.attribute_id = '91' #visibility | |
left join catalog_product_entity_int cpei2 on cpei2.`entity_id` = a.entity_id AND cpei2.attribute_id = '84' #status | |
left join catalog_product_entity_varchar cpev on cpev.`entity_id` = a.entity_id AND cpev.attribute_id = '60' #name | |
where |
This file contains 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 | |
function urlsafe_b64encode($string) { | |
return str_replace(array('+','/','='),array('-','_',''), base64_encode($string)); | |
} | |
$ampBaseUrl="https://www-example-com-au.cdn.ampproject.org"; | |
$file = fopen("urls.txt", "r") or exit("Unable to open file!"); |
This file contains 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
import FreeCAD | |
import Part | |
def create_adapter_plate(): | |
# Define Nema17 dimensions | |
width = 42.3 | |
length = 42.3 | |
bolt_diameter = 4.0 | |
shaft_diameter = 5.0 | |
height = 10.0 |