• Resolved JapeNZ

    (@japenz)


    Hi there,
    If I manually add a product to an existing ‘on hold’ order, the total_sales amount for that product doesn’t seem to change.

    I have hundreds of pre-order products that are deleted each month as they become unavailable if they have no sales.
    Unfortunately it seems that products I manaully add to an existing order (at the request of a customer) aren’t having their total_sales number updated, leading to the product potentially being deleted at the end of the month.

    To replicate the issue please create an on hold order with some products in it and save the order.
    Add a product that has no previous sales to the on hold order and save.
    Go to the product page and check the products ‘total_sales’ amount in the Custom fields section.

    Thanks for your help!

Viewing 12 replies - 1 through 12 (of 12 total)
  • Stef

    (@serafinnyc)

    @japenz You cannot add products after the fact. This is not a default function of WooCommerce. The card has already been charged and will not be charged again. You’d have to create a separate invoice.

    Thread Starter JapeNZ

    (@japenz)

    Hi @serafinnyc
    This specifically applies to orders that are on hold, so no payment has been received.
    Orders placed using bacs for example, which is a default function / payment option are ‘on hold’ rather than processing or complete, and can be altered.

    • This reply was modified 1 month, 3 weeks ago by JapeNZ.
    • This reply was modified 1 month, 3 weeks ago by JapeNZ.
    • This reply was modified 1 month, 3 weeks ago by JapeNZ.
    Plugin Support Zubair Zahid (woo-hc)

    (@doublezed2)

    Hello JapeNZ,

    Thank you for contacting WooCommerce support.

    To clarify, when you manually add products to an “On Hold” order, does the stock for those products get reduced? What are the next steps after you manually add the product?

    Understanding the complete cycle of the order completion will give me a better understanding.
    Looking forward to your response. ??

    Best regards.

    Thread Starter JapeNZ

    (@japenz)

    Hi @doublezed2,

    Thank you for taking a look at this for me ??

    Yes stock amounts are changed if the products have a set amount of stock.

    My problem is that the pre-order items I sell don’t have a limited stock amount, so stock levels being updated doesn’t help me sort them at the end of the month.

    I have a snippet that removes a pre-order product from stock once a certain date is reached.
    I can then search products in the pre-order category that are out of stock in the admin products page and order them by a total_sales column I’ve added.

    Any that have ‘0’ total sales can safely be deleted without effecting any customer orders… or so I thought haha!

    I’ve recently noticed that while the total_sales number is updated when customers place orders for pre-order products in the frontend.
    If a customer has an existing on hold order and asks me to add other pre-order products to it (so they can combine the shipping), manually adding the products doesn’t increase the total_sales amount for that product… and so at the end of the month the product could be deleted.

    Thanks for your help with this!

    Plugin Support Zubair Zahid (woo-hc)

    (@doublezed2)

    Hello JapeNZ,

    Thank you for your reply.

    It sounds like the custom snippet you’re using might be affecting how total sales are updated when adding pre-order products manually to an existing order.

    Could you try temporarily removing the custom code and check if the total_sales updates correctly when you manually add products to the order? This will help us determine if the issue is related to the snippet or something else.

    Looking forward to your response. ??

    Thread Starter JapeNZ

    (@japenz)

    Hi @doublezed2,

    Thanks for looking at this for me.

    Have you been able to replicate the issue?

    To replicate the issue please create an on hold order with some products in it and save the order.
    Add a product that has no previous sales to the on hold order and save.
    Go to the product page and check the products ‘total_sales’ amount in the Custom fields section.

    If you’re not able to replicate the issue then it must be something on my end.

    Please let me know if you’re able to replicate the issue, if you’re not seeing the same thing I can troubleshoot on the assumption it’s an issue with my setup rather than Woo ??

    Thanks again!

    Thread Starter JapeNZ

    (@japenz)

    Hi @doublezed2,

    Just tested on a staging site using the Twenty Twenty-Four theme, with only Woocomerce active and am seeing the same thing.

    Plugin Support Beauty of Code (woo-hc)

    (@beautyofcode)

    Hey @japenz ,

    Thanks for the update! If I understand correctly, you’re adding the total_sales meta in in the custom fields on the Product edit page, yes?

    If you manually add a product, and then update the order status to something other than “On Hold”, does the total_sales update on your end?

    Also, when adding an exisiting product with previous sales, do these add to the total_sales correctly when manually adding the product to the order?

    Cheers,

    Thread Starter JapeNZ

    (@japenz)

    Hi @beautyofcode,

    Thanks for taking a look at this for me ??

    I believe the total_sales meta is default meta data added by Woocommerce.
    I’m using that meta data in a custom sortable column in the admin products page to be able to sort products by their total_sales amount.

    “If you manually add a product, and then update the order status to something other than “On Hold”, does the?total_sales?update on your end?”
    No, changing the order status doesn’t alter the total_sales meta.

    “Also, when adding an exisiting product with previous sales, do these add to the?total_sales?correctly when manually adding the product to the order?”
    No, adding an exisiting product with previous sales doesn’t add to the total_sales meta correctly.
    Neither does manually altering order amount of a product that was purchased in the initial order… so for example if a customer placed an on hold order for ‘1 x Item a’ on the front end, ‘Item a’ would have a total_sales of ‘1’.
    If I then manually increase the order amount to 3 in the backend, the total_sales meta stays at ‘1’ when the order is updated.

    Are you able to duplicate the issue?

    Thanks for your help!

    Plugin Support Zubair Zahid (woo-hc)

    (@doublezed2)

    Hello JapeNZ,

    Thank you for your reply.

    I tested this on my local site by manually creating an order with the status set to “on hold.”
    The “total_sales” of the product in the order increased by 1 as expected.
    This suggests the issue you’re facing might be specific to your site’s setup.

    Could you please share your System Status Report?
    That will help me further investigate and pinpoint any potential conflicts or configurations affecting the total_sales meta on your site.

    Looking forward to your response. ??

    Thread Starter JapeNZ

    (@japenz)

    Hi @doublezed2,

    Thanks for testing this ??

    With the order created, can you now manually add a different product or increase the amount of the product already in the order and see if the “total_sales” number updates when you update the order please?

    It’s not creating the order that’s the problem, but manually changing an order that has already been created.

    Thanks again for your help!

    Plugin Support EastOfWest a11n

    (@eastofwest)

    Hi @japenz – thanks for your patience and extra details. It was possible to recreate this issue and was submitted to the developer team in this bug report on GitHub.

    You can click on that link and subscribe to the issue to follow its progress, and add any additional details that would be helpful in fixing it.

    I know the above isn’t an immediate solution to your existing challenge though. While looking into similar issues, this one came up – it has custom code that might be useful to you in the interim, especially if you’re comfortable with tweaking and implementing custom code.

Viewing 12 replies - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.