Magento – Product page – How to move price block next to ‘Add to Cart’ button

layoutmagento-1.9priceproduct-page

What is the best way to move the price block down to the 'Add to Cart' button on a product page? It needs to be in line with the button. I've read various answers on google to do something similar but can't find exactly what my client wants.

Best Answer

In your addtocart.phtml file

app\design\frontend\your_package\your_theme\template\catalog\product\view\addtocart.phtml

You can call price html

<?php $_product = $this->getProduct(); ?>

<?php echo $this->getPriceHtml($_product) ?>

<?php $buttonTitle = $this->__('Add to Cart'); ?>
<?php if($_product->isSaleable()): ?>
    <div class="add-to-cart">
        <?php if(!$_product->isGrouped()): ?>
        <label for="qty"><?php echo $this->__('Qty:') ?></label>
        <input type="text" name="qty" id="qty" maxlength="12" value="<?php echo $this->getProductDefaultQty() * 1 ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Qty')) ?>" class="input-text qty" />
        <?php endif; ?>
        <button type="button" title="<?php echo $buttonTitle ?>" id="product-addtocart-button" class="button btn-cart" onclick="productAddToCartForm.submit(this)"><span><span><?php echo $buttonTitle ?></span></span></button>
        <?php echo $this->getChildHtml('', true, true) ?>
    </div>
<?php endif; ?>
Related Topic