mjump54 Posted September 22, 2009 Posted September 22, 2009 My client is a custom handcrafted jeweler and only makes 1 of each item. I would like to have the cart not display the the standard QTY box with 1 as the default - or have it display the item QTY of 1 but not be editable. Since each item is unique, I really don't see a point of displaying the QTY so if there is a way to hide this from the buyer that would work great. And since the client is my wife :) the sooner I fix this the sooner there will be peace in the house.
♥ecartz Posted September 22, 2009 Posted September 22, 2009 In shopping_cart.php, find (around lines 72-74) and remove $info_box_contents[0][] = array('align' => 'center', 'params' => 'class="productListing-heading"', 'text' => TABLE_HEADING_QUANTITY); Then find (around lines 116-118) $info_box_contents[$cur_row][] = array('align' => 'center', 'params' => 'class="productListing-data" valign="top"', 'text' => tep_draw_checkbox_field('cart_delete[]', $products[$i]['id'])); and replace it with $info_box_contents[$cur_row][] = array('align' => 'center', 'params' => 'class="productListing-data" valign="top"', 'text' => tep_draw_checkbox_field('cart_delete[]', $products[$i]['id']) . tep_draw_hidden_field('cart_quantity[]', 1) . tep_draw_hidden_field('products_id[]', $products[$i]['id'])); and then find (around lines 148-150) and remove $info_box_contents[$cur_row][] = array('align' => 'center', 'params' => 'class="productListing-data" valign="top"', 'text' => tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4"') . tep_draw_hidden_field('products_id[]', $products[$i]['id'])); You might be able to leave the cart_quantity[] part out all together and just move the products_id[] part, but I'm not sure so I'd suggest that you leave it. I think that if you removed the quantity field all together, you'd have to remove } else { if (PHP_VERSION < 4) { // if PHP3, make correction for lack of multidimensional array. reset($HTTP_POST_VARS); while (list($key, $value) = each($HTTP_POST_VARS)) { if (is_array($value)) { while (list($key2, $value2) = each($value)) { if (ereg ("(.*)\]\[(.*)", $key2, $var)) { $id2[$var[1]][$var[2]] = $value2; } } } } $attributes = ($id2[$HTTP_POST_VARS['products_id'][$i]]) ? $id2[$HTTP_POST_VARS['products_id'][$i]] : ''; } else { $attributes = ($HTTP_POST_VARS['id'][$HTTP_POST_VARS['products_id'][$i]]) ? $HTTP_POST_VARS['id'][$HTTP_POST_VARS['products_id'][$i]] : ''; } $cart->add_cart($HTTP_POST_VARS['products_id'][$i], $HTTP_POST_VARS['cart_quantity'][$i], $attributes, false); from includes/application_top.php (around lines 339-356). Warning: if your files are modified, you may have to adjust these instructions in some way. In principle, you are changing an input field to a hidden field and moving it along with the other hidden fields from the quantity column to the delete column. Then you are removing the quantity column. If your quantity column includes something other than what the stock version does, you may have to move it as well. Always back up before making changes.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.