Post by dsilver » Tue Jun 16, 2009 5:38 am

How can I disable the quantity feature because it only makes sense for people to download my product once.
Thank you very much!

Newbie

Posts

Joined
Tue Jun 16, 2009 5:37 am


Post by pauld » Tue Jun 16, 2009 6:23 am

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.

New member

Posts

Joined
Sat May 23, 2009 11:44 pm

Post by Anzy » Wed Jun 22, 2011 3:33 pm

I have same interest. Does anyone know where I could find the line that actually multiplies unit price by quantity for line total and how I will mod that?

Newbie

Posts

Joined
Mon Jun 20, 2011 7:47 pm

Post by KrownProducts » Fri Jun 24, 2011 6:14 pm

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

Code: Select all

(isset($this->request->get['quantity'])) {
    $quantity = $this->request->get['quantity'];
   } else {
    $quantity = 1;
   }
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?

Newbie

Posts

Joined
Fri Jun 24, 2011 5:37 pm

Post by Qphoria » Fri Jun 24, 2011 8:43 pm

(1.4.x)
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; ?>" />
3. REPLACE WITH:

Code: Select all

<input type="hidden" name="quantity" size="3" value="<?php echo $minimum; ?>" />

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by KrownProducts » Fri Jun 24, 2011 9:47 pm

Thanks Q

You may also want to comment the line before that one.

Code: Select all

<!-- ?php echo $text_qty; ? -->

Newbie

Posts

Joined
Fri Jun 24, 2011 5:37 pm

Post by mkc » Mon Nov 07, 2011 12:02 am

Anyone have an answer for this in 1.5.x?

I run an online consignment shop so we dont have multiples of anything. I'd just like to remove quantities altogether.

mkc
New member

Posts

Joined
Sun Nov 06, 2011 11:20 pm

Post by Xsecrets » Mon Nov 07, 2011 1:48 am

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


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by mkc » Mon Nov 07, 2011 5:22 am

Nice, thanks man. What about removing the quantity from the checkout? I tried a few TPLs in the checkout folder, but nothing - unless I'm missing something.

EDIT: nvm, I found it in the cart.tpl ::)

mkc
New member

Posts

Joined
Sun Nov 06, 2011 11:20 pm

Post by rultrastar.com » Sat Mar 17, 2012 9:45 am

!!! 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

Code: Select all

$quantity=1;
right before

Code: Select all

$this->data[$key] = array(
That's it. All you have to do now, is hide all the quantity fields from .tpl files
see example: http://rultrastar.com


Posts

Joined
Sat Mar 17, 2012 9:29 am

Post by Discwog » Thu Mar 29, 2012 11:05 pm

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'?

Newbie

Posts

Joined
Sat Apr 09, 2011 2:22 am

Post by scr33ky » Fri Feb 28, 2014 4:43 am

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

New member

Posts

Joined
Mon Nov 29, 2010 4:25 am
Who is online

Users browsing this forum: Bing [Bot] and 93 guests