Purge open carts in Ubercart - drupal

How do you clear out open carts (non completed checkouts) in Ubercart? I don't see a function or admin setting to do this unless I looked in the wrong place.
Example, I just want to clear out carts who have gone around and added things to their cart, but did not complete the order.

uc_cart_empty() will clean the cart according to cart ID.
uc_cart_get_id() will give you the current cart ID.
What you want is to go over all uncompleted carts.
For registered users the cart ID is always the uid of the user.
For anonymous users, if I am not mistaken, the cart has a short lifetime, so no need to do it "manually".
Hope this helps, and in any way, this should be your starting points.
Regards,
Shushu

Related

How to add a subscription product to woocommerce orders after purchase

so I am trying to add an additional product to a customers cart just before he checks out. In the real sense, I am trying to make sure that all my customers are subscribed to the woocommerce membership as soon as they hit the proceed button on the checkout. I have tried creating a subscription product and tied t a membership and attached the the subscription product to the cart via coupon but this does not work.
Anyone has any ideas? Please help.
I have tried creating a subscription product and tied t a membership and attached the the subscription product to the cart via coupon but this does not work.
Anyone has any ideas? Please help.

How can I ensure that only one instance of any product in woocommerce is sold?

I've been looking for an answer to this. Client has a woocommerce shop that will only ever have one of each product. What I need to accomplish is that when a product is added to their cart, the item is unavailable for anyone else to add the same product to a cart. I've tried the old plugin but it breaks portions of the front end, I've tried using several similar solutions I've found here, but nothing seems to do the trick. The plugin also made inventory management on the backend a total nightmare.
So, to walk you through, user A adds product A to cart. User B tries to add this product to cart but woocommerce says its sold out currently to user B. User A can checkout with product A or if user A closes the browser, woocommerce waits one minute and then puts product A back in stock so person B can then add product A to their cart.
I've been searching for this and have come up with nothing from here and some company claiming they can but it's done case by case and they want to handcode it aka very expensive to do.
Please, help!
Just an opinion here so maybe I am wrong, but woo commerce uses stock counts in the backend, so if this is set to 1, then there can only ever be one that can go through the checkout process unless cancelled.
The functionality to reduce that stock count to 0 whilst a user has that item in their basket (or just viewing the checkout page) is not feasible as they have not purchased, at that stage it is just showing intent to purchase.
As you mentioned, that functionality is possible, it wouldn't be pretty, but possible and not something that is available by default in the plugin. Development of such functionality would be needed, and you're right probably quite expensive for development time.

Generate Email Coupon Wordpress

This might be off topic question but I would like to ask it anyway to the developers out there.
Is there a plugin or whatever, that can enable automatic single use coupon code delivery to a user on wordpress/page?
Basically WordPress will send an email to the customer and then the user takes an action (clicks button, clicks link from email), and can see a unique, single use, coupon code back to the wordpress site? Each user of course would see a unique coupon code because there would need to have been a list of unique coupon codes selected/uploaded to begin with.
Thanks for your kind answers if there is any. Please.
I am not sure if this is what you are looking for:
YITH WOOCOMMERCE COUPON EMAIL SYSTEM

How to remove a product from WooCoomerce

On our site we are using WooCommerce and the Subscription extension and this is working fine. However, we have recently decided that we are going to remove our subscription service. But what I am concerned about is how to properly remove the subscription setup.
I have manually gone thru and cancelled any active subscriptions so they will no longer be billed. And on a future date (to make sure people have access till the end of their current billing cycle) we plan to completely remove subscriptions.
Would removing the subscriptions extension plugin cause problems? What would be the best method of removing the subscription products (currently I have set the subscription item to out of stock and also set it to private so no more orders can be placed). If I delete the subscription product completely would that affect the sales reports (I am guessing it would as the product would no longer exists).
Also how would deleting a product affect orders where that product was purchased? Would the order just simply show no items (but keep the totals)?
Thanks in advance!
I would delete every subscription product, just go to your woocommerce products and filter by the category you set your subscriptions too and delete them all.
Then on the day which your last sub expires remove the plugin in the normal method.
If you have them as out of stock and private/hidden, that should be good enough until all the subs are finished. I wouldn't remove them as products until at least the last orders are created. If you do, they may not generate.

disable/increace woocommerce cart timeout

I’m using WooCommerce for selling goods. Sometimes I use profiles of my customers to add specific products in their carts (I do it for them basically). When they ask me to help them and give them some nice suggestions.
When I’m ready with the suggested products, the customers are able to login again for some final adjustments and for purchasing of course :).
Sometimes I have a bad feedback, because their cart were empty and my suggestions are lost.
Is there a timeout for the woocommerce cart? If yes, how can I tweak it?
Or is this a server restriction?
Thanks!
Slavi

Resources