Sign in to follow this  
Bob5

M2E eBay Order Error Creating Mage Order

Recommended Posts

Today we got a health notification from M2EPro. Looking at the eBay Order log yields this:

Magento Order was not created. Reason: Notice: Undefined index: rate in {ourPath}/app/code/Ess/M2ePro/Model/Ebay/Order/Item.php on line 207

Clicking on the order in the M2E eBay Order list yields a page of errors which begins:

Exception #0 (Exception): Notice: Undefined index: rate in {ourPath}/app/code/Ess/M2ePro/Block/Adminhtml/Ebay/Order/View/Item.php on line 296

At this point (line 296) in the code, the following appears:

    public function callbackColumnTaxPercent($value, $row, $column, $isExport)
    {
        $taxDetails = $row->getChildObject()->getData('tax_details');
        if (empty($taxDetails)) {
            return '0%';
        }

        $taxDetails = $this->getHelper('Data')->jsonDecode($taxDetails);
        if (empty($taxDetails)) {
            return '0%';
        }

        return sprintf('%s%%', $taxDetails['rate']);                                 <== LINE 296
    }

After a bit of looking in the database, I located the column tax_details in table m2epro_ebay_order_item. 

Further experimentation revealed that the above error occurs on all items in this table where the tax_details column contains data like {"ebay_collect_taxes":"0.95"}, other rows that contain [] do not produce an error, and replacing the {...} data with [] in the record that produces the error above and will not create a Magento Order eliminates the error, and the order creates normally.

The following SQL returns 128 rows from a table of 5859 rows. All but the last 5 entries are of the form {"rate":0.00, "amount":0.00}. Only the last 5 generate an error, and 4 of the 5 created Mage Orders.

SELECT * FROM `mget_m2epro_ebay_order_item` WHERE tax_details <> '[]' ORDER BY `order_item_id` DESC

I'm not familiar enough with Magento to work out a permanent solution. Can anyone help?

 

Share this post


Link to post
Share on other sites

I assume so. For now, I'll just edit the database when I have the problem. I'm on the newest version of M2E, so I guess I'll just wait to see if the problem gets fixed. Also having an issue with the new required fields. Looks like I'll have to move a bunch of product from eBay's old categories to the new one. eBay can figure out what fields are required. M2E can't.

Hoping someone else figures this one out so I don't have to dust off my PHP and figure out the Magento dev docs.

Edited by Bob5

Share this post


Link to post
Share on other sites

We are also experiencing this issue. We noticed that for some reason the orders with error do not display their transactional items when viewing the order in ebay->Orders. 

Our Error is:

Magento Order was not created. Reason: Notice: Undefined index: rate in /var/www/html/live/app/code/Ess/M2ePro/Model/Ebay/Order/Item.php on line 215

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this