Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › Validate On Qty Text box
- This topic has 9 replies, 2 voices, and was last updated 12 years, 8 months ago by gerardyap.
-
AuthorPosts
-
March 2, 2012 at 11:07 am #5727gerardyapMember
Hi,
the present estore plugin allow invalid character to be entered in the qty textbox. Would need advice on how to validate the textbox which allow only numeric value.
Also, would it be possible to update the Qty using hyperlink word eg. Update. If user wants to change qty in the textbox. He/she will make amendment on the qty textbox followed by clicking the update word below the textbox. Once thats done, the word will Saved will be reflected.
Thanks
March 3, 2012 at 2:00 am #42588adminKeymasterWe try to keep the number of buttons in the shopping cart to a minimum so that the same shopping cart can be used on a sidebar (too many buttons in the cart makes it hard to fit in the sidebar). When you change the quantity value in the shopping cart it will automatically display the following warning which tells the customer what to do:
Hit enter to submit new Quantity
This seem to work well but I understand what you are asking for. I have just added an option so that you can show an “Update” button next to the quantity field in the shopping cart. Please get a new build of the plugin from here:
https://support.tipsandtricks-hq.com/update-request
Then find the following line of code in the “eStore_advanced_configs.php” file:
define('WP_ESTORE_SHOW_UPDATE_BUTTON_FOR_QTY_CHANGE', '0');
Once you find it change it to the following to enable this option:
define('WP_ESTORE_SHOW_UPDATE_BUTTON_FOR_QTY_CHANGE', '1');
Also, it will show an error message if a customer enters a non numeric value in the quantity field.
March 5, 2012 at 7:00 pm #42589gerardyapMemberHi,
it works with the update button..what would be the code to add if i would like to have a box that surround the qty portion ? i tried adding the following code below on eStore cart php, but it was unsuccessful. Do you guys do customization of this plugin for a fee ? I have the intention to send my requirement and need someone to help me to modify the plugin according to my preference.
$output .= “<td style=’text-align: left’><form method=”post” action=”” name=’peStore_cquantity’ style=’display: inline-block;border-width:1px;border-style:Solid;border-color:#BFBFBF;width:30px’>
<input type=”hidden” name=”product” value=””.htmlspecialchars($item).”” />
<input type=’hidden’ name=’eStore_cquantity’ value=’1′ /><input type=’text’ name=’quantity’ value='”.$item.”‘ size=’1′ class=’eStore_cart_item_qty’ />”;
if(WP_ESTORE_SHOW_UPDATE_BUTTON_FOR_QTY_CHANGE === ‘1’){
$output .= ‘<input type=”submit” value=”‘.ESTORE_UPDATE.'” class=”eStore_update_qty” />’;
}
$output .= “</form></td>”;
}
March 6, 2012 at 12:08 am #42590adminKeymasterYou should be able to do that just from the CSS by adding border to your text input inside the cart. Yeah we take on some customization work from time to time. You can use the contact form on the site to get in touch with us and discuss details.
March 8, 2012 at 5:08 pm #42591gerardyapMemberHi,
noted with thanks.
March 12, 2012 at 2:47 pm #42592gerardyapMemberHi,
I tried entering non numeric value in the quantity, but there isn’t any error shown. I have done define(‘WP_ESTORE_SHOW_UPDATE_BUTTON_FOR_QTY_CHANGE’, ‘1’) , but still fail.
Do advise.
March 13, 2012 at 1:27 am #42593adminKeymasterPost a link to the page where I can go and add an item to the cart.
March 13, 2012 at 1:36 am #42594gerardyapMemberhi,
my web is live and link is under draft mode. I’m afraid if i published it, it may cause some miscommunication. Is there any other ways to do it.
my website is http://www.mjhub.biz
March 13, 2012 at 8:00 am #42595gerardyapMemberMarch 13, 2012 at 8:57 am #42596gerardyapMemberHi,
I manage to find a solution. thanks for your help
-
AuthorPosts
- You must be logged in to reply to this topic.