Hide Quantity

  • Nathan Kolet
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
5 years 6 months ago - 5 years 6 months ago #57734 by Nathan Kolet
Hide Quantity was created by Nathan Kolet
We sell handmade products and only ever have 1 in stock. Is it possible to hide the quantity selector?

I know about hiding it on the category page, but I want to hide it on the product page as well.
Last edit: 5 years 6 months ago by Nathan Kolet. Reason: Note about hiding on product page

Please Log in or Create an account to join the conversation.

  • Giang Dinh Truong
  • Giang Dinh Truong's Avatar
  • Offline
  • Administrator
  • Administrator
More
5 years 6 months ago #57755 by Giang Dinh Truong
Replied by Giang Dinh Truong on topic Hide Quantity
Hi again Nathan,
Unfortunately, there is no option to turn quantity box off in the product details page now. You can modify the file components/com_eshop/themes/default/views/product/default.php to hide it.
Hope that this will help.
Sincerely, Giang

Please Log in or Create an account to join the conversation.

  • Nathan Kolet
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
5 years 6 months ago - 5 years 6 months ago #57803 by Nathan Kolet
Replied by Nathan Kolet on topic Hide Quantity
I didnt want to change anything for the catalog mode so I only removed this at line 488. Hopefully this wont cause any issues with other parts of the component. Now it looks like this

<div class="input-append input-prepend">
									<input type="hidden" name="id" value="<?php echo $this->item->id; ?>" />
									<label class="btn"><?php echo JText::_('ESHOP_QTY'); ?>:</label>
									<span class="eshop-quantity">
										<a class="btn btn-default button-minus spin-down" id="<?php echo $this->item->id; ?>" data="down">-</a>
										<input type="text" class="eshop-quantity-value" id="quantity_<?php echo $this->item->id; ?>" name="quantity" value="1" />
										<a class="btn btn-default button-plus spin-up" id="<?php echo $this->item->id; ?>" data="up">+</a>
									</span>
								</div>
Last edit: 5 years 6 months ago by Nathan Kolet.

Please Log in or Create an account to join the conversation.

  • Nathan Kolet
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
5 years 6 months ago #57806 by Nathan Kolet
Replied by Nathan Kolet on topic Hide Quantity
Scratch that!! Had to put that back. Without it there was no value of 1 to add the item in the cart and it broke the add to cart feature. I will continue to research.

Please Log in or Create an account to join the conversation.

  • Nathan Kolet
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
5 years 6 months ago #57811 by Nathan Kolet
Replied by Nathan Kolet on topic Hide Quantity
so here is what I finally did please advice on if this is ok

I removed
<label class="btn"><?php echo JText::_('ESHOP_QTY'); ?>:</label>
									<span class="eshop-quantity">
										<a class="btn btn-default button-minus spin-down" id="<?php echo $this->item->id; ?>" data="down">-</a>

and
<a class="btn btn-default button-plus spin-up" id="<?php echo $this->item->id; ?>" data="up">+</a>

and changed class of below to hidden to give the add to cart the value of 1
<input type="text" class="hidden" id="quantity_<?php echo $this->item->id; ?>" name="quantity" value="1" />

Please Log in or Create an account to join the conversation.

  • Giang Dinh Truong
  • Giang Dinh Truong's Avatar
  • Offline
  • Administrator
  • Administrator
More
5 years 6 months ago #57926 by Giang Dinh Truong
Replied by Giang Dinh Truong on topic Hide Quantity
Hi Nathan,
Simply remove the quantity check box, label and minus, plus buttons. You don't need to add hidden tag because if quantity is not set, it will get default value is 1. But if you still use hidden, that is no problem.
I think your code should work.
Sincerely, Giang

Please Log in or Create an account to join the conversation.

Moderators: Giang Dinh Truong