1

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.

2
  • Well that all depends on the theme. You can do it with 2 lines of css in the rwd theme. img1.picload.org/image/powgard/…
    – tecjam
    Commented Oct 27, 2015 at 15:32
  • @tecjam how would someone go about duplicating that price block instead of moving it? so having 2 on the same page? Commented Aug 10, 2016 at 20:20

1 Answer 1

1

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; ?>
1
  • What if we needed that price to change based on simple products? Commented Aug 10, 2016 at 20:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.