dic 07

Ispirandomi alla funzione di creazione degli attribute set già descritta in precedenza, ho scritto quattro semplici funzioni utili per la creazione e per il recupero di attribute set e attribute group.

protected function createNewAttributeSet($name, $entity_type_id, $skeletonId) {
    $modelSet = Mage::getModel('eav/entity_attribute_set')
        ->setEntityTypeId($entity_type_id) // 4 == "catalog/product"
        ->setAttributeSetName($name);
    $modelSet->save();
    $modelSet->initFromSkeleton($skeletonId)->save(); // same thing
    return $modelSet->getId();
}
 
protected function createNewAttributeGroup($attribute_group_name, $attribute_set_id) {
    $new_group_model=Mage::getModel('eav/entity_attribute_group')
        ->setAttributeSetId($attribute_set_id)
        ->setAttributeGroupName($attribute_group_name);
    $new_group_model->save();
    return $new_group_model->getId();
}
 
protected function getAttributeSet($name, $entity_type_id) {
    $attribute_set = Mage::getResourceModel('eav/entity_attribute_set_collection')
        ->setEntityTypeFilter($entity_type_id)
        ->addFilter('attribute_set_name', $name)
        ->getLastItem();
    return $attribute_set;
}
 
protected function getAttributeGroup($name, $attribute_set_id) {
    $attribute_group = Mage::getResourceModel('eav/entity_attribute_group_collection')
        ->setAttributeSetFilter($attribute_set_id)
        ->addFilter("attribute_group_name",$name)
        ->getLastItem();
    return $attribute_group;
}
Tagged with:
ago 26

Il modulo è questo:
http://www.magentocommerce.com/extension/1438/euvat-tax-calculation-for-eu-based-ecommerce

E la procedura di installazione/configurazione è spiegata molto bene qui:
https://support.pillwax.com/open-source/doku.php?id=magento:euvat

Ma si rischia di perder molto tempo su un dettaglio.

Perchè il modulo funzioni e mostri il template corretto, è necessario avere questa configurazione:

System -> Configuration -> [CUSTOMERS] Customer Configuration -> [Name and address Options] Show Tax/VAT number = optional

Se il parametro è impostato a “No”, anche se tutte le procedure sono state eseguite correttamente, il nuovo box non sarà visualizzato.

Tagged with:
ago 26

Può essere utile in un e-commerce avere un menu laterale che permetta la navigazione per categorie e sottocategorie di prodotti. Esiste un’estensione che fa esattamente questo:

http://www.magentocommerce.com/extension/763/vertical-navigation-with-css-classes

Si installa via Connection Manager ed è subito attiva.

Se però ho una struttura molto articolata di categorie su molti livelli, come posso impostare un limite a quelli che verranno visualizzati nel menu?

Si fa così:

System -> Configuration -> Catalog -> Category Top Navigation: Maximal Depth

Se il livello è 0, nessuna sottocategoria sarà visualizzata.

Tagged with:
preload preload preload