Backorders Purchase higher than stock - php

I have Prestashop 1.6. How do I manage this issue: Problem with backorders when a customer orders more items than are currently in stock ?.
Our store allows backorders. We have a problem where an item will show in stock, but if a customer orders more than the available quantity. he is not told until after the order has been placed and paid for.
I receive emails from customers who are upset because an item appears in stock when they add it to the cart, and when they view it in the cart. But immediately after payment is made, the order is placed in backorder
Example: we have 8 balls in stock customer places an order for 10 balls.
My idea is to display a message shipment in 4 days. But I donĀ“t know how to do it.
I will appreciate your Help to find the solution
Regards

Not sure where you want to display that message but i might have a solution for you.
Go to prestashop\themes\yourTheme\templates\checkout_partials
open cart-detailed-product-line.tpl,
at the very bottom add:
{if {$product.stock_quantity} < {$product.cart_quantity}{l s='Warning: Quantity of product in your cart is out-of-stock and will take longer to be delivered.'}{/if}
If customer orders more than avaliable quantity they will see message like this in their cart right under the product:
How it works
Hopefully that helps!

Related

WooCommerce Recalculate Order, Taxes - Delete & Add Order_item + discount

I would like to briefly give you some information about our problem here: We need to correct all our Woocommerce orders from 2021 and now we are facing a big challenge. Since we have changed the tax class on the products, we can't just have the order recalculated but need to re-add the entire order line item to the order and remove the old line item.
We have now found a workaround that works:
Edit corresponding purchase order
Set purchase order from "completed" to "on hold
Update/Save
Now the order can be edited:
Check which coupon has been redeemed
Remember the product ID of the order
Delete product completely
Add new product via product ID
If voucher was used Add voucher code
Update/Save
This is exactly the process we use to correct our orders as needed. From this we have programmed a bot that goes through this process in wp-admin. Unfortunately, with tens of thousands of orders, this takes months....
Now I have come across Hooks and Functions and believe there is a simpler solution here.
For example I found this thread: How Can I remove a particular product from an completed order in woocommerce?
foreach ($order->get_items() as $item_id => $item) {
if ($item_id == 3) {
wc_delete_order_item($item_id);
}
}
Here it is explained how to remove an order-item from the order.
We would need a Function that:
Opens an order
Saves the order_item_id to itself
Deletes the order_item
adds the order_item again
checks if there was a coupon
if yes: delete old voucher & add new voucher
Does anyone have any ideas or can help us with this?
Thanks a lot!

Quantities not updating after refund on woocommerce

I have followed the instructions to refund products as per this link: https://docs.woocommerce.com/document/woocommerce-refunds/
On the email sent back to the customer, the order value has been updated and takes into consideration the refund, but the order quantity does not. The quantity stays the same.
How can I make sure I am pulling the correct order quantity? When My customers come to collect their goods their receipt still shows they are to receive the original quantity?
I know order quantities are stored in the table "woocommerce_order_item_meta" with a separate "order_item_id" for ordered quantity and refunded quantity, the latter signalled by an additional line: "_refunded_item_id". Do I need some code to sum the "_qty"'s?
I would like my customer emails and order reports to show the correct quantity, so happy to make just make changes to order-items.php and create a function to input into my report plugin (wp All export)
Actually, Woocommerce has no any default functionality to restore stock for cancelled and refunded orders.
There is one of the plugin to solve this solution. Woocommerce Auto Restore Stock is the plugin that will help you to achieve this.
It will automatically restore your WooCommerce inventory/stock for orders that were placed and refunded or canceled.
Hope this will work for you. Thanks.

Magento products sold at price zero and only shipping was charged

I am working on E-Commmerece site which is based on Magento Enterprise Edition 1.11.2.0. I have found a problem recently where one of our customers purchased 3 different types of products with respective quantities 8,8,6.
In which only shipping was charged and products prices become zero. The actual product price was $8.99.
I have checked no promotion rule was applied on this order.
when I saw the order from admin side only products sku's were visible and name's of products were not displaying and product prices were zero.
Customer used paypal express checkout for payment and his payer status is unverified. Rest of orders being placed near this order are perfect.
Can any one tell me what had gone wrong in this order?

How to display promotion price when qty is 0 in magento

I am building an online shop where I want to display on the category page and also on the product page the special price also when the qty is 0 and stock is manageable. The idea is to say that the product can be on demand in 24-48 hours and it has a discount but the product is not in actual stock of the client but it can arrive to the customer in 24-48 hours.
How can I make this in Magento because when I look now is taking only the original price and not the promotional price when qty is 0.
in magento version 1.9.1.0 it displays product with special price if it is out of stock so no need to change in code in magento. if not display there then use
echo $_product->getFinalPrice();
for display promotional price.
From what it appears you simply want to discount active in stock products and stop doing so when they're out of stock and then notify the customers that they have a lead time of 24-48 hours if so.
There's a Magento inventory option to do just that:
admin/system_config/edit/section/cataloginventory
Then you need to add a promo that discounts products that are quantity > 0
The promo would reduce necessary products to the 'regular price' but not if their inventory is 0.
admin/promo_quote/new
By default Magento does not give you those promotions so you'd have to use a third party module for such detection/discount such as Amasty which has some of the most robust, stable, compatibly modules in the business:
https://amasty.com/

Getting product weight info in virtuemart inside order details/order history page

I have the following problem in virtuemart:
I have made a function to calculate shipping cost based on a five stage cost given by the shipping company. This works perfectly on the cart page, but on the order details and order history page it does not, as I cannot get the product weight in these pages.
I have looked into order_items.php where the order details references are kept, but there is no reference to the product weight, only to product id, quantity, category, etc.
Could anyone help me in how to get the product weight inside the order details page? I can do the rest in calculating the shipping rates and updating the final sales price, but I am stuck in getting this info.
Any help is welcomed :)
Try this,
I think you missed something about order tables, hope you are using VM2.x
In this version once the order is processed its payment,shipment information gets saved on the #__orders table.
In additionally the payment method Id and Shipment method Id also gets saved. So you can identify the method used on the order.
The idea of calculating ordered products shipping cost later on admin side is not practical bcoz later the shipping cost may very.
So practically once the user placed an order that time you have to save these information on the above table. If you're using VM default Shipping plugins they will do this by default.
Hope its clear.

Categories