Advertisement
Guest User

adddd.phtml

a guest
Aug 7th, 2015
311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. <style type="text/css">
  2. .add-to-cart .input-text.qty {
  3. display: block !important;
  4. margin-bottom: 10px !important;
  5. }
  6. </style>
  7. <?php $_product = $this->getProduct(); ?>
  8. <?php $buttonTitle = $this->__('Add to Cart'); ?>
  9. <?php if($_product->isSaleable()): ?>
  10. <div class="add-to-cart">
  11. <?php if(!$_product->isGrouped()): ?>
  12. <label for="qty"><?php echo $this->__('Qty:') ?></label>
  13. <div class="qty-ctl">
  14. <button title="Decrease Qty" onclick="changeQty(0); return false;" class="decrease"><?php echo $this->__('decrease') ?></button>
  15. </div>
  16. <input type="text" name="qty" id="qty" maxlength="5" value="<?php echo $this->getProductDefaultQty() * 1 ?>" title="<?php echo $this->__('Qty') ?>" class="input-text qty" />
  17. <div class="qty-ctl">
  18. <button title="Increase Qty" onclick="changeQty(1); return false;" class="increase"><?php echo $this->__('increase') ?></button>
  19. </div>
  20.  
  21. <?php endif; ?>
  22. <?php
  23. $assignPro=Mage::getModel('mpassignproduct/mpassignproduct')->getAssignProDetails($_product->getId());
  24. ?>
  25. <?php if($assignPro['assignCount']): ?>
  26. <?php if($assignPro['sellerqty'] > 0): ?>
  27.  
  28. <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>
  29.  
  30. <?php endif; ?>
  31.  
  32. <?php else: ?>
  33. <button type="button" title="<?php echo $buttonTitle ?>" id="product-addtocart-button" class="button btn-cart" onclick="productAddToCartForm.submit(this)"><span><span><i class="fa fa-cart-arrow-down"></i><?php echo $buttonTitle ?></span></span></button>
  34. <div style="clear:both;"></div>
  35.  
  36.  
  37. <?php endif; ?>
  38. <?php echo $this->getChildHtml('', true, true) ?>
  39. <script type="text/javascript">
  40. function changeQty(increase) {
  41. var qty = parseInt($('qty').value);
  42. if ( !isNaN(qty) ) {
  43. qty = increase ? qty+1 : (qty>1 ? qty-1 : 1);
  44. $('qty').value = qty;
  45. }
  46. }
  47. </script>
  48. </div>
  49. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement