Welcome, Guest. Please login or register.
Login with username, password and session length


It's a release candidate! VirtueMart 2.0 RC - the next generation VirtueMart - is available! Read more....

  Advanced search

247038 Posts in 67506 Topics- by 258314 Members - Latest Member: aniketana
Pages: [1]   Go Down
Print
Author Topic: Quantity Options  (Read 5937 times)
maillme
Newbie
*
Posts: 7


« on: March 18, 2009, 09:10:18 AM »

Hi there,

Im new to virtuemart and have been getting to grips with things. I have 1200 products, all different - of which I have only 1 of each.

So, i figured it would be best to hide the quantity box, and just allow the customer to add to cart.

I can do this manually through the admin panel - and to see the format for this within a csv - i exported my products. The text for the field "quantity_options" = hide

So, for all my products, i made this = hide.

However, this does not hid the quantity field - how do i hide this by default?

many thanks,
Neil
Logged

Using:

Joomla: v1.5.9 (In Legacy Mode: 1.0)
Virtuemart: v1.1.2
CSV Improved: v0.9

On: http://www.old-vinyl.com

Complete Newbie!
ledom
Newbie
*
Posts: 17


« Reply #1 on: March 19, 2009, 09:46:51 AM »

Hi!

Same problem, I need hide quantity by default. I don't found any solution into admin panel. Is there a file I can modify?

Thanks
Logged
Sid.
Newbie
*
Posts: 38



WWW
« Reply #2 on: April 27, 2009, 20:29:18 PM »

>> THIS IS A VM 1.1.X POST... sorry <<
>> The initial poster is using 1.1.2, I see, and I posted this before I realized which forum I was in.  <<

For the Product Details page I changed /components/com_virtuemart/themes/default/templates/product_details/includes/quantity_box_general.tpl.php around lines 9 and 45 respectively from this (which displays the <label>):
(lines 7-10)
Code:
$html = '';
if(!$child && $display_type != 'hide') {
$html = '<label for="quantity'.$prod_id.'" class="quantity_box">'.$VM_LANG->_('PHPSHOP_CART_QUANTITY').':&nbsp;</label>';
}

and line 45 which displays the Quantity Box:

Code:
case "none" :
default:
$html .= '<input type="text" class="inputboxquantity" size="4" id="quantity'.$prod_id.'" name="quantity[]" value="'.$quantity.'" />
<input type="button" class="quantity_box_button quantity_box_button_up" onclick="var qty_el = document.getElementById(\'quantity'.$prod_id.'\'); var qty = qty_el.value; if( !isNaN( qty )) qty_el.value++;return false;" />
<input type="button" class="quantity_box_button quantity_box_button_down" onclick="var qty_el = document.getElementById(\'quantity'.$prod_id.'\'); var qty = qty_el.value; if( !isNaN( qty ) && qty > 0 ) qty_el.value--;return false;" />
';
break;
}

Updated lines 7-10 to the following in order to remove the "Quanity" Label:

Code:
$html = '';
if(!$child && $display_type != 'hide') {
$html = '';
}

and line 45 again to Hide the Quantity Box:

Code:
case "none" :
default:
$html .= '<input type="hidden" id="quantity'.$prod_id.'" name="quantity[]" value="1" />';
break;
}


And this accomplishes a fix for the front-end, where I don't want customers to have the option of additional quantities, but this does not solve my problem in that from the Admin side, when entering New Products, the Display Options are defaulted to show the Quantity Box.

I would like all New Products to have their Display Options default to "Hide Quantity Box" so that the above workaround isn't necessary.  Does anyone know where the file is that would allow us to change the default of all new products to Hide the Quantity Box?
« Last Edit: April 27, 2009, 20:32:06 PM by Sid. » Logged
LenFR
Newbie
*
Posts: 1


« Reply #3 on: August 12, 2009, 06:32:02 AM »

It works:

File:
product.product_form.php

Change in line 51:
$display_type = "hide";

It's all Smiley
Logged
Pages: [1]   Go Up
Print
Jump to: