Author Topic: Remove Quantity box on browse page problem  (Read 33799 times)

Jubez

  • Beginner
  • *
  • Posts: 4
Re: Remove Quantity box on browse page problem
« Reply #15 on: June 02, 2010, 14:33:39 pm »
To remove the quanity input box and the up/down arrows. remove the line:
Quote
echo $ps_product_attribute->show_quantity_box($product_id,$product_id);

and add this after

Quote
<input type="hidden" class="inputboxquantity" size="4" id="quantity24" name="quantity[]" value="1" />

This worked for me! Thanks mkst! :D

orasis

  • Beginner
  • *
  • Posts: 39
Re: Remove Quantity box on browse page problem
« Reply #16 on: October 13, 2010, 06:42:16 am »
Related to the Flypage Quantity Box, ...well you could just do something else, it will effect all the OLD products that you never touched the:

Quantity:
Standard Quantity Box
Hide Quantity Box
Use Dropdown Box
Use Check Box
Use Radio Box

..checkboxes, and also of course all the NEW products you will create after this.

All you have to do is to set the "Hide Quantity Box" to be checked by Default.

go to this file:
/administrator/components/com_virtuemart/html/product.product_form.php

find this line:
Code: [Select]
<input type="radio" class="radio" style="vertical-align: middle;" id="quantity_box1" name="quantity_box" value="hide" <?php 
                
if ($display_type == "hide") echo "checked=\"checked\""?>
/>

.. all you have to do is add this:

Code: [Select]
checked="checked"
so it will look like this:

Code: [Select]
<input type="radio" class="radio" style="vertical-align: middle;" id="quantity_box1" name="quantity_box" value="hide" checked="checked" <?php 
                
if ($display_type == "hide") echo "checked=\"checked\""?>
/>

cheers !

dibipi

  • Beginner
  • *
  • Posts: 6
Re: Remove Quantity box on browse page problem
« Reply #17 on: October 13, 2010, 17:40:29 pm »
Thanks, O.D., for showing in which file one would change the default radio button choice for the Quantity Display Option for all products, but it does not involve changing (and breaking?) the code as you have done. Simply setting the initial value of $display_type to "hide" will set the default, but still properly display any changes made to this value for a product.

i.e., line 51:  $display_type = "hide";

Thanks for your input!
Davis

orasis

  • Beginner
  • *
  • Posts: 39
Re: Remove Quantity box on browse page problem
« Reply #18 on: October 13, 2010, 19:00:16 pm »
hi !

I was though this before I posted and all I found out is that if you set it the way I said, then this button will be forever set to hide (meaning you cannot change it again then). which is same as removing code,. its like killing it :)

Edit: by the way,.. if you test the original state, this button there needs 2 times to save or apply in order to change it's position, at the same time that it does it's job on the front-end. So there must a be a tiny bug there with this button. Tested on lan linux server with from scrach installations that I use for testing things like that

g2mXagent

  • Beginner
  • *
  • Posts: 7
Re: Remove Quantity box on browse page problem
« Reply #19 on: April 05, 2011, 19:57:54 pm »
Another way to do the same thing:
in the file which actually displays the quantity box, you can choose what page or other condition has to be met.

/components/com_virtuemart/themes/default/templates/product_details/includes/quantity_box_general.tpl.php
of course, you would copy the default folder to your own theme name and select that in the VC admin so that you can always fall back on the default theme if you have to

around line 7 (i'm including the line either side of my additions)
Code: [Select]
extract( $quantity_options );
// add this test to only show the quantity selector on the details page
if($page != shop.product_details) {
$display_type = "hide";
}

$html = '';


It was perfect, just a little bit of small change:
Code: [Select]
if($page != "shop.product_details") {
$display_type = "hide";
}
just add a double quote for "shop.product_details". remove the quantity selector on the browse page only, and to keep it on the flypages!

Virtuemarts

  • Beginner
  • *
  • Posts: 18
    • Virtuemarts.com
Re: Remove Quantity box on browse page problem
« Reply #20 on: April 11, 2011, 17:49:29 pm »
You can simply remove the quantity box from: Products-> List all products-> Select a product-> Display options-> Hide Quantity Box.
www.Virtuemarts.com
Free and Premium Virtuemart Themes.

orasis

  • Beginner
  • *
  • Posts: 39
Re: Remove Quantity box on browse page problem
« Reply #21 on: April 11, 2011, 18:21:23 pm »
You can simply remove the quantity box from: Products-> List all products-> Select a product-> Display options-> Hide Quantity Box.

this is not the case of this topic :)

Sid.

  • Beginner
  • *
  • Posts: 42
    • SidFilmz
Re: Remove Quantity box on browse page problem
« Reply #22 on: April 14, 2011, 02:24:30 am »
Found the simplest way to make the back-end default to "Hide Quantity Box" on all pages of any new products.

At the top of the file 'administrator/components/com_virtuemart/html/product.product_form.php' are the following variables already:

Code: [Select]
$product_parent_id = vmGet( $_REQUEST, 'product_parent_id');
$next_page = vmGet( $_REQUEST, 'next_page', "product.product_display" );
$option = empty($option)?vmGet( $_REQUEST, 'option', 'com_virtuemart'):$option;
$clone_product = vmGet( $_REQUEST, 'clone_product', 0 );
$extra_ids = '';
$display_use_parent="";
$product_list="";
$display_header="";
$product_list_child="";
$product_list_type="";
$display_desc="";
$desc_width="20%";
$attrib_width="10%";
$display_type = "none";
$child_class_sfx ="";
$min_order="";
$max_order="";

Just change:

Code: [Select]
$display_type = "none";

to

Code: [Select]
$display_type = "hide";

Was that really there this whole time?  It pays to read through the files once in a while to find the default values, rather than just searching for that one attribute that you know you want to change :)

orasis

  • Beginner
  • *
  • Posts: 39
Re: Remove Quantity box on browse page problem
« Reply #23 on: April 14, 2011, 02:39:04 am »
sounds like you tested it, sounds good.
I will test it as soon as possible. :-)

beneath

  • Beginner
  • *
  • Posts: 8
    • Mikro Princ
Re: Remove Quantity box on browse page problem
« Reply #24 on: October 25, 2011, 12:37:12 pm »
Quote
It was perfect, just a little bit of small change:
Code: [Select]
if($page != "shop.product_details") {
$display_type = "hide";
}
just add a double quote for "shop.product_details". remove the quantity selector on the browse page only, and to keep it on the flypages!

What would be the code if i wanted to remove quantity box only on featured products at main page (but not on same products in browse table or w/e is used)?