Posts in magento

Cómo configurar las reglas de IVA para España en Magento

junio 15th, 2012 Posted by magento 0 thoughts on “Cómo configurar las reglas de IVA para España en Magento”

1. Hay que ir a Ventas > Impuestos > Clases de impuestos al cliente y cambiarle el nombre a la regla “Retail customer” por “Cliente final”.

2. Ir a Ventas > Impuestos > Clases de impuestos al producto y crear la clase “IVA”.

3. Ir a Ventas > Impuestos > Gestionar las zonas de impuestos & tasas y crear las reglas que correspondan por ejemplo:

4. Ir a Ventas > Impuestos > Gestionar las reglas de impuestos y crear una nueva regla de impuestos. Por ejemplo:

Nombre: IVA
Clase de Impuesto al cliente: Cliente Final
Clase de Impuesto al producto: IVA
Tasa del Impuesto: seleccionar todas las que apliquen.
Prioridad: 1
Clasificación del pedido: 1   

Cómo eliminar todas las ordenes de prueba en Magento 1.4.2.

junio 7th, 2012 Posted by magento, php, sql 0 thoughts on “Cómo eliminar todas las ordenes de prueba en Magento 1.4.2.”

Para eliminar todas las órdenes de prueba de un site Magento (testeado en la versión 1.4.2) lanzar el siguiente query: 

 

SET FOREIGN_KEY_CHECKS = 0;

-- TRUNCATE TABLES
TRUNCATE `sales_flat_order`;
TRUNCATE `sales_billing_agreement`;
TRUNCATE `sales_billing_agreement_order`;
TRUNCATE `sales_flat_order_status_history`;
TRUNCATE `sales_flat_order_payment`;
TRUNCATE `sales_flat_quote`;
TRUNCATE `sales_flat_quote_address`;
TRUNCATE `sales_flat_quote_address_item`;
TRUNCATE `sales_flat_quote_payment`;
TRUNCATE `sales_flat_quote_shipping_rate`;
TRUNCATE `sales_flat_shipment`;
TRUNCATE `sales_flat_shipment_comment`;
TRUNCATE `sales_flat_shipment_grid`;
TRUNCATE `sales_flat_shipment_item`;
TRUNCATE `sales_flat_shipment_track`;
TRUNCATE `sales_flat_quote_item`;
TRUNCATE `sales_flat_quote_item_option`;
TRUNCATE `sales_flat_order_grid`;
TRUNCATE `sales_flat_order_item`;
TRUNCATE `sales_flat_order_address`;
TRUNCATE `sales_flat_invoice`;
TRUNCATE `sales_flat_invoice_grid`;
TRUNCATE `sales_flat_invoice_item`;
TRUNCATE `sales_flat_invoice_comment`;
TRUNCATE `sales_invoiced_aggregated`;
TRUNCATE `sales_invoiced_aggregated_order`;
TRUNCATE `sales_order_aggregated_created`;
TRUNCATE `sales_order_tax`;
TRUNCATE `sales_flat_creditmemo`;
TRUNCATE `sales_flat_creditmemo_comment`;
TRUNCATE `sales_flat_creditmemo_grid`;
TRUNCATE `sales_flat_creditmemo_item`;
TRUNCATE `sales_payment_transaction`;
TRUNCATE `sales_recurring_profile`;
TRUNCATE `sales_recurring_profile_order`;
TRUNCATE `sales_refunded_aggregated`;
TRUNCATE `sales_refunded_aggregated_order`;
TRUNCATE `sales_shipping_aggregated`;
TRUNCATE `sales_shipping_aggregated_order`;
TRUNCATE `sales_bestsellers_aggregated_daily`;
TRUNCATE `sales_bestsellers_aggregated_monthly`;
TRUNCATE `sales_bestsellers_aggregated_yearly`;
TRUNCATE `sendfriend_log`;
TRUNCATE `tag`;
TRUNCATE `tag_relation`;
TRUNCATE `tag_summary`;
TRUNCATE `wishlist`;
TRUNCATE `log_quote`;
TRUNCATE `report_event`;


-- RESET AUTOINCREMENT TO 1
ALTER TABLE `sales_flat_order` AUTO_INCREMENT=1;
ALTER TABLE `sales_billing_agreement` AUTO_INCREMENT=1;
ALTER TABLE `sales_billing_agreement_order` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_status_history` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_payment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_address` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_address_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_payment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_shipping_rate` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment_comment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment_grid` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment_track` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_item_option` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_grid` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_address` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_invoice` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_invoice_grid` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_invoice_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_invoice_comment` AUTO_INCREMENT=1;
ALTER TABLE `sales_invoiced_aggregated` AUTO_INCREMENT=1;
ALTER TABLE `sales_invoiced_aggregated_order` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_aggregated_created` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_tax` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_creditmemo` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_creditmemo_comment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_creditmemo_grid` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_creditmemo_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_payment_transaction` AUTO_INCREMENT=1;
ALTER TABLE `sales_recurring_profile` AUTO_INCREMENT=1;
ALTER TABLE `sales_recurring_profile_order` AUTO_INCREMENT=1;
ALTER TABLE `sales_refunded_aggregated` AUTO_INCREMENT=1;
ALTER TABLE `sales_refunded_aggregated_order` AUTO_INCREMENT=1;
ALTER TABLE `sales_shipping_aggregated` AUTO_INCREMENT=1;
ALTER TABLE `sales_shipping_aggregated_order` AUTO_INCREMENT=1;
ALTER TABLE `sales_bestsellers_aggregated_daily` AUTO_INCREMENT=1;
ALTER TABLE `sales_bestsellers_aggregated_monthly` AUTO_INCREMENT=1;
ALTER TABLE `sales_bestsellers_aggregated_yearly` AUTO_INCREMENT=1;
ALTER TABLE `sendfriend_log` AUTO_INCREMENT=1;
ALTER TABLE `tag` AUTO_INCREMENT=1;
ALTER TABLE `tag_relation` AUTO_INCREMENT=1;
ALTER TABLE `tag_summary` AUTO_INCREMENT=1;
ALTER TABLE `wishlist` AUTO_INCREMENT=1;
ALTER TABLE `log_quote` AUTO_INCREMENT=1;
ALTER TABLE `report_event` AUTO_INCREMENT=1;


-- RESET STORE ID COUNTERS
TRUNCATE `eav_entity_store`;
ALTER TABLE `eav_entity_store` AUTO_INCREMENT=1;

SET FOREIGN_KEY_CHECKS = 1;

Cómo eliminar todos los productos en Magento con un script de php.

mayo 28th, 2012 Posted by magento, php 0 thoughts on “Cómo eliminar todos los productos en Magento con un script de php.”

Para eliminar todos los productos de Magento con un script de PHP se puede realizar de la siguiente manera.

Primero se obtienen todos los productos y luego se los recorre con un loop y se los elimina uno a uno.

 



require_once '../app/Mage.php';
Mage::app();

error_reporting(E_ALL);
ini_set('display_errors', '1');

Mage::register('isSecureArea', true);
try {
$collection = Mage::getModel('catalog/product')
->getCollection()
->addAttributeToSelect('*');

$i = 0;
foreach ($collection as $product) {
echo "Eliminando producto: " . $product->getId() . "
";
$product->delete();
}

} catch (Exception $e) {
echo 'Error';
} Mage::unregister('isSecureArea');

Importar un site Magento en MAMP

mayo 2nd, 2012 Posted by mac, magento, mamp, osx, php 0 thoughts on “Importar un site Magento en MAMP”
Primero crear el directorio para el site, y bajar los archivos desde el FTP.
Luego, exportar la base de datos en el servidor. Para importar el dump file del site con Magento en MAMP, hay que incluir la siguiente sentencia al comienzo del archivo SQL:

SET FOREIGN_KEY_CHECKS = 0;
Luego por consola, ejecutar la siguiente línea:
$ cd /Applications/MAMP/Library/bin
$ ./mysql -u root -p mylocaldb < /Users/myuser/bd_dump.sql
Para crear el Virtual Host, hay que editar el archivo /Applications/MAMP/conf/apache/httpd.conf y agregar el Virtual Host:
<virtualhost *="">
ServerName mysite.local
DocumentRoot "/Users/myuser/Work/MAMP/mysite.com"
</virtualhost>

 

También hay que editar el archivo /etc/hosts y agregar lo siguiente:

127.0.0.1    mysite.local
::1 mysite.local
Y por último hay que editar las siguientes filas en MySQL:
select * from core_config_data where path = 'web/unsecure/base_url';
select * from core_config_data where path = 'web/secure/base_url';
Y quizás esta: 
select * from core_config_data where path = 'admin/url/custom';

E incluir en ellas la nueva url: http://mysite.local. Acá colgué un script que hice para automatizar un poco la actualización de las URLs.

Si hay problemas luego de todo esto ver acá y acá.

Copyright © 2018 programadorfreelanceargentina.com

Programador Freelance Argentina