Magento – Verpixelte Bilder auf der Home/ Startseite beim RWD Theme

If you use the default home page in RWD theme and CMS > Pages > Your Home Page – Rider “Design” das XML

<reference name="happy">
       <block type="catalog/product_new" name ="home.catalog.product.new" alias="product_new" template ="catalog/product/new.phtml" after="cms_page">
            <action method="addPriceBlockType">
                <type>bundle</type>
                <block>bundle/catalog_product_price</block>
                <template>bundle/catalog/product/price.phtml</template>
            </action>
        </block>
        <block type="reports/product_viewed" name ="home.reports.product.viewed" alias="product_viewed" template ="reports/home_product_viewed.phtml" after="product_new">
            <action method="addPriceBlockType">
                <type>bundle</type>
                <block>bundle/catalog_product_price</block>
                <template>bundle/catalog/product/price.phtml</template>
            </action>
        </block>
        <block type="reports/product_compared" name ="home.reports.product.compared" template ="reports/home_product_compared.phtml" after="product_viewed">
            <action method="addPriceBlockType">
                <type>bundle</type>
                <block>bundle/catalog_product_price</block>
                <template>bundle/catalog/product/price.phtml</template>
            </action>
        </block>
    </reference>
    <reference name="right">
        <action method="unsetChild"><alias>right.reports.product.viewed</alias></action>
        <action method="unsetChild"><alias>right.reports.product.compared</alias></action>
    </reference>

wieder aktiviert haben indem Sie die Auskommentierung

<!-- -->

entfernt haben, werden auf der Startseite jeweils die neuen (“New Products”, zuletzt angesehenen “Ihre zuletzt angesehenen Artikel”) und zuletzt verglichenen Artikel angezeigt. Sind die Produktbilder verpixelt und nicht schön anzuschauen? Dann können Sie dies ändern, indem Sie folgende Dateien anpassen (wenn nötig aus dem base Ordner kopieren und in IHRTEMPLATE einfügen):

For “New Products”, the file: new.phtml im Ordner app/design/frontend/IHRTEMPLATE/default/template/catalog/product. Sleeps ca. Line 35

<a href="<?php echo $ _product->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_product->getName()) ?>" class ="product-image"><img src ="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135) ?>" width="135" height="135" alt ="<?php echo $this->escapeHtml($_product->getName()) ?>" /></a>

durch z.B.

<a href="<?php echo $ _product->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_product->getName()) ?>" class ="product-image"><img src ="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(350) ?>" width="350" height="350" alt ="<?php echo $this->escapeHtml($_product->getName()) ?>" /></a>

ersetzen wobei die 350 die Pixelanzahl angeben.

Genauso gehen Sie dann z.B. für die zuletzt angesehenen Artikel vor mit der Datei home_product_viewed.phtml im Ordner /public_html/app/design/frontend/IHRTEMPLATE/default/template/reports

oder für verglichene Artikel die Datei home_product_compared.phtml im selben Ordner.

Addendum dated 07.02.2017

In the meantime something has changed in design and above all, when the widget “New Products” used, there are new products for differences.

For the presentation as o.g. is written continue new.phtml used. Die Zeilen, which should be changed, But now read

                <a href="<?php echo $ _product->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_product->getName()) ?>" class ="product-image">
                    <?php $_imgSize = 260; ?>
                    <img src ="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize($_imgsiz to); ?>" alt ="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
                </a>

The desired size just behind the “$_imgsiz to” instead of 260 it can be noted.

but it uses the widget, to display on a page, the new products, it is different now, to you the products as a grid / will display Grid or List. For the grid now the file is new_grid.phtml (for list according to the new_list.phtml) copied from the folder app / design / frontend / rwd / default / template / catalog / product / widget / new / content in your own template folder.

Now here are two adjustments to make, to well above simply to enter the desired number of pixels. Although the creators of Magento have

<?php $_imgSize = 210; ?>

eingebaut, but apparently forgot to use this line further, since two lines later this is

<img src ="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(85) ?>" alt ="<?php echo $this->stripTags($_product->getName(), null, true) ?>" />

The Resize size is thus defined statically to 85px. This makes no real sense, and thus we replace “(85)” with “($_imgsiz to)”. Then it looks all together like this

                    <?php $_imgSize = 350; ?>
                    <a href="<?php echo $ _product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>" class ="product-image">
                        <img src ="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize($_imgsiz to) ?>" alt ="<?php echo $this->stripTags($_product->getName(), null, true) ?>" />
                    </a>

And now it looks in the frontend already beautiful from. Certainly you have to define the optimal value for the number of pixels, depending on their own layout.

Used in Magento Version 1.9 Comments? Additions? Notes? Gladly!

Published by Covos

Since 2009 I have been working intensively with Magento. I started with the creation and operation of B2C stores. This was extended through my work in the logistics sector. This resulted first specialized B2E systems. Today I work day-a day with exciting B2C, B2B- and B2E projects and reports in this blog about challenges and give insider tips.

Leave a Reply

Your email address will not be published. Required fields are marked *