Pergunta

this is the code of the product view CODE PRODUCT VIEW

I have try to change the design but it seams i get error i have to move related products ( look picture) i dont need text or size or something else there only the picture of the reated product)

hope someone can help

enter image description here

Foi útil?

Solução

If this is a Magento CE 1.9 shop, and you are talking about the related products feature, then you need to understand a few things:

  • Related products are built into the product view
  • Related products must be setup manually for each product
  • Your view must employ a related products child view

I can give you your answer by explaining the first point.

Related products are built into the product view

On a CE 1.9 shop using the rwd/default theme, you can learn how related products are setup by reviewing the file app/design/frontend/rwd/default/layout/catalog.xml. Inside of the product.info block declaration, you will find your clue:

<block type="catalog/product_list_related" name="catalog.product.related" as="related_products" template="catalog/product/list/related.phtml" />

Because this block is declared inside of the product.info block, it is available to the template catalog/product/view.phtml (the template you referenced in your question). Knowing this, you have the ability to render related products anywhere in view.phtml.

Judging by your images, you want to insert related products beneath the add-to-cart button. To do that, just render the related products child block in your view.phtml template.

Here's an excerpt from your own code, modified to include related products.

...
<?php elseif (!$_product->isSaleable()): ?>
    <div class="clearer"></div>
    <div class="add-to-box">
        <?php echo $this->getChildHtml('addto') ?>
    </div>
<?php endif; ?>

<?php if ($_product->isSaleable() && $this->hasOptions()):?>
    <?php echo $this->getChildChildHtml('container1', '', true, true) ?>
<?php endif;?>
<div class="clearer"></div>
<?php echo $this->getChildHtml('addthis_sharetool'); ?>

<!-- ADD RELATED PRODUCTS -->
<?php echo $this->getChildHtml('related_products'); ?>
<!-- /ADD RELATED PRODUCTS -->
...

This may not be the exact place where you want the products to appear, but you should get the idea. Now if what it outputs is not what you want, then you can edit the template, catalog/product/list/related.phtml

Licenciado em: CC-BY-SA com atribuição
Não afiliado a magento.stackexchange
scroll top