-
Magento Kategorie layout (list.phtml) überschreiben
-
Magento Baseprice für den Checkout
<?php $_product = Mage::getSingleton(‚catalog/product‘)->load($_item->getProductId()); $_productPrice = $this->helper(‚checkout‘)->getPriceInclTax($_item); $_productAmount = $_product->getResource()->getAttribute(‚base_price_amount‘)->getFrontend()->getValue($_product); $_productBaseAmount = $_product->getResource()->getAttribute(‚base_price_base_amount‘)->getFrontend()->getValue($_product); $_productBaseUnit = $_product->getResource()->getAttribute(‚base_price_base_unit‘)->getFrontend()->getValue($_product); $_productBaseprice = ($_productPrice/$_productAmount)*$_productBaseAmount; ?> <?php if ($_productBaseprice && $_productBaseprice > 0): ?> <span>Entspricht <?php echo number_format($_productBaseprice,2, ‚,‘, ‚.‘) ?> € pro <?php echo $_productBaseAmount; ?> <?php echo $this->__($_productBaseUnit); ?></span> <?php endif; ?>
-
Magento Ausgabe von Multiselect-Attribute mit Grafiken
-
Magento: Fehler beim Index-Aufbau nach Import
nach einen Produkt Import mit cart2cart bekam ich folgende Meldung beim der Indexierung via SSH SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`catalog_category_product_index`, CONSTRAINT `FK_CATALOG_CATEGORY_PROD_IDX_CATEGORY_ENTITY` FOREIGN KEY (`category_id`) REFERENCES `catalog_category_entity` (`entity_id`)
-
Magento Nummerformate für Attribute
-
Magento CMS Block in phtml Einbindung
Einbinden in Templatedateien: echo $this->getLayout()->createBlock(‚cms/block‘)->setBlockId(‚block_id‘)->toHTML(); oder ein Block in der entsprechenden Layout-datei <block type=“core/template“ name=“block_name“ template=“pfad_zum/template.phtml“ /> und der Aufruf in der phtml echo $this->getChildHtml(‚block_name‘);
-
Magento reviews in der view.phtml
catalog.xml <block type=“review/product_view_list“ name=“product.info.product_additional_data“ as=“reviews“ template=“review/product/view/list.phtml“> <block type=“review/form“ name=“product.review.form“ as=“review_form“/> // <- mit Review Form </block> .phtml <?php echo $this->getChildHtml(‚reviews‘) ?>
-
Magento multiple-select im Frontend ausgeben
id Ausgabe des multiple-select $_product->getData(‚color‘); // i.e. 456,499 instanz des Mage_Catalog_Model_Resource_Eav_Attribute: $_product->getResource()->getAttribute(‚color‘); // zeigt rot, grün ausgabe als array : $_product->getAttributeText(‚color‘) // Array([0]=>’rot‘, [1]=>’grün‘) Dies gibt den Text aus: if ($attr = $_product->getResource()->getAttribute(‚color‘)): echo $attr->getFrontend()->getValue($_product); // will display: red, green endif; Label und Id aller Optionen $attributeId = Mage::getResourceModel(‚eav/entity_attribute‘)->getIdByCode(‚catalog_product‘,’trainingsziel‘); $attribute = Mage::getModel(‚catalog/resource_eav_attribute‘)->load($attributeId); $attributeOptions = $attribute->getSource()->getAllOptions(); foreach($attributeOptions as $each){ echo $each[„label“].“ „.$each[„value“].“<br>“; }
-
Magento übersetzung in phtml nutzen
-
Statischen CMS Block im Template ausgeben
XML Block: <layout> <default> <reference name=“content“> <block type=“cms/block“ name=“cms_store_check“> <action method=“setBlockId“><block_id>block_id</block_id></action> </block> </reference> </default> </layout> Einbinden in eine CMS-Seite oder einen anderen Block oder eine CMS-Seite im Backend: {{block type=“cms/block“ block_id=“block_id“ template=“cms/content.phtml“}} Direkt einbinden im Template: echo $this->getChildHtml(‚block_name‘); Einbinden im CMS: {{block type=“core/template“ name=“home_minds“ template=“cms/minds.phtml“}}