Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Tweaks › How to Remove the Quanity Field
Tagged: Hide Quantity, Remove Quantity
- This topic has 7 replies, 4 voices, and was last updated 13 years, 4 months ago by amin007.
-
AuthorPosts
-
October 13, 2009 at 9:21 am #370amin007Participant
Here is a quick and dirty way to remove the quantity from the shopping cart.
1. First remove the table header – search for the following in the “eStore_cart.php” file and delete it:
<th>Quantity</th>
2. Now delete the table data where it has the textbox to display the quantity field. Search for the following line:
<td style='text-align: center'><form method="post" action="" name='peStore_cquantity' style='display: inline'>
Now delete starting from the <td> to the end of that block (</td>)
This way the customers won’t see the quantity field and won’t be able to change it either.
October 13, 2009 at 9:25 am #15759amin007ParticipantThe above will remove the “Quantity” header from the table so customer won’t see it but they can still click the “Add to Cart” button twice the quantity will go up. So to take care of that open the “wp_eStore1.php” file and look for the following block of code:
if ($item['name'] == stripslashes($_POST['product']))
{
$req_qty = $item['quantity']+1;
$update_quantity = is_quantity_availabe($item['item_number'],$req_qty);
$count += $item['quantity'];
if ($update_quantity)
{
$item['quantity']++;
unset($products[$key]);
array_push($products, $item);
}
}Once you find it, change it to the following to finalize the quantity removal:
if ($item['name'] == stripslashes($_POST['product']))
{
$count =2;
}Thanks to Ian Clarke for modifying the code to match with the current version of eStore.
July 7, 2010 at 10:29 am #15760anotherbreedMemberI would like to be able to do that within the Settings page. Maybe in the next update?
That is a very common thing for digital products (one of the biggest purpose of WP eStore).
Altering the code is not for everyone and we have to do it everytime a new version of WP eStore is relased.
Thank you.
January 22, 2011 at 6:23 pm #15761fpierronMemberDid you do something to simplify this ?
I have modified the code but it would be great to have someting easier…
I believe it should be something too hard and too complex for you but it would be usefull.
January 22, 2011 at 6:58 pm #15762fpierronMemberI have modified the output to have the quantity visible as it is less anxious for my client, but it is impossible to make change.
$output .= ‘
<tr>
<th style=”text-align: left”>’.ESTORE_ITEM_NAME.'</th><th style=”text-align: left”>’.ESTORE_QUANTITY.'</th><th style=”text-align: left”>’.ESTORE_PRICE.'</th><th></th>
</tr>’;
foreach ($_SESSION as $item)
{
$output .= “
<tr><td style=’overflow: hidden;’>“.$item.”</td>
<td style=’text-align: left’>”.$item.”</td>
<td style=’text-align: left’>”.print_digi_cart_payment_currency(($item * $item), $currency_symbol, $decimal).”</td>
<td style=’text-align: left’><form method=”post” action=””>
<input type=”hidden” name=”product” value=””.htmlspecialchars($item).”” />
<input type=’hidden’ name=’eStore_delcart’ value=’1′ />
<input type=’image’ src='”.WP_ESTORE_URL.”/images/Shoppingcart_delete.gif’ class=’eStore_remove_item_button’ value=’Remove’ title='”.ESTORE_REMOVE_ITEM.”‘ /></form></td></tr>
“;
This output and the original could be in a checkbox in the settings ?
July 27, 2011 at 5:56 am #15763amin007ParticipantAdded an option for this in the settings menu now. If you do not want to show the quantity in the shopping cart simply check the “Do Not Show Quantity in Shopping Cart” checkbox in the general settings of eStore.
August 2, 2011 at 5:34 pm #15764jetsetpeasantMemberHi,
Thanks for updating that in the settings menu, but for some reason I can’t see it. Is there anything additional I need to do, for example do a manual update or something? I’m currently running version 4.9.1 and assume that it auto updates, since my original download link expired shortly after I bought your product last February. Thanks in advance for any help!
August 3, 2011 at 2:19 am #15765 -
AuthorPosts
- You must be logged in to reply to this topic.