I am guessing that the easiest way to do this would be to delete the lines that output quantity options, then one would be selected by default, and the user would not be able to change it. You would have to do the field in the cart as well as anywhere else it appears.
The bad part of this, is that if a user accidentally adds it twice, it will show twice the price, but the user will not know why. This is relatively unlikely and will do for a first build, but eventually this rough hack will fall down. I suppose you could find the line that actually multiplies unit price by quantity for line total, and just make linetotal equal the original price - which would solve it but I dont know where that line is.
I hope this helps,
Paul.
The bad part of this, is that if a user accidentally adds it twice, it will show twice the price, but the user will not know why. This is relatively unlikely and will do for a first build, but eventually this rough hack will fall down. I suppose you could find the line that actually multiplies unit price by quantity for line total, and just make linetotal equal the original price - which would solve it but I dont know where that line is.
I hope this helps,
Paul.
I would like to know this too. I am using 1.4.9.3 and found these lines that relate to the cart view;
..\catalog\controller\checkout\cart.php
I am thinking this would need to be commented out. But, there is more 'Quantity' coding below that I am not sure of.
Can someone help us out?
..\catalog\controller\checkout\cart.php
Code: Select all
(isset($this->request->get['quantity'])) {
$quantity = $this->request->get['quantity'];
} else {
$quantity = 1;
}
Can someone help us out?
(1.4.x)
1. EDIT: catalog/view/theme/default/template/product/product.tpl
2. FIND:
3. REPLACE WITH:
1. EDIT: catalog/view/theme/default/template/product/product.tpl
2. FIND:
Code: Select all
<input type="text" name="quantity" size="3" value="<?php echo $minimum; ?>" />
Code: Select all
<input type="hidden" name="quantity" size="3" value="<?php echo $minimum; ?>" />
Thanks Q
You may also want to comment the line before that one.
You may also want to comment the line before that one.
Code: Select all
<!-- ?php echo $text_qty; ? -->
it's going to be pretty much the same as in 1.4.x all you need to do is change the input from a text to a hidden and remove the qty label.
OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter
!!! Finally, I found the solution !!!
This will make quantity of the product always equal 1.
I'm using OC 1.5.2.1, but I think it's gonna be the same on other versions, anyway here what I done:
in /system/library/cart.php
add line right before
That's it. All you have to do now, is hide all the quantity fields from .tpl files
see example: http://rultrastar.com
This will make quantity of the product always equal 1.
I'm using OC 1.5.2.1, but I think it's gonna be the same on other versions, anyway here what I done:
in /system/library/cart.php
add line
Code: Select all
$quantity=1;
Code: Select all
$this->data[$key] = array(
see example: http://rultrastar.com
So I have a similar need, however, I need some items to have quantities and some not. I could filter based on the category of the product. Does anyone know where to look to make the quantity 1 and the quantity field hidden when the category = 'x'?
hello .. i am using ver 1.5.6.1
thanks for the info for this neet trick concerning the quantity . thanks guys! But .. there's a hitch ...whatever i input in the text area the total quantity is still 1 everywhere but if i hide the input text the price autoupdate for the options stops working ... this is only a viasual problem the inner parts work fine at the total - checkout how can i set up the options on the product page to send the quantity to 1 by default and not be dependable on that text input field
Thanks hope to hear from you guys soon
thanks for the info for this neet trick concerning the quantity . thanks guys! But .. there's a hitch ...whatever i input in the text area the total quantity is still 1 everywhere but if i hide the input text the price autoupdate for the options stops working ... this is only a viasual problem the inner parts work fine at the total - checkout how can i set up the options on the product page to send the quantity to 1 by default and not be dependable on that text input field
Thanks hope to hear from you guys soon
Who is online
Users browsing this forum: Bing [Bot] and 17 guests