Thursday, 27 March 2014

How to set minimum quantity in magento cart?

Go to app\design\frontend\base\default\template\checkout\onepage\link.phtml


Put this code in this page


<?php if ($this->isPossibleOnepageCheckout()):?>
<?php if(Mage::helper('checkout/cart')->getCart()->getItemsQty() >= 3):?>
    <button type="button" title="<?php echo $this->__('Proceed to Checkout') ?>" class="button btn-proceed-checkout btn-checkout<?php if ($this->isDisabled()):?> no-checkout<?php endif; ?>"<?php if ($this->isDisabled()):?> disabled="disabled"<?php endif; ?> onclick="window.location='<?php echo $this->getCheckoutUrl() ?>';"><span><span><?php echo $this->__('Proceed to Checkout') ?></span></span></button>
<?php else:?>
<font style="color:red;">You must order a quantity of 3 or more to proceed.</font>
<?php endif?>
<?php endif?>


Then put this code into header.phtml page

<input type="hidden" id="get_cart" value="<?php echo Mage::helper('checkout/cart')->getCart()->getItemsQty(); ?>" />
<script type='text/javascript'>
        jQuery(document).ready(function() {
if(document.getElementById("get_cart").value < 3) {
jQuery(".top-link-checkout").attr("href", "javascript:void(0);")
}
        });

</script>

Then enjoy!!!!!!!!!!!!!!

Thursday, 13 March 2014

magento index.php was not found on this server error


If the magento installed under /magento or directory then add the following rules into ” /home/username/public_html/magento/.htaccess ” file.


<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /magento/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /magento/index.php [L]
</IfModule>


Now Enjoy!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!