Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Tweaks › Minor issues with inventory
Tagged: inventory, manage products, need help, shopping cart, shortcode
- This topic has 6 replies, 2 voices, and was last updated 13 years, 11 months ago by marizs23.
-
AuthorPosts
-
December 15, 2010 at 4:21 pm #2372marizs23Member
I will first start off by saying that eStore is a great plugin. Of course, I first tried almost all of the free ones that claimed to have lots of features, but they always had some fatal error which kept me from using them. I am glad I purchased eStore and have no regrets.
First thing is a small bug I noticed. If stock of one of my items goes down to zero, then it shows the infinity symbol instead of zero on the “manage products” page. The plugin is interpreting zero and blank space in the inventory control as the same thing(infinity) on the “manage products” page. It would be nice if it could show the words “out of stock” instead of the infinity. This will help when managing large quantities of items.
The second thing I noticed is a little issue when making a purchase. I know the plugin was originally designed for digital products, but I have a slight inventory control problem when checking out. I will setup the hypothetical situation. My item has 2 in stock. Customer A puts 1 in his cart. Customer B puts 2 in his cart. Customer B makes the purchase before customer A and the stock goes down to zero. Customer A then submits the transaction and purchases the item which was already in his cart, but is no longer in stock. Can the cart be setup to make 1 final check on inventory in the eStore_payment_submission.php file before being submitted to paypal? I know this might be a rare situation for most, but it could pose a problem for a busy site. One last check in the cart submission could mean one less angry customer.
The third thing I noticed is a little issue when adding items to the cart. If there are 5 items in stock, but the customer tries to add 6, the cart will show an error saying that there are only 5 in stock but will only add 1 item.
Thank you.
December 16, 2010 at 2:48 am #27451amin007ParticipantFixed the out of stock issue. When it goes to 0 it will show 0 instead of infinity.
“Can the cart be setup to make 1 final check on inventory” – This won’t fully get rid of this problem anyway. You can still have the issue if customer A takes too long on the PayPal checkout page to do the actual checkout. Out of stock issues are easily solved by sending the customer an email that explains the situation (you can have a canned response for this). Remember, this will only happen in rare occasions but here is my opinion… when you do start to go out of stock due to the fact that a lot of customers are buying your product it is a good problem to have. At that moment you are actually making a lot of money and you can afford to hire a developer to add a lot of bells and whistles to your shopping cart.
The third one is intentional. Whenever the customer tries to add a quantity that is not available it adds one gives them a message telling them what happened. They can see how many quantities are left and decide if they want it.
December 16, 2010 at 2:56 am #27452marizs23MemberThanks for the quick response. When you fixed the out of stock issue, when does that plugin file become available?
edit: I found the answer at https://support.tipsandtricks-hq.com/automatic-update-request
December 16, 2010 at 8:45 am #27453marizs23MemberOkay, I made some code to check the quantities of the shopping cart before sending it to paypal. I realized that if somebody takes too long on paypal, their session will expire. But if somebody puts something into the shopping cart, it could sit there a very long time, giving it a better chance to run out of stock by the time they make up their mind and purchase. My problem isnt that I am selling too quickly, but just that I never have alot of my items in stock because they are handmade.
My code is a little rusty as I have not written any wordpress plugins or firefox extensions for a couple of years now. But here is a link to the modified page to catch the error. http://host4.network-device.net/share/eStore_payment_submission.txt Changes started at line 145. To test it out, just add some items to your cart. While the items are in the cart, go to manage products page and reduce the quantity to a number less than is in your cart. Hit paypal button.
December 16, 2010 at 3:54 pm #27454marizs23MemberI now added code so that when a customer tries to add 10 products, while there are only 7 in stock, 7 will be added instead of the default 1. I made the change on line 409 of wp_eStore1.php
//$_POST = 1; //Add one by default
global$wpdb;
$products_table_name = WP_ESTORE_PRODUCTS_TABLE_NAME;
$id = $_POST;
$retrieved_product = $wpdb->get_row("SELECT * FROM $products_table_name WHERE id = '$id'", OBJECT);
$_POST = $retrieved_product->available_copies;
This does not interfere with the customer being notified of the quantity limit.
December 17, 2010 at 3:04 am #27455amin007ParticipantWhat you have done looks good. Are you getting an error with the code?
December 20, 2010 at 6:54 am #27456marizs23MemberNo errors here. It seems to work fine, as I have tested it many times. Thanks.
-
AuthorPosts
- You must be logged in to reply to this topic.