Search This Blog

Thursday, May 31, 2012

Validation for Phone number

<script language="javascript">
    <!--
        function initValidation()
        {
            var objForm = document.forms["contactus"];
            objForm.fname.required = 1;
            objForm.fname.regexp =/\w*$/;

            objForm.phone.required = 1;
            objForm.phone.regexp = /^\d+([\.]\d\d)?$/;

            objForm.email.required = 1;
            objForm.email.regexp = "JSVAL_RX_EMAIL";
        }
    //-->
    </script>

For more information checkout our official website.

Wednesday, May 23, 2012

Display Products on Home page with add to cart button in Magento

Display Products category and products on Home page..

{{block type="catalog/product_list" category_id="3" name="home.catalog.product.list" alias="product_homepage" template="catalog/product/mylist.phtml"}}

For more information checkout our official website.

Display CMs Block in CMS Pages in Magento

 Copy and paste below code to your cms page where you want to show the code. and change the block id of this code.

{{block type="cms/block" block_id="just-sleep-image"}}

For more information checkout our official website.

Display CMS Block on Phtml file in Magento

Paste your html code in cms block and copy below code and paste at the place where you want to display cms block....

<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('detail-right-side')->toHtml(); ?>

For more information checkout our official website.



Tuesday, May 15, 2012

Magento Homesellers 5in1 - FREE

http://www.magentocommerce.com/magento-connect/homesellers-5in1-free.html

http://connect20.magentocommerce.com/community/Magazento_Homesellers

Organize home page in few clicks. Show best sellers,popular,new,most rated products and product reviews.

For more information checkout our official website.


Monday, May 14, 2012

Redirect Product direct to checkout in magento

 Redirect your product direct to the checkout page with one add to cart product.. good working code.....

<form action="<?php echo $this->getUrl('checkout/cart/add')?>" method="post">
<input type="hidden" name="product" value="1" />
<div class="buy-now-btn">

    <input name="qty" type="hidden" class="input-text qty" id="qty" maxlength="12" value="1"</span>
     <a href=""><button class="form-button" onclick="productAddToCartForm.submit()"><img src="<?php echo $this->getSkinUrl('images/buy-now.jpg');?>" alt="Buy now" /></button></a>
    
      <button class="form-button" onclick="productAddToCartForm.submit()"><a href=""><img src="<?php echo $this->getSkinUrl('images/add-to-cart.jpg');?>" alt="Buy now" /></a></button>
      
</div>
</form>

<script type="text/javascript">
    var productAddToCartForm = new VarienForm('product_addtocart_form');
    productAddToCartForm.submit = function() {
        if(this.validator.validate()) {
            this.form.submit();
        }
    }.bind(productAddToCartForm);
</script>

For more information checkout our official website.

Change image on mouse over....

 Change image on mouse over very nice script.. and very easy.....

<img src="images/calendars.jpg" width="115" height="57" name="calendars" alt="Calendars And Tent Calendars"
                onmouseover="document.calendars.src = 'images/calendars-h.jpg';"
                onmouseout="document.calendars.src = 'images/calendars.jpg';"/>

For more information checkout our official website.

Monday, May 7, 2012

Display image in magento



<?php echo $this->getSkinUrl('images/imagename.png')?>
For more information checkout our official website.

Display the attribute any wher in magento…



<?php echo $_product->getAttributename() ?>
Just take care that the attribute name first letter is capital…
For more information checkout our official website.

Code for Magento Category display at any other place in the site..


<ul>
               <?php
 $h3h3=Mage::getModel('catalog/category')->getCollection();
foreach($h3h3 as $cat){
               
$cata=Mage::getModel('catalog/category')->load($cat->getEntityId());
if($cat->getEntityId() != 1 && $cat->getEntityId() != 2){
                                echo "<li><a href='".$cata->getUrl()."'>".$cata->getName()."</a></li>";
}
}
?>
</ul>
Just copy and paste and get the category listed….
For more information checkout our official website.