Magento: add to cart button is not working
Posted by admin in Magento
In my custom theme there was this code for Add to cart button:
<button type=”button” class=”button-form” onclick=”productAddToCartForm.submit()”><span><?php echo $this->__(’Add to Cart’) ?></span></button>
The problem was that nothing happened when you clicked it. Just remove type="button" so it looks like this:
<button class=”button-form” onclick=”productAddToCartForm.submit()”><span><?php echo $this->__(’Add to Cart’) ?></span></button>
It worked for me…
Magento: error when opening product view page
Posted by admin in Magento
When I try to open product view page I get this error:
Warning: include(/…../…../public_html/magento/app/design/frontend/mytheme/default/template/page/2columns-left) [function.include]: failed to open stream: No such file or directory in /…../…../public_html/magento/app/code/core/Mage/Core/Block/Template.php on line 144
The problem occured because I made a mistake in /app/design/frontend/mytheme/mytheme/layout/catalog.xml. In <catalog_product_view> tags I have set:
<action method=”setTemplate”><template>page/2columns-left</template></action>
where it must be:
<action method=”setTemplate”><template>page/2columns-left.phtml</template></action>
!!!
Magento: how to set number of columns in product list
Posted by admin in Magento
Open /app/design/frontend/your_theme/your_theme/template/catalog/product/list.phtml and find line:
<?php $_columnCount = $this->getColumnCount(); ?>
and replace it with:
<?php $_columnCount = 4; ?>
Set the number of columns as you need.
Make changes on your website witch only you can see
Posted by admin in html / css, tips
Go to this website to get your IP: http://whatismyipaddress.com/
and replace the ‘111.11.11.11′ whit it in the code below.
<?php if($_SERVER[’REMOTE_ADDR’] == ‘111.11.11.11′) { ?>
<!– insert your html or php or whatever code here….. –>
<?php } ?>
The code between { } will be seen only through you IP address. Enjoy.
Magento: set number of products in new products module
Posted by admin in Magento
You can set number of products to be displayed in new product module in your new.phtml file. Find:
<?php $i=0; foreach ($_products->getItems() as $_product): ?>
and add above, so the code looks like this:
<?$_products->setOrder(’news_from_date’)->setPageSize(6)->setCurPage(1);?>
<?php $i=0; foreach ($_products->getItems() as $_product): ?>
Set the number (6) as you like.
On the other hand you can set this number in administration on home cms page. Under Custom desing set the code for new products to look like this:
<reference name=”content”>
<block type=”catalog/product_new” name=”home.new” alias=”product_new” template=”catalog/product/new.phtml”>
<action method=”setProductsCount”><count>8</count></action>
<action method=”addPriceBlockType”>
<type>bundle</type>
<block>bundle/catalog_product_price</block>
<template>bundle/catalog/product/price.phtml</template>
</action>
</block>
</reference>
Just set the number in tags.


