Product Bundles changing order on Quotes

Hi all,

Intermittently, Product Bundles appear to be changing the order in which they are displayed on the quote. After doing some digging I have determined the cause of this is on the quotes in question the bundle_index field is the same for multiple records of the same quote_id in the product_bundle_quote table. 

Has anybody come across this before? It only seems to be happening to a small percentage of quotes but this appears to be happening on multiple sites.

Thanks

Brady

Parents
  • Hi Andre,

    Not on a consistent manner no, it seems sporadic. The 3 with 0 were on a test site but it is not always 0. If you see in the second screenshot there are two 12s. 

    I have had a look at the teams thought, but unfortunately all of the products on the sites have global team only. 

    The sugar bug quoted is one I have reported previously and appears to still have a few issues. However that is separate so I won't go into details with that on this post. I can confirm though it is not what I am raising here (We are on 12.0.3)

    I have written a script to fix bundles that have this issue so we can at least provide customers with a temporary fix for now

    Thanks

    Brady

  • HI

    Are all the QLI's being created via graphic user interface ? or do you have any other processes creating QLI's ? 
    import, scheduler, integration? 

    Maybe would be good to have a look if the issue is for a specific create action. 

  • Hi Andre,

    All created via the front end on quotes. I have done some testing in various scenarios on our non customised test site and have managed to create both the duplicate 0 scenario and a duplicate of a certain number 

    If I create a quote and save, then start adding groups in edit mode, the following happens:

    If I add 4 groups without adding any products - it all works correctly and I end up with 0,1,2,3 as indexes. However if I then add a product to the quote and then create another group, I end up with 0,1,2,3,3

    If I add a product first and then add 4 bundles, I end up with 0,0,0,0

    If I create a quote and add groups in create mode then the following happens:

    Regardless of if I have a product or not the product bundles in Create mode assign the indexes 0,1,3,6,10

    Almost like instead of assigning the next increment up it is adding what the increment should be to the existing number. 

    Having found all this the pessimist in me assumes this might be something specific to our sites. However if you are able to recreate any of the above I will be very happy Smiley

    Thanks

    Brady

  • Hello Brady, 

    First I want to say a big thanks for all the time that you are spending going through these repetitive steps to have a consistent test scenario. 


    I've reproduced the reported behaviour in a stock 13.0 instance in the cloud. 
    At this stage it does seem a defect to me, I am working with support to document it and will share the link when we have it ready. 

  • Hi Andre,

    No worries. Thanks for letting me know you have been able to recreate. Just as an FYI I am currently using the below script to fix the affected quotes.

    UPDATE product_bundle_quote pbq1
    INNER JOIN 
    (SELECT @row_no := IF(@prev_val = pbq.quote_id COLLATE utf8mb4_0900_ai_ci, @row_no + 1, 0) AS 'row_number'
    ,@prev_val := pbq.quote_id AS quote_id
    ,pbq.id
    ,pbq.date_modified
    ,pbq.bundle_id
    ,pbq.bundle_index
    FROM product_bundle_quote pbq,
    (SELECT @row_no := 0) x,
    (SELECT @prev_val := '') y
    WHERE pbq.quote_id IN () # Insert the selection here
    AND pbq.deleted = 0 
    ORDER BY pbq.quote_id, pbq.date_modified) r
    ON pbq1.id = r.id
    SET pbq1.bundle_index = r.row_number

    If it does turn out to be a defect all the way up to 13 it would be interesting to know if there is way to automate the above in a scheduled job etc.

    Thanks

    Brady

Reply
  • Hi Andre,

    No worries. Thanks for letting me know you have been able to recreate. Just as an FYI I am currently using the below script to fix the affected quotes.

    UPDATE product_bundle_quote pbq1
    INNER JOIN 
    (SELECT @row_no := IF(@prev_val = pbq.quote_id COLLATE utf8mb4_0900_ai_ci, @row_no + 1, 0) AS 'row_number'
    ,@prev_val := pbq.quote_id AS quote_id
    ,pbq.id
    ,pbq.date_modified
    ,pbq.bundle_id
    ,pbq.bundle_index
    FROM product_bundle_quote pbq,
    (SELECT @row_no := 0) x,
    (SELECT @prev_val := '') y
    WHERE pbq.quote_id IN () # Insert the selection here
    AND pbq.deleted = 0 
    ORDER BY pbq.quote_id, pbq.date_modified) r
    ON pbq1.id = r.id
    SET pbq1.bundle_index = r.row_number

    If it does turn out to be a defect all the way up to 13 it would be interesting to know if there is way to automate the above in a scheduled job etc.

    Thanks

    Brady

Children