Post by alexdog1805 » Tue Apr 16, 2013 5:41 pm

is possible to introduce the posibility to make an order from category page by introducing the $text_qty?

i want to introduce the quantity input in category page near the order text in category page.

Active Member

Posts

Joined
Sat May 28, 2011 1:51 am

Post by Xyph3r » Tue Apr 16, 2013 8:44 pm

Hello!

in category.tpl

find

Code: Select all

<div class="cart">
        <input type="button" value="<?php echo $button_cart; ?>" onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button" />
      </div>
replace with

Code: Select all

<div class="cart">
	  <script type="text/javascript">
	  function addQtyToCart(product_id) {
  var qty = $('.item-' + product_id).val();
  if ((parseFloat(qty) != parseInt(qty)) || isNaN(qty)) {
    qty = 1;
  }
  addToCart(product_id, qty);
}
</script>
	Qty:
       <input type="text" value="1" size="2" class="item-<?php echo $product['product_id']; ?>" />
	   <input type="button" value="<?php echo $button_cart; ?>" onclick="addQtyToCart('<?php echo $product['product_id']; ?>');" class="button" />
      </div>

ImageImageImage
Opencart Templates, Modules, Themes & Custom Development | ShopThemer


User avatar
Active Member

Posts

Joined
Sun Feb 10, 2013 1:08 am


Post by javox » Tue Nov 10, 2015 9:54 am

Looks great! Can you update this for 2.x?

Newbie

Posts

Joined
Sun Aug 09, 2015 10:02 am

Post by karimla131 » Sat Nov 28, 2015 7:37 am

good day ...

kindly i do have new theme i tried this in defualt theme and it worked well but i dont know why it is not working in this theme ....

my website is : http://www.5odfekra.com/zomaa/index.php ... path=17_36

thank you and please i need this .. :)

Newbie

Posts

Joined
Wed Mar 12, 2014 7:35 pm
Location - Usa
Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot] and 20 guests