• Resolved spakainas

    (@spakainas)


    Hello,
    I noticed critical bug with orders and variable products.
    The issue and how to produce it:
    1. I decide to edit variable product under “Product data” –> “Variations (tab). The variation ID is 42316
    2. I change size from Any Size to Size L
    3. In all</strong >orders, where a product variation ID is said to be 42316, the info changed to Size L from Size S, M, L or XL.

    Is this intended functionality? Before WooCommerce didn’t work that way, and Order info would always stay the same now matter how I would change product data. Now it seems to be connected.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi @spakainas,

    I suspect something has gotten off in the site’s database. Looking at the other thread where you mentioned the problem with order items and this one, that seems quite likely. This is definitely not the expected behavior.

    Has there been any importing of data or migrations on the site?

    Let us know and we’ll go from there.

    Thread Starter spakainas

    (@spakainas)

    Hello,
    First of all sorry for double thread as I thought the original question got deleted (it wasn’t shown in my WP activity).

    You are right, there was some importing that was done from old site to an updated one. But I wasn’t importing orders. Only products were imported to the new site.

    Before you also wrote:

    `Hi @spakainas,

    WooCommerce stores order items in two tables in the database, _woocommerce_order_itemmeta and _woocommerce_order_items. If these tables had old content that can sometimes cause the wrong information to appear in orders. I’ve seen that if old orders were incorrectly removed from a site. Also this happens when order imports aren’t handled correctly.

    I would suggest checking these tables in the database and see what they show. If you see gaps in the order_item_id numbers that could indicate a problem.

    Let us know what you find out.`

    I did what you suggested and checked order_item_id. Everything seems fine. I see only numbers.
    Here is a screenshot of _woocommerce_order_itemmeta: https://prnt.sc/24xz8v6
    Here is screenshot of _woocommerce_order_items: https://prnt.sc/24xzzyg

    Thank you for your help. I hope there will be a solution

    Update: the only solution i found how to avoid this. Reproduction:
    1. Go to edit a product with variations.
    2. Create new variation (instead of ALL sizes I select only specific size).
    3. Delete old variation with ANY sizes.

    That somehow works and Order info doesn’t get changed. I feel like somehow Variation ID is tied up with Order info.
    When I remove variation from the PRODUCT, Variation ID in ORDER info disappears. and nothing gets changed

    • This reply was modified 3 years, 2 months ago by spakainas.
    • This reply was modified 3 years, 2 months ago by spakainas.
    • This reply was modified 3 years, 2 months ago by spakainas.

    Hey @spakainas,

    I feel like somehow Variation ID is tied up with Order info.

    That is absolutely correct. Let’s take a look at how an order for a single variable product is stored in the database.

    The order items themselves are kept in the _woocommerce_order_items table. It looks like this.

    We can take the order_item_id number and look it up in the _woocommerce_order_itemmeta table and we’ll find this information about that order item.

    The attributes themselves are saved but so is the variation ID number.

    I haven’t been able to duplicate what you’ve run into with changing an “any” attribute to a specific one. If I place an order with a product using the “any” attributes and then later change those out for specific ones, the order stays the same in my dashboard. Here’s an example.

    When I change the shirt to grey and large, it remains the same on my order.

    If you found a way to prevent this problem on your site, I suggest sticking with that. This isn’t something that should happen. The specific attributes should be saved on an order. That way even if they change on the product, they show what the customer purchased at that time.

    Thread Starter spakainas

    (@spakainas)

    Thank you for your detailed answer.
    Well, I did found the workaround i mentioned before but it was like a backup option. It helps avoid the problem but makes the store management more complicated.
    I could duplicate a website for testing purposes as I have no clue how to solve it.

    One way to set up a duplicate site is with the WP Staging plugin. It’ll let you create a copy to try things on without disrupting your live site. Some web hosts also have ways to create staging sites too.

    Let me know if you have any questions.

    We’ve not heard back from you in a while, so I’m marking this thread as resolved. Hopefully, you were able to find a solution to your problem! If you have further questions, please feel free to open a new topic.

    Thread Starter spakainas

    (@spakainas)

    I kind of stopped working up on this project and trying to find the issue but will re-open this topic, when I have more free time

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Critical issue with orders’ is closed to new replies.