cancel
Showing results for 
Search instead for 
Did you mean: 

Error on updating tracking number - Customer website ID must be specified

SOLVED

Error on updating tracking number - Customer website ID must be specified

Hi,

I get below error in the admin Add Shipment page when trying to add a tracking number and clicking on Submit Shipment button.

Customer website ID must be specified when using the website scope

This is Magento 1.9.2.4. It was working fine and the errors started displaying all of a sudden. There are no errors in the log files or Chrome developer console.
Any help is appreciated.
Thanks!
8 REPLIES

Re: Error on updating tracking number - Customer website ID must be specified

Hi @sv_mage,

 

How that Custoemr was created?

It seems Magento can't identify the website for the user. Did you created with the order on-the-fly?

--
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution"

Re: Error on updating tracking number - Customer website ID must be specified

Hi Damian,

Customers are creating these orders from the front-end on the website.

 

I just found that the customer ID is saved as NULL in the order record in "sales_flat_order" table. Could this be the problem?

 

Re: Error on updating tracking number - Customer website ID must be specified

Please ignore my null customer id observation - those are guest users and this issue happens with all users. 

Re: Error on updating tracking number - Customer website ID must be specified

Hello @sv_mage

 

 

http://freegento.com/doc/df/d5f/_customer_2_model_2_entity_2_customer_8php-source.html

 

 Mage_Customer_Model_Entity_Customer 

Can you check that file and error msg coming from that file

 

You can debug using below code add before that msg 

foreach(debug_backtrace() as $t) { 
if(isset($t['function']))
echo $t['file'] . ' line ' . $t['line'] . ' calls ' . $t['function'] . "()<br/>";
}
exit;

And check which class called that method, maybe custom module doing that.

 

Hope it will help you.

 

 

Re: Error on updating tracking number - Customer website ID must be specified

Hi @Sunil Patel,

Thanks for your response. The customer.php file in the path you mentioned was an empty class defined as below:

class Mage_Customer_Model_Entity_Customer extends Mage_Customer_Model_Resource_Customer{}

There is another Customer.php in this path - /app/code/core/Mage/Customer/Model/Convert/Adapter 

and I added your debug code above the call to loadByEmail method. I did not see that getting executed anywhere. I have tried creating a new order and processing the invoice and shipment for the order. I still get the same error message on click on Submit Shipment. 

This is the screenshot of the message. ship_error.png

Is there a way to track where the global message is getting populated from? 

Thank you!

 

 

 

 

Re: Error on updating tracking number - Customer website ID must be specified

Hello @sv_mage

 

Try to find using grep command that msg and check how many files contain that msg. and debug it.

 

Hopefully, it will help you.

 

 

Re: Error on updating tracking number - Customer website ID must be specified

Hi @Sunil Patel,

Thank you for your suggestion. I placed the debug code in the loadByEmail method of Customer.php file located in /app/code/core/Mage/Customer/Model/Resource.

An extension that was installed to subscribe customers to newsletter was throwing this exception:

$customer = Mage::getModel('customer/customer')->loadByEmail($customerEmail); //error

This is how I was able to fix:

$customer = Mage::getModel('customer/customer')->setWebsiteId(Mage::app()->getStore()->getWebsiteId())->loadByEmail($customerEmail);

Re: Error on updating tracking number - Customer website ID must be specified

Great...