Announcement

Collapse
No announcement yet.

Order Line Totals Causing Strange (but repeatable) Crashing

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Please try the following:

    - Find the file Taxmodule.php (normally in C:\Program Files (x86)\SellerDeck\SellerDeck 2016\PHPModules, or whatever is your SellerDeck 2016 install path)
    - Take a backup copy of the file
    - Open the file in Notepad or a similar application
    - Search for
    $oNode->SetAttributeValue('ordertax1rounded', $this->m_fOrderTax1Rounded);
    - Replace with
    $oNode->SetAttributeValue('ordertax1rounded', intval($this->m_fOrderTax1Rounded));
    - Restart SellerDeck Desktop

    I can't reproduce you crash in v16.0.1 adding a £72.56 product to a MOTO order. But the above fix resolved a very similar crash that was reported to support in v16.0.0 and the cause is very likely to be the same.

    Let me know here how you get on.
    Last edited by brucet; 21-Mar-2016, 10:46 AM.
    Bruce Townsend
    Ecommerce Product Manager
    Sellerdeck Ecommerce Solutions

    Comment


      #17
      Originally posted by brucet View Post
      Please try the following:

      - Find the file Taxmodule.php (normally in C:\Program Files (x86)\SellerDeck\SellerDeck 2016\PHPModules, or whatever is your SellerDeck 2016 install path)
      - Take a backup copy of the file
      - Open the file in Notepad or a similar application
      - Search for
      $oNode->SetAttributeValue('ordertax1rounded', $this->m_fOrderTax1Rounded);
      - Replace with
      $oNode->SetAttributeValue('ordertax1rounded', intval($this->m_fOrderTax1Rounded));

      I can't reproduce you crash in v16.0.1 adding a £72.56 product to a MOTO order. But the above fix resolved a very similar crash that was reported to support in v16.0.0 and the cause is very likely to be the same.

      Let me know here how you get on.
      I tried that, and sadly it had no effect.

      It did lead me to play around with the PHP by commenting out chunks of code, and retrying.

      it's not until i uncomment this line: $this->WalkOrderTree($oNode); i get the crash.

      if i leave this one line commented out i get no problems (although i also get no tax added)

      Comment


        #18
        Note that many of the the SD PHP files are loaded once when SD starts up. So changes made to them won't take effect until you restart SD.
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #19
          Originally posted by NormanRouxel View Post
          Note that many of the the SD PHP files are loaded once when SD starts up. So changes made to them won't take effect until you restart SD.
          I suspected that might be the case, so i've made sure it's fully closed before, and re-opened after every change.

          Comment


            #20
            I tried to make my 16.0.1 crash but failed. I note that others can't get the crash either, so I'm also wondering if it may be Windows version specific.

            It may be worth posting an exact set of steps to follow that cause said crash so we can see who does / doesn't get it.
            Norman - www.drillpine.biz
            Edinburgh, U K / Bitez, Turkey

            Comment


              #21
              Originally posted by NormanRouxel View Post
              I tried to make my 16.0.1 crash but failed. I note that others can't get the crash either, so I'm also wondering if it may be Windows version specific.

              It may be worth posting an exact set of steps to follow that cause said crash so we can see who does / doesn't get it.
              No problem.

              Step 1. Create a product with a selling value of £72.56 and a standard VAT rate of 20% (the VAT is important as it seems to be the cause of the crash)

              Step 2. in Sellerdeck open the "+ New Order" tab and add the product to a new order.

              At this point sellerdeck 16.0 crashes, I have tried this on windows 7, 8, and 10 with the same problem. i'll try installing the 16.01 update to see if i can stop the problem.

              Comment


                #22
                a little more digging and I've got to this line:

                $fOrderLineTax1Rounded += $oLBNode->GetAttributeValue(null, 'tax1rounded',XML_ATTRIBUTE_TYPE_FLOAT, 0.0);

                in the ProcessOrderLine function. It's here my lack of any PHP experience gets in the way.

                Comment


                  #23
                  After installing 16.01 it still crash, but it had reset the php files. Sadly after making the change Bruce suggested it still crashed.

                  Interestingly commenting out the line I mentioned above only made a difference after the change Bruce posted, it didn't prevent the crash before hand.

                  Comment


                    #24
                    Step 1. Create a product with a selling value of £72.56 and a standard VAT rate of 20% (the VAT is important as it seems to be the cause of the crash)

                    Step 2. in Sellerdeck open the "+ New Order" tab and add the product to a new order.

                    At this point sellerdeck 16.0 crashes...
                    Dammit - cannot get it to crash here. 16.0.1 / Win7 Pro 64bit.
                    Norman - www.drillpine.biz
                    Edinburgh, U K / Bitez, Turkey

                    Comment


                      #25
                      Originally posted by NormanRouxel View Post
                      Dammit - cannot get it to crash here. 16.0.1 / Win7 Pro 64bit.
                      That is extremely strange. only other thing i can suggest is possibly trying it on the demo site?

                      Comment


                        #26
                        I tried Bruce's PHP modification and can confirm that it does correct the problem for my implementation. I have confirmed this by switching the old and new PHP files in and out and the results are predictable: Error with old file, item successfully added to cart with new file.

                        I'm not sure where that leaves you Bruce. If you need any setup info from my site, please ask.

                        (v16.01 / Win8.1 / demo site.)
                        Andy Barrow
                        http://www.codepath.biz
                        T: 0161 870 6355

                        Accredited Sellerdeck development partners since 2004.
                        Data import / export and catalog management plug-ins.

                        Comment


                          #27
                          Originally posted by Andy@codepath View Post
                          I tried Bruce's PHP modification and can confirm that it does correct the problem for my implementation. I have confirmed this by switching the old and new PHP files in and out and the results are predictable: Error with old file, item successfully added to cart with new file.

                          I'm not sure where that leaves you Bruce. If you need any setup info from my site, please ask.

                          (v16.01 / Win8.1 / demo site.)
                          I'm starting to think i did something wrong. Let me start again....

                          Comment


                            #28
                            Originally posted by Dealec View Post
                            I'm starting to think i did something wrong. Let me start again....
                            I don't think you did Andrew. Further investigation indicates that Bruce's fix works only for an "Order" rounding Level. With the old PHP code, all three "Rounding Levels" produced the error. Now the error only occurs when LINE or ITEM rounding are used; ORDER rounding successfully adds the item to the cart.

                            Andrew, I suggest you change your rounding level to ORDER, with the new PHP code and see if that works.
                            Andy Barrow
                            http://www.codepath.biz
                            T: 0161 870 6355

                            Accredited Sellerdeck development partners since 2004.
                            Data import / export and catalog management plug-ins.

                            Comment


                              #29
                              Originally posted by Andy@codepath View Post
                              I don't think you did Andrew. Further investigation indicates that Bruce's fix works only for an "Order" rounding Level. With the old PHP code, all three "Rounding Levels" produced the error. Now the error only occurs when LINE or ITEM rounding are used; ORDER rounding successfully adds the item to the cart.

                              Andrew, I suggest you change your rounding level to ORDER, with the new PHP code and see if that works.
                              That worked! not to test it on the live version.

                              Comment


                                #30
                                Originally posted by Dealec View Post
                                That worked! not to test it on the live version.
                                Obviously, each rounding level will produce slightly different order totals in some situations so as long as you are happy with that it sounds like a workaround for now.
                                Andy Barrow
                                http://www.codepath.biz
                                T: 0161 870 6355

                                Accredited Sellerdeck development partners since 2004.
                                Data import / export and catalog management plug-ins.

                                Comment

                                Working...
                                X