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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | |
<title>Remove Magento's orphan images web console</title> | |
<link href='https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300,700' rel='stylesheet' type='text/css'> | |
<link href='https://fonts.googleapis.com/css?family=Inconsolata:400,700&subset=latin,latin-ext' rel='stylesheet' | |
type='text/css'> | |
<style type="text/css"> |
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 | |
//manera que utilizan muchas extensiones, aunque no es la recomendable, | |
//ya que magento incluye esta funcionalidad en su core | |
$modules = Mage::getConfig()->getNode('modules')->children(); | |
$modulesArray = (array)$modules; | |
if($modulesArray['Module_Name']->is('active')) { | |
echo "module is active."; |
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
function addEvent(obj, evType, fn){ | |
if (obj.addEventListener){ | |
obj.addEventListener(evType, fn, false); | |
return true; | |
} else if (obj.attachEvent){ | |
var r = obj.attachEvent("on"+evType, fn); | |
return r; | |
} else { | |
return false; | |
} |
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 | |
/** | |
* Esta funcion devuelve una cadena pasada como parametro | |
* truncada a un maximo de caracteres segun parametro | |
* @param string $string | |
* @param int $maxLength | |
* @return string | |
*/ | |
public function truncateString($string, $maxLength) |
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
<? for($navigation as $item) : ?> | |
<li><a href="<?= $item->href ?>"><?= $item->caption ?></a></li> | |
<? endfor; ?> |
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 | |
Mage::getSingleton('eav/config') | |
->getEntityType(Mage_Catalog_Model_Product::ENTITY) | |
->getAttributeCollection(); | |
?> |
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 all the config data with the current domain in the value | |
select * from core_config_data where value like "%www.old-domain.com%"; | |
#replacing www.old-domain.com with www.new-domain.com | |
update core_config_data set value=REPLACE(value, 'www.old-domain.com', 'www.new-domain.com') | |
where value like "%www.old-domain.com%"; | |
#check if it worked! | |
select * from core_config_data where value like "%www.new-domain.com%"; |
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 -f shell/log.php -- clean --days 1 |
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
SET FOREIGN_KEY_CHECKS = 0; | |
#truncate customers | |
truncate customer_entity; | |
truncate customer_address_entity; | |
truncate log_customer; | |
truncate salesrule_customer; | |
truncate salesrule_coupon_usage; | |
truncate newsletter_subscriber; | |
truncate persistent_session; |
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
#PARA CUSTOMERS borrando QUOTES más antiguas de 45 días | |
#DELETE FROM sales_flat_quote WHERE (NOT ISNULL(customer_id) AND customer_id != 0) AND updated_at < DATE_SUB(Now(), INTERVAL 45 DAY) LIMIT 15000; | |
SELECT * FROM sales_flat_quote WHERE (NOT ISNULL(customer_id) AND customer_id != 0) AND updated_at < DATE_SUB(Now(), INTERVAL 45 DAY) LIMIT 15000; | |
#PARA NO CUSTOMERS borrando QUOTES más antiguas de 30 días. | |
#DELETE FROM sales_flat_quote WHERE (ISNULL(customer_id) || customer_id = 0) AND updated_at < DATE_SUB(Now(), INTERVAL 30 DAY); | |
SELECT * FROM sales_flat_quote WHERE (ISNULL(customer_id) || customer_id = 0) AND updated_at < DATE_SUB(Now(), INTERVAL 30 DAY) LIMIT 50000; |
NewerOlder