Posts in magento

Cómo eliminar órdenes en Magento

julio 12th, 2012 Posted by magento 0 thoughts on “Cómo eliminar órdenes en Magento”

Hay una extensión de Magento que funciona muy bien y encima es gratuita 🙂

La extensión se llama Seamless Delete Order.

cache_dir is not writable | Magento 1.6.2

junio 17th, 2012 Posted by magento 0 thoughts on “cache_dir is not writable | Magento 1.6.2”
Luego de subir mi instalación fresquita de Magento me encontré con este problema:
cache_dir is not writable
La solución fue darle permisos 777 a la carpeta /var


chmod -R 777 var/

Mage registry key “_resource_helper/core” already exists | Magento 1.6.2

junio 17th, 2012 Posted by magento 0 thoughts on “Mage registry key “_resource_helper/core” already exists | Magento 1.6.2”

Luego de desarrollar mi site de Magento en local y subirlo al servidor me encontré con el siguiente error:

Mage registry key "_resource_helper/core" already exists

El problema lo pude resolver con los siguientes pasos: 

Eliminando la cache y las sessiones :

 
rm -rf var/cache/* var/session/*

Y luego haciendo un fix de los permisos de los archivos:

 


#for magento 1.5+
find . -type f -exec chmod 644 {} ;
find . -type d -exec chmod 755 {} ;
chmod o+w var var/.htaccess app/etc
chmod 550 mage
chmod -R o+w media

Cómo obtener todos los posibles valores de los atributos de un producto configurable.

junio 16th, 2012 Posted by magento, php 0 thoughts on “Cómo obtener todos los posibles valores de los atributos de un producto configurable.”

Para obtener todos los posibles valores de los atributos un producto configurable se puede utilizar el siguiente código:

 


// Collect options applicable to the configurable product
$productAttributeOptions = $product->getTypeInstance(true)->getConfigurableAttributesAsArray($product);
$attributeOptions = array();
foreach ($productAttributeOptions as $productAttribute) {
foreach ($productAttribute['values'] as $attribute) {
$attributeOptions[$productAttribute['label']][$attribute['value_index']] = $attribute['store_label'];
}
}

Cómo ordenar los atributos de un producto configurable

junio 16th, 2012 Posted by magento 0 thoughts on “Cómo ordenar los atributos de un producto configurable”

Estoy haciendo un Magento para vender remeras.

Cada remera es un producto configurable que tiene dos atributos: Color y Talla.

Por defecto salía primero el Color y luego la Talla, y yo necesitaba mostrar primero el Color. Aparentemente Magento ordena los atributos por el ID de manera descendiente.

La solución que encontré es la lanzando esta query por phpMyAdmin

UPDATE catalog_product_super_attribute SET position = 1 WHERE attribute_id = ‘your_attribute_id’ 

Más info acá.

Cómo eliminar el sufijo .html de las páginas de productos y categorías en Magento

junio 16th, 2012 Posted by magento 0 thoughts on “Cómo eliminar el sufijo .html de las páginas de productos y categorías en Magento”

Hay que ir en el administrador a System > Config > Catalog y eliminar el sufijo “.html”.

 

Luego hay que volver a reindexar. System > Index Management > Reindex all

Couldn’t resolve host ‘magento-community’

junio 16th, 2012 Posted by magento 0 thoughts on “Couldn’t resolve host ‘magento-community’”
Estaba intentando descargar un módulo de Magento y me daba el siguiente error: 
Couldn’t resolve host ‘magento-community’
Para solucionarlo hay que anteponer el host de Magento: http://connect20.magentocommerce.com/
Por ejemplo:

http://connect20.magentocommerce.com/community/banner 

isEnabledViewSwitcher

junio 15th, 2012 Posted by magento 0 thoughts on “isEnabledViewSwitcher”

Para quitar el módulo View By del front de Magento hay que ir a Sistema > Catalog > Catalog y seleccionar o bien “Grid only” o bien “List only”.

 

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`magento`.`catalog_product_entity`, CONSTRAINT `FK_CAT_PRD_ENTT_ATTR_SET_ID_EAV_ATTR_SET_ATTR_SET_ID` FOREIGN KEY (`attribute_set_id`) REFERENCES `eav_attribute_set` (`attribute_set_i)

junio 15th, 2012 Posted by magento 0 thoughts on “SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`magento`.`catalog_product_entity`, CONSTRAINT `FK_CAT_PRD_ENTT_ATTR_SET_ID_EAV_ATTR_SET_ATTR_SET_ID` FOREIGN KEY (`attribute_set_id`) REFERENCES `eav_attribute_set` (`attribute_set_i)”

Luego de hacer un upgrade de Magento 1.4.2 a Magento 1.6.2 el script de importación de productos dejó de funcionar.

Estuve horas buscando este error


SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or
update a child row: a foreign key constraint fails
(`magento_sdny_new`.`catalog_product_entity`, CONSTRAINT
`FK_CAT_PRD_ENTT_ATTR_SET_ID_EAV_ATTR_SET_ATTR_SET_ID` FOREIGN KEY
(`attribute_set_id`) REFERENCES `eav_attribute_set` (`attribute_set_i)


 
Finalmente descubrí aquí que este error se debe a esta línea específicamente:

$pr_simple->setAttributeSetId(9);

Y se puede deber a dos razones:

  • O bien no se está proveyendo ningún valor en el setAttributeSetId($id).
  • O bien el valor que se está proveyendo no existe en la instalación de Magento.

Otra cosa que tuve que hacer es ir a Sistema > Index Management y setear el índice “Product Prices” como manual.

Cómo crear un custom layout en Magento

junio 15th, 2012 Posted by magento 0 thoughts on “Cómo crear un custom layout en Magento”
  1. Copiar app/code/core/Mage/Page/etc/config.xml en app/code/local/Mage/Page/etc/config.xml.
  2. Hay que registrar el custom layout agregando un nuevo archivo en app/etc/modules, por ejemplo Mage_Local.xml
  3. En este archivo poner el siguiente código:
    <config>
    <modules>
    <mage_page> //relates to file structure
    <active>true</active> //set to active
    <codepool>local</codepool> //tell which folder to look in
    <depends> //requires the mage core
    <mage_core>
    </mage_core>
    </depends>
    </mage_page>
    </modules>
    </config>
  4. Ahora hay que crear el archivo del template. Por ejemplo copiar 3columns.phtml (en app/design/frontend/your_package/your_theme/template/page), y ponerle otro nombre por ejemplo 4columns.phtml
  5. Finalmente hay que resgutrar este nuevo template en el archivo config.xml creado en el paso 1 agregando el layout a la lista. Por ejemplo:

    <four_columns module="page" translate="label">
    <label>4 columns</label>
    <template>page/4columns.phtml</template>
    <layout_handle>page_four_columns</layout_handle>
    </four_columns>

Copyright © 2018 programadorfreelanceargentina.com

Programador Freelance Argentina