Advertisement
Guest User

add

a guest
Aug 6th, 2015
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.47 KB | None | 0 0
  1. <?php
  2. /**
  3. * Magento
  4. *
  5. * NOTICE OF LICENSE
  6. *
  7. * This source file is subject to the Academic Free License (AFL 3.0)
  8. * that is bundled with this package in the file LICENSE_AFL.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://opensource.org/licenses/afl-3.0.php
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@magentocommerce.com so we can send you a copy immediately.
  14. *
  15. * DISCLAIMER
  16. *
  17. * Do not edit or add to this file if you wish to upgrade Magento to newer
  18. * versions in the future. If you wish to customize Magento for your
  19. * needs please refer to http://www.magentocommerce.com for more information.
  20. *
  21. * @category design
  22. * @package base_default
  23. * @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
  24. * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
  25. */
  26. ?>
  27. <?php $_product = $this->getProduct(); ?>
  28. <?php $buttonTitle = $this->__('Add to Cart'); ?>
  29. <?php if($_product->isSaleable()): ?>
  30. <div class="add-to-cart">
  31. <?php if(!$_product->isGrouped()): ?>
  32. <label for="qty"><?php echo $this->__('Qty:') ?></label>
  33. <div class="qty-ctl">
  34. <button title="Decrease Qty" onclick="changeQty(0); return false;" class="decrease"><?php echo $this->__('decrease') ?></button>
  35. </div>
  36. <input type="text" name="qty" id="qty" maxlength="5" value="<?php echo $this->getProductDefaultQty() * 1 ?>" title="<?php echo $this->__('Qty') ?>" class="input-text qty" />
  37. <div class="qty-ctl">
  38. <button title="Increase Qty" onclick="changeQty(1); return false;" class="increase"><?php echo $this->__('increase') ?></button>
  39. </div>
  40. <?php endif; ?>
  41. <div class="button_addto"><i class="fa fa-shopping-cart"></i>
  42.  
  43. <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>
  44. <?php echo $this->getLayout()->getBlock('product.info.addto')->toHtml()?>
  45. </div>
  46. <?php echo $this->getChildHtml('', true, true) ?>
  47. <script type="text/javascript">
  48. function changeQty(increase) {
  49. var qty = parseInt($('qty').value);
  50. if ( !isNaN(qty) ) {
  51. qty = increase ? qty+1 : (qty>1 ? qty-1 : 1);
  52. $('qty').value = qty;
  53. }
  54. }
  55. </script>
  56. </div>
  57. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement