Forum Replies Created

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter Oxford Metadata Ltd

    (@oxfordmetadata)

    No, you got it wrong in there.

    We run dozens of sites, and it will be humanly foolish, to start creating dozens of custom code folders to host the code to override your error due to the update of the template.

    We rather see this check be in the next update of Woo.

    Thank you!

    Thread Starter Oxford Metadata Ltd

    (@oxfordmetadata)

    Also Modify the lines where $orderedby is used to include an isset check:

    <p class="woocommerce-result-count" <?php echo ( ! isset( $orderedby ) || empty( $orderedby ) || 1 === intval( $total ) ) ? '' : 'role="alert" aria-relevant="all" data-is-sorted-by="true"'; ?>>

    And

    $orderedby_placeholder = ( ! isset( $orderedby ) || empty( $orderedby ) ) ? '%2$s' : '<span class="screen-reader-text">%2$s</span>';


    If you’re loading this template using wc_get_template or a similar function, make sure to pass $orderedby as part of the data array.


    $orderedby = ''; // Set this based on your sorting logic.

    wc_get_template( 'loop/result-count.php', array(
    'total' => $total,
    'per_page' => $per_page,
    'current' => $current,
    'orderedby' => $orderedby,
    ) );

    (Thanks to chatgpt o1-preview).

    Thread Starter Oxford Metadata Ltd

    (@oxfordmetadata)

    Just add that this warning has been observed in php 8.3 installations. We cannot confirm if it appears in other releases as well.

    Thread Starter Oxford Metadata Ltd

    (@oxfordmetadata)

    In order to facilitate the discussion:

    I understand that the “flattening” of the information required for the product_attributes_lookup table can be compute demanding.

    In the example site I shared with you, there is this table: Femme Fatale Fast Finder – Femme Fatale (femme-fatale.gr)

    To prepare this table with conventional SQL required about 20 joins and it was taking 15 minutes of full compute time every night for an SQL server that had 64GB allocated for the example of the said shop (with the almost 400 attributes, and 7000 items among them) and it also computes stock availability, their image, the brand and product categories as you can imagine.

    I am sure when using conventional php, the compute requirement is not much different thus, while as the “good coding” patterns and practices suggest, a REST API based async method is utilised etc. (thus the 2 hours of painful waiting)

    Here however is refactored the same code that does the compute not in 15 minutes of full compute but in less than 10 seconds (for all nearly 9000 products) together with complementary info such as product images, generation of add to cart buttons, the info if the product is on sale and/or has professional discounts.

    Generate Simple Products
    Start time: 2024-03-03 16:25:35.071
    End time: 2024-03-03 16:25:35.565
     
    Generate Variations Vitals
    Start time: 2024-03-03 16:25:35.566
    End time: 2024-03-03 16:25:35.914
     
    Append Variations in Product Vitals
    Start time: 2024-03-03 16:25:35.915
    End time: 2024-03-03 16:25:42.145
    
    Total Execution Time: 7.078 seconds

    If one needs also a three level category menu for the products and the brands of the products then this process adds 12 more seconds.

    Generate Brands and Categories
    Start time: 2024-03-03 13:28:28.284
    End time: 2024-03-03 13:28:40.614
     
    Generate Simple Products
    Start time: 2024-03-03 13:28:40.615
    End time: 2024-03-03 13:28:41.096
     
    Generate Variations Vitals
    Start time: 2024-03-03 13:28:41.097
    End time: 2024-03-03 13:28:41.431
     
    Append Variations in Product Vitals
    Start time: 2024-03-03 13:28:41.432
    End time: 2024-03-03 13:28:47.837
    
    Total Execution Time: 19.557 seconds



    They key here is to use different queries for simple products and variations.

    Here is the code:

    Part 1. Generate category hierarchies and brands (the 12 second process)

    truncate table wp_pods_product_brands;
    INSERT INTO wp_pods_product_brands (name, product_id, parent_product_id, effective_product_id, brand_name, product_stock, product_count)
    SELECT t.name AS name, 
    case when p.id is null then 
    tr.object_id
    else
    p.id 
    end
    as product_id, 
    tr.object_id AS parent_product_id, 
    tr.object_id AS effective_product_id, 
    t.slug as brand_name,
    '0'as product_stock,
    '0' as product_count   
    
    FROM wp_term_relationships AS tr  
    INNER JOIN wp_term_taxonomy AS x 
                 ON (x.taxonomy='pa_brand_master' 
                AND x.term_taxonomy_id=tr.term_taxonomy_id)
    INNER JOIN wp_terms AS t 
                 ON t.term_id=x.term_id 
    JOIN wp_posts p on
    (tr.object_id=p.post_parent or tr.object_id=p.id) and p.post_type like '%product%' and p.post_status='publish'
                 order by product_id, name desc
    LIMIT 5000000;  
    
    TRUNCATE TABLE wp_pods_parent_product_cat_hierarchy;
    
    INSERT INTO wp_pods_parent_product_cat_hierarchy 
        (name, product_id, top_category_id, top_category, second_level_category_id, second_level_category, third_level_category_id, third_level_category)
    SELECT
        p.ID AS name,
        p.ID AS product_id,
        tc.top_category_id,
        tc.top_category,
        sc.second_level_category_id,
        sc.second_level_category,
        thc.third_level_category_id,
        thc.third_level_category
    FROM 
        wp_posts p
    JOIN (
        SELECT
            tr.object_id AS product_id,
            MIN(tt.term_id) AS top_category_id,
            MIN(t.name) AS top_category
        FROM
            wp_term_relationships tr
        JOIN wp_term_taxonomy tt ON tr.term_taxonomy_id = tt.term_taxonomy_id
        JOIN wp_terms t ON tt.term_id = t.term_id
        WHERE tt.taxonomy = 'product_cat' AND tt.parent = 0
        GROUP BY tr.object_id
    ) AS tc ON p.ID = tc.product_id
    LEFT JOIN (
        SELECT
            tr.object_id AS product_id,
            MIN(tt.term_id) AS second_level_category_id,
            MIN(t.name) AS second_level_category
        FROM
            wp_term_relationships tr
        JOIN wp_term_taxonomy tt ON tr.term_taxonomy_id = tt.term_taxonomy_id
        JOIN wp_terms t ON tt.term_id = t.term_id
        WHERE tt.taxonomy = 'product_cat' AND tt.parent IN (SELECT term_id FROM wp_term_taxonomy WHERE parent = 0)
        GROUP BY tr.object_id
    ) AS sc ON p.ID = sc.product_id
    LEFT JOIN (
        SELECT
            tr.object_id AS product_id,
            MIN(tt.term_id) AS third_level_category_id,
            MIN(t.name) AS third_level_category
        FROM
            wp_term_relationships tr
        JOIN wp_term_taxonomy tt ON tr.term_taxonomy_id = tt.term_taxonomy_id
        JOIN wp_terms t ON tt.term_id = t.term_id
        WHERE tt.taxonomy = 'product_cat' AND tt.parent IN (SELECT term_id FROM wp_term_taxonomy WHERE parent IN (SELECT term_id FROM wp_term_taxonomy WHERE parent = 0))
        GROUP BY tr.object_id
    ) AS thc ON p.ID = thc.product_id
    WHERE p.post_type IN ('product', 'product_variation') AND p.post_status = 'publish'
    GROUP BY p.ID
    ORDER BY p.ID;
    

    Part 2. Compute first the simple products and then the Variations IN DIFFERENT TABLES WITH DIFFERENT QUERIES

    
    TRUNCATE TABLE wp_pods_product_vitals;
    
    
    INSERT INTO  wp_pods_product_vitals  (   
        image_url,
        name,
        product_id,
        parent_id,
        parent_name,
        parent_sku, 
        category_id,
        brand,
        menu_id,
        menu_category,
        head_id,
        head_category,
        subcat_id,
        sub_category,
        sku, 
        gtin,
        soft1_id,
        profdiscount,
        price,
        product_url,
        link_to_view,
        link_to_cart,
        link_to_fav,
        short_description,
        weight,
        color,
        stock
        )
    SELECT distinct 
    concat('https://femme-fatale.gr/wp-content/uploads/',pm2.meta_value) 
    AS image_url,
    p.post_title as name, 
    p.ID as product_id,
    
    p.id
    AS parent_id, 
    
    p.post_title
    AS parent_name,
    
    pm4.meta_value 
    AS parent_sku,
    
    tapc.top_category_id as category_id, 
    
    tat.name 
    AS brand, 
    
    tapc.top_category_id
    as menu_id,
       
    tapc.top_category
    as menu_category,
    
    tapc.second_level_category_id
    as head_id,
    
    tapc.second_level_category
    as head_category,
    
    tapc.third_level_category_id
    as subcat_id,
    
    tapc.third_level_category
    as sub_category,
     
    pm4.meta_value as sku, 
    
    
    pm0.meta_value
    AS gtin, 
    
    pm9.meta_value as soft1_id, 
        
    CASE  WHEN pm6.meta_value IS NOT NULL THEN 'NAI'
            ELSE 'OXI'
    END  AS ProfDiscount,
        
    CAST(REPLACE(pm3.meta_value, ',', '.') AS DECIMAL(12,2)) as price, 
    concat ("https://femme-fatale.gr/?p=", p.id)  AS product_url,
    Concat('<a href=https://femme-fatale.gr/?p=', p.id , '>', ("Αναλυτικ? περιγραφ?"  COLLATE utf8mb3_bin) ,'</a>') as link_to_view,
    
    case when pm5.meta_value>0 THEN
    Concat('<div class="loop-button-wrap button-layout2"><a href="?add-to-cart=', p.id , '" data-quantity="1" class="button product_type_simple add_to_cart_button ajax_add_to_cart" data-product_id="', p.id, ' data-product_sku="', pm4.meta_value , '" rel="nofollow">', ("Αγορ?"  COLLATE utf8mb3_bin)  , '</a></div>')
    else ''
    END
    
    as link_to_cart, 
    '''' as link_to_fav,
    LEFT(p.post_excerpt, 160)
    AS short_description,
    pm10.meta_value 
    AS weight, 
    '' AS color, 
    pm5.meta_value 
    AS stock
    FROM 
    wp_posts as p
    
    LEFT JOIN wp_pods_parent_product_cat_hierarchy as tapc on p.ID = tapc.product_id
    LEFT JOIN wp_postmeta AS pm0 ON p.id = pm0.post_id AND pm0.meta_key = 'hwp_product_gtin'
    LEFT JOIN wp_postmeta AS pm1 ON p.id = pm1.post_id AND pm1.meta_key = '_thumbnail_id'
    LEFT JOIN wp_postmeta AS pm2 ON pm1.meta_value = pm2.post_id AND pm2.meta_key = '_wp_attached_file'
    LEFT JOIN wp_postmeta AS pm3 ON p.id = pm3.post_id AND pm3.meta_key = '_price'
    LEFT JOIN wp_postmeta AS pm4 ON p.id = pm4.post_id AND pm4.meta_key = '_sku'
    LEFT JOIN wp_postmeta AS pm5 ON p.id = pm5.post_id AND pm5.meta_key = '_stock'
    LEFT JOIN wp_postmeta AS pm6 ON p.id = pm6.post_id AND pm6.meta_key = 'woocommerce_ultimate_pricing_prices' AND pm6.meta_value LIKE '%customer_%'
    LEFT JOIN wp_postmeta AS pm9 ON p.id = pm9.post_id AND pm9.meta_key = 'soft1_id'
    LEFT JOIN wp_postmeta AS pm10 ON p.id= pm10.post_id AND pm10.meta_key = '_weight'
    LEFT JOIN wp_pods_product_brands as tat on  p.id = tat.product_id
    
    WHERE p.post_type IN ('product')
    AND p.post_status = 'publish'-- statement to ensure uniqueness of product ids
    group by p.ID
    ORDER BY  p.id, tapc.top_category;
    
    
    
    TRUNCATE TABLE wp_pods_variation_vitals;
    
    INSERT INTO wp_pods_variation_vitals (product_id, parent_id, sku, gtin, price, stock, special_price, weight, imagepath, soft1_id)
    SELECT DISTINCT
        p.ID AS product_id,
        p.post_parent AS parent_id,
        pm.meta_value AS sku,
        pm2.meta_value AS gtin,
        pm3.meta_value AS price,
        pm4.meta_value AS stock,
    
        CASE 
            WHEN pm6.meta_value IS NOT NULL THEN 'NAI'
            ELSE 'OXI'
        END AS special_price,
        pm5.meta_value AS weight,
        pm8.meta_value AS imagepath,
        pm9.meta_value AS soft1_id 
    FROM 
        wp_posts AS p
    LEFT JOIN wp_postmeta AS pm ON p.id = pm.post_id AND pm.meta_key = '_sku'
    LEFT JOIN wp_postmeta AS pm2 ON p.id = pm2.post_id AND pm2.meta_key = 'hwp_var_gtin'
    LEFT JOIN wp_postmeta AS pm3 ON p.id = pm3.post_id AND pm3.meta_key = '_price'
    LEFT JOIN wp_postmeta AS pm4 ON p.id = pm4.post_id AND pm4.meta_key = '_stock'
    LEFT JOIN wp_postmeta AS pm5 ON p.post_parent = pm5.post_id AND pm5.meta_key = '_weight'
    LEFT JOIN wp_postmeta AS pm6 ON p.id = pm6.post_id AND pm6.meta_key = 'woocommerce_ultimate_pricing_prices' AND pm6.meta_value LIKE '%customer_%'
    LEFT JOIN wp_postmeta AS pm7 ON p.ID = pm7.post_id AND pm7.meta_key = 'botiga_variation_gallery'
    LEFT JOIN wp_postmeta AS pm8 ON substring_index(substring_index(pm7.meta_value, ':"', -1), '";', 1) = pm8.post_id AND pm8.meta_key = '_wp_attached_file'
    LEFT JOIN wp_postmeta AS pm9 ON p.id = pm9.post_id AND pm9.meta_key = 'iconic_cffv_100545_soft1_id'
    WHERE (p.post_type = 'product_variation' AND p.post_status = 'publish');

    3. Insert the variations you just computed in a different table in the… final destination table.

    INSERT INTO  wp_pods_product_vitals  (   
        image_url,
        name,
        product_id,
        parent_id,
        parent_name,
        parent_sku, 
        category_id,
        brand,
        menu_id,
        menu_category,
        head_id,
        head_category,
        subcat_id,
        sub_category,
        sku, 
        gtin,
        soft1_id,
        profdiscount,
        price,
        product_url,
        link_to_view,
        link_to_cart,
        link_to_fav,
        short_description,
        weight,
        color,
        stock
        )
    SELECT distinct 
    
    concat('https://femme-fatale.gr/wp-content/uploads/',vv.imagepath) AS image_url,
    p.post_title as name, 
    p.ID as product_id,
    
    vv.parent_id AS parent_id, 
    
    pmmpp.post_title as parent_name,
    
    pmmpps.meta_value as parent_sku,
    
    tapcv.top_category_id  as category_id, 
    
    -- tr.object_id as product_id, 
    tatv.name  as  brand, 
    
    tapcv.top_category_id as menu_id,
    
    tapcv.top_category as menu_category,
    
    tapcv.second_level_category_id 
    as head_id,
    
    tapcv.second_level_category 
    as head_category,
    
    tapcv.third_level_category_id
    as subcat_id,
    
    tapcv.third_level_category
    as sub_category,
     
    vv.sku as sku, 
    vv.gtin 
    AS gtin, 
    
    vv.soft1_id as soft1_id, 
    
    vv.special_price AS ProfDiscount,
        
    CAST(REPLACE(vv.price, ',', '.') AS DECIMAL(12,2)) as price, 
    
    concat ("https://femme-fatale.gr/?p=",  p.post_parent)
     AS product_url,
    
    Concat('<a href=https://femme-fatale.gr/?p=', p.id , '>', ("Αναλυτικ? περιγραφ?"  COLLATE utf8mb3_bin) ,'</a>') as link_to_view,
    
    case when p.post_parent<>0 and vv.stock >0 THEN 
    Concat('<div class="loop-button-wrap button-layout2"><a href="?add-to-cart=', p.id , '" data-quantity="1" class="button product_type_simple add_to_cart_button ajax_add_to_cart" data-product_id="', p.id, ' data-product_sku="', vv.sku , '" rel="nofollow">', ("Αγορ?"  COLLATE utf8mb3_bin)  , '</a></div>') 
    else ''
    END
    
    as link_to_cart, 
    '''' as link_to_fav,
    
    LEFT(pmmpp.post_excerpt, 160)
    AS short_description,
    
    vv.weight 
    AS weight, 
    
    trim(replace (replace(p.post_title, pmmpp.post_title, ''), '- ', '')     ) 
    AS color, 
    
    vv.stock
    AS stock
    
    FROM 
        wp_posts AS p
    LEFT JOIN wp_posts pmmp on pmmp.ID=p.id
    LEFT JOIN wp_posts pmmpp on pmmpp.ID=pmmp.post_parent
    left join wp_postmeta AS  pmmpps on pmmpp.ID=pmmpps.post_id and pmmpps.meta_key='_sku'
    LEFT JOIN wp_pods_variation_vitals AS vv ON p.id = vv.product_id
    LEFT JOIN wp_pods_product_brands as tatv on  p.post_parent = tatv.parent_product_id
    LEFT JOIN wp_pods_parent_product_cat_hierarchy as tapcv on  p.post_parent = tapcv.product_id
    
    
    
    
    
    WHERE p.post_type IN ('product_variation')
    AND p.post_status = 'publish'
    -- statement to ensure uniqueness of product ids
    group by p.ID
    ORDER BY  p.id, tapcv.top_category;


    And.. as if by magic something that used to take 1200 seconds (and tremendous RAM for the mySQL) is now done 1000 times faster and can be even supported in hosting environments with 2-4GB of RAM.

    I know this obsession of “good programming” with “patterns and practices”, but waiting 2 hours of bloody waiting to generate the products attributes lookup table, while also having the dynamic update failing, is definitely not good programming! In any event this is the type of functional decomposition that you have to implement in your favourite patterns and practices, if we are to see some progress.

    But our current 2 hour wait it totally unacceptable.

    If the Automatic team will require further consulting our company (Oxford Metadata) we will be happy to oblige. If anything else we can make up our losses for the 100s of hours of debugging – notwithstanding for the loses of the poor shop owner who, for many months, his most valuable products where disappearing from view to the guests.

    This concludes my contribution to this issue for the time being. You may contact via our profile here.

    Thread Starter Oxford Metadata Ltd

    (@oxfordmetadata)

    We have some news for you @ckadenge and @shameemreza – you may find this topic both interesting and extremely relevant.

    https://www.ads-software.com/support/topic/issue-with-dynamic-update-of-wp_wc_product_attributes_lookup

    It will be great if that issue gets sorted too, because it has to do with the core of woocommerce. In our case, we invested months (together with the team at Fibosearch/Fibofilters) to make the fibofilters more robust, to just realised that:
    1. The rules are open to misinterpretation.
    2. Thanks to the efforts of the fibosearch/fibofilters team @damian-gora we realised that wp_wc_product_attributes_lookup is getting corrupted during dynamic repopulation in shops that have 1000s of attributes (in products that have 100s of attributes).

    Hi @afzalpansuvi – you may find this topic both interesting and extremely relevant.

    Issue with dynamic update of wp_wc_product_attributes_lookup | www.ads-software.com

    It will be great if that issue gets sorted too, because it has to do with the core of woocommerce. In our case, we invested months (together with the team at Fibosearch/Fibofilters) to make the fibofilters more robust, to just realise that
    1. The rules are open to misinterpretation.
    2. The wp_wc_product_attributes_lookup is getting corrupted during dynamic repopulation in shops that have 1000s of attributes (in products that have 100s of attributes).

    Thread Starter Oxford Metadata Ltd

    (@oxfordmetadata)

    Thank you. Somehow I am unable to do a feature request. I tried it, I can login, I can upvote and comment but when it comes to posting a new feature request it keeps telling me to log on.

    Please do it on my behalf and I will second it.

    Btw. here is the latest performance of that product with those 268 variations is down to 0.8s ??

    Latest Performance Report for: https://femme-fatale.gr/product/nychia/imimonima-vernikia/xromata/aloha-imimonimo-verniki-eight-colo&#8230; | GTmetrix

    Also note that this topic… has been taking over by the Fibofilters team here: Hide out of stock items from the catalog – the case where it doesn’t work | www.ads-software.com

    Thread Starter Oxford Metadata Ltd

    (@oxfordmetadata)

    Thank you very much @shameemreza for your reply.

    It looks like the development of this feature is in the right hands ??

    When I find the time I will write a feature request, but, sadly, it is common for features coming out of the blue to be have an unfortunate fate. I cannot re-tell the story, re-explain etc. You are the owner of this feature, you now know the story, and please take it further with your team; they know you better and trust you a lot more than me.

    I will just add two anecdotes.

    1. The other day, I was sharing with the shop owner some of my dialogues with the guys at Fibosearch. He came back saying that “if there are so many “ifs” and “buts” enough to confuse Oxford educated computer scientists, how my girls (who do the data entry) who have barely finished High-school can know what to do without mistake?”

    2. In here you will find a chart with the positive impact of moving the site to Woocommerce. Being like 10times faster than the previous (Magento) in March 2022, and also optimising the product catalogue (moving the simple products to variations in May 2023 (March-April 2023 there is a steep drop due to price increases of the products by about 15%)). The caption explains it all.

    What I try to say is that what you are doing it matters – a lot actually. Sadly, it matters most to people who will remain unaware/oblivious of the impact of your choices to them (e.g. you can imagine that the owners of eshops are not happy with their staff when products “disappear”).

    Anyway, these are nice stories to tell, and if I was Woocommerce, I would have publicized such case studies – success stories so to speak, as a means of compensating my partners who add value to my product, trying to make them even better.

    Keep well – thanking you once more,

    Dimitris.

    • This reply was modified 7 months, 2 weeks ago by Oxford Metadata Ltd. Reason: spelling
    • This reply was modified 7 months, 2 weeks ago by Oxford Metadata Ltd. Reason: further corrections
    • This reply was modified 7 months, 2 weeks ago by Oxford Metadata Ltd. Reason: famous last words :)
    Thread Starter Oxford Metadata Ltd

    (@oxfordmetadata)

    Hi @shameemreza,

    Thank you for the reply, yet it does not answer the essence of the question.

    If, as you imply, when at least one of the variations has positive stock, it will win over the stock of the parent what is the point of enabling the users to set the parent stock, if not to merely have the illusion that they have set up their products as “out of stock” but they are still visible? I can understand – for performance reasons, to have a hidden field that monitors the stock of all variations and if positive to help you display this product as in stock (rather than computing the stock of say 200 variations all the time), but I do not think that this helps. And if you think that 200 variations is an exaggeration, take a look in this product: Aloha Ημιμ?νιμο Βερν?κι Eight Color Coat 8ml – Femme Fatale (femme-fatale.gr) in one of our clients (btw this eshop has 100s of attributes and remains one of the fastest around – Latest Performance Report for: https://femme-fatale.gr/product/nychia/imimonima-vernikia/xromata/aloha-imimonimo-verniki-eight-colo&#8230; | GTmetrix – 1.2s / 100% with 268 variations ).

    The second argument about backorders, again the backorders are bound to be variation specific and not product specific. In the example I shared with you the merchant wants to allow backorders but for specific variations, because some of the colours are out of fashion and will never be made available again (or is just impossible to get), whereas for other colours wants to allow backorders because they are temporarily out of stock. Generally, notions like backorders have to have a physical reciprocal, not an abstraction, because issues like this arise.

    With regards to the bulk stock update, it will be great if again, you allow for the propagation of the values to all variations, should the user wants to use this feature. It is not only a good practice for usability/productivity but it also provides consistency. That is you know that when you set a (variable) product as out of stock, it will definitely be out of stock. (Mind you many themes, unlike ours, do not show in image swatches if a specific variation is in or out of stock). Maybe this explains why in our case we noted inconsistencies between the values stored in postmeta vs the values stored in the termrelationships tables regarding the stock.

    The issue was (is) “somewhere” still around. You see, our problems, were not because we had undue display of the products in the catalogue but the contrary. Products were disappearing from the catalogue, although variations and even parent products were saying that something is in stock.

    Maybe this is because there is the scenario that was not addressed. If all the variations are negative and the parent is positive what will happen? What if the end users forgot to set the stock at all the variations, and suddenly someone sets (during bulk edit) the stock of the parent to negative, it is bound to disappear (whereas originaly,was appearing by accident actually). I am saying this because we have seen this behaviour as well (staff forgetting to set the stock while setting the variations – they just couldn’t think that monitoring of the stock in parent level has no substance – as you may be in stock overall, but not for the specific colour that the customer wants).

    I hope my thoughts will be taken further. We are investing a lot of time and effort in optimizing wordpress/woocommerce for our clients and we feel that variations is the way to go. Especially for those of us involved with meta analytics of the sales, behaviourals and our own product recommendation engines.

    Thank you!

    Thread Starter Oxford Metadata Ltd

    (@oxfordmetadata)

    Hello, with reference to the original post (that it may be various add ons that are causing the issue during bulk editing), the client informed me that they are using the “Kaspersky Protection” Chrome add on (while some of are also using “Avast OnLine Security and Privacy”).

    The huge discrepancy though as far as our filter was concerned cames in the form of the following two scenarios (as we were informed by the FiboSearch/FiboFilter team):

    “.. went through more than 30 cases with different stock management and quantity combinations. The weird behavior occurs in these two cases:
    ?
    – A parent has enabled stock management and quantity is more than 0. All variations have enabled the “Manage Stock?” option and quantity is set to 0 or negative.
    – A parent has enabled stock management and quantity is 0 or negative. The option “Allow backorders?” is enabled. All variations have enabled the “Manage Stock?” option and quantity is set to 0 or negative.
    ?
    In these two cases, WooCommerce does something wrong. WooCommerce shows such products in the catalog, but it shouldn’t. We will try to create a “pull request” in the WooCommerce Github repository, but the temporary solution is another. We have a troubleshooting section in FiboFilters settings. We will analyze shop products in order to find these two cases. If we find something, we will show a message in the troubleshooting section with an explanation and guide on how to fix it manually by shop managers.?“

    So there may be just the case that it was not the bulk insert “bug” due to the add ons but the fact that during bulk edit of say simple products they had in their basket variable products, with the discrepancies in those two scenarios.

    I think you should help us answer these questions too. i.e.
    1. The “parent” abstraction has no physical reciprocal, so no stock value ought to be there, nor price nothing. Why in a variable product that parent can have the option to monitor stock?
    2. When the parent has activated the stock and it is negative, whereas one of the variation has stock activated and it is positive what is supposed to happen?
    3. When the parent has activated the stock and it is out of stock (and/or 0 negative), whereas one of the variation has stock activated and it at least one has a positive what is supposed to happen?
    4. In bulk editing, assuming that we have a mixed basked of simple and variable products. If I have disabled the stock in the variable parent and say that I set the stock status to “in Stock” and the stock value to 5, will these values propagate to all variations of the selected bouquet of products in my bulk editor?

    If we get these answers, it will be a good starting point, because right now we think that even if we ask the client to give us those videos, we will have no clue about to what is supposed to happen and we will be making fools of ourselves.

    Thank you,

    Dimitris

    PS. Just to add that me thinks that in the second case reported by the Fibo team (when the backorders are enabled) the products ought to be observable in the catalogue as if they are in stock. The stock status ought to be irrelevant. But in the first example, if confirmed, they have a huge case (that led me to the my own four questions).

    • This reply was modified 7 months, 2 weeks ago by Oxford Metadata Ltd. Reason: Addendum with clarifications
    Thread Starter Oxford Metadata Ltd

    (@oxfordmetadata)

    Just to add to this that the bug is repeatable and more pronounced (thus I guess irrelevant to the existence of other browser add ons) when one does bulk editing of products that are both simple and variable.

    May I suggest to the team to check the following scenarios.
    1. What happens when you bulk/edit update product categories of mix products (both simple and variations) without doing anything to the stock (are there discrepancies in the postmeta and term relationship tables regarding stock?

    2. What happens when you bulk/edit update product categories of a mixed bag of products (i.e. both simple and variations) and attempting to alter :

    a. Stock status (does this propagates to all variations of the variable products? If so, assuming that you make the products as in stock, what happens to a variation that has 0/negative stock?). Are the term relationships updated according to the introduced change?
    b. Stock quantity. For example, can you set the selected products as out of stock with one click, e.g. set the number to -5 ? If so, and you are able to change the quantity to the specified level for both simple and variable products, do the stock status for all simple products, all variations and the parent variation change correctl together with the in stock/out of stock status? Do the term relationships regarding stock are getting updated correctly?

    Somewhere there you will find the issue.

    • This reply was modified 7 months, 3 weeks ago by Oxford Metadata Ltd. Reason: further clarification
Viewing 11 replies - 1 through 11 (of 11 total)