Showing posts with label magento. Show all posts
Showing posts with label magento. Show all posts

Monday, January 14, 2013

Remove Discount and Estimated shipping form Checkout page

To remove both Discount and Estimated shipping you need to edit checkout.xml file which is located at /app/design/frontend/base/default/layout/checkout.xml


go to line no: 89



<block type="checkout/cart_coupon" name="checkout.cart.coupon" as="coupon" template="checkout/cart/coupon.phtml"/>
                <block type="checkout/cart_shipping" name="checkout.cart.shipping" as="shipping" template="checkout/cart/shipping.phtml"/>
                <block type="checkout/cart_crosssell" name="checkout.cart.crosssell" as="crosssell" template="checkout/cart/crosssell.phtml"/>

       

comment out the highlighted portion like this


<!--
                <block type="checkout/cart_coupon" name="checkout.cart.coupon" as="coupon" template="checkout/cart/coupon.phtml"/>
                <block type="checkout/cart_shipping" name="checkout.cart.shipping" as="shipping" template="checkout/cart/shipping.phtml"/>

 -->


you are done. If still both the blocks appear clear cache. So finally your checkout page will look like this.



Thursday, January 10, 2013

Set default quantity of product to 1 in magento


By default magento takes quantity value to be "0". To change this you just need to edit addtocart.phtml file located at app/design/frontend/default/[your theme]/template/catalog/product/view/addtocart.phtml


<?php if($_product->isSaleable()): ?>
    <fieldset class="add-to-cart-box">
        <legend><?php echo $this->__('Add Items to Cart') ?></legend>
        <?php if(!$_product->isGrouped()): ?>
        <span class="qty-box"><label for="qty"><?php echo $this->__('Qty') ?>:</label>
        <input name="qty" type="text" class="input-text qty" id="qty" maxlength="12" value="<?php echo $this->getMinimalQty($_product) ?>" /></span>
        <?php endif; ?>
        <button class="form-button" onclick="productAddToCartForm.submit()"><span><?php echo $this->__('Add to Cart') ?></span></button>
    </fieldset>
<?php endif; ?>



just change the highlighted section to value="1" and you are done.

Friday, December 28, 2012

Change price box layout in magento product page

If you want to bring regular price, special price and discount in same line as shown below then u need to follow 2 easy steps.



Step 1:
go to the following location of your magento installation : /app/design/frontend/default/[your theme]/template/catalog/product/price.phtml

find the below code


<?php else: ?>
            <p class="special-price">
                <span class="price-label"><?php //echo $this->__('Web Price:') ?></span>
                <span class="price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
                    <?php echo $currency->formatPrecision($_finalPrice,0,false) ?>
                </span>
                <br/></p><p class="regular-price"><span><?php echo $this->__('Discount: ') ?></span>
<span class="regular-price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo '<span class="perecent-price">'.' ('.$_savingPercent.'%)'.'</span>'; ?></span>
            </p>

now we just need to edit the above highlighted code. so the final code will look like this.


<?php else: ?>
            <p class="special-price">
                <span class="price-label"><?php //echo $this->__('Web Price:') ?></span>
                <span class="price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
                    <?php echo $currency->formatPrecision($_finalPrice,0,false) ?>
                </span>
                </p><span class="regular-price"><?php echo $this->__('Discount: ') ?></span>
<span class="regular-price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"><?php echo '<span class="perecent-price">'.' ('.$_savingPercent.'%)'.'</span>'; ?></span>
         

what we have done here is simply removed the <br/> tag and removed <p> tag. The CSS style given to <p> tag has been now given to <span> please see the highlighted portion above.

Once you have done this you will need to change your style.css file so that Discount would not mess up category page.


Step 2:
Now go to your styles.css file there find .special-price .price and increase the width.


Before

.special-price .price {
  1. floatleft;
  2. width70px;



After

.special-price .price {
  1. floatleft;
  2. width140px;   <------ Increase this value depending on your category page layout



This will push Discount to next line on category page. If you dont edit your css than category page will be in mess like this.