@@ -51,7 +51,7 @@ private function __construct(Registry $registry){
5151 */
5252 public function getCustomerSessionIdentifier (){
5353 $ customer = $ this ->getCustomer ();
54- if (isset ($ customer ['customer_id ' ]) && $ this ->registry ->get ('customer ' )->isLogged ()) {
54+ if (isset ($ customer ['customer_id ' ]) && $ this ->registry ->get ('customer ' ) && $ this -> registry -> get ( ' customer ' ) ->isLogged ()) {
5555 return "customer_ " . $ customer ['customer_id ' ];
5656 }
5757 $ guestId = $ this ->buildGuestSessionIdentifier ($ customer );
@@ -73,7 +73,7 @@ public function getCustomerSessionIdentifier(){
7373 }
7474
7575 private function buildCartSessionIdentifier (array $ data ){
76- if (isset ($ data ['cart ' ]) && is_array ($ data ['cart ' ]) && count ($ data ['cart ' ] == 1 ) ) {
76+ if (isset ($ data ['cart ' ]) && is_array ($ data ['cart ' ]) && count ($ data ['cart ' ]) == 1 ) {
7777 $ cartKeys = array_keys ($ data ['cart ' ]);
7878 return "cart_ " . hash ('sha512 ' , $ cartKeys [0 ]);
7979 }
@@ -151,7 +151,7 @@ public function getAddress($key, $order_info = array()){
151151 $ address = $ this ->getAddress ('payment ' , $ order_info );
152152 }
153153 if (empty ($ address )) {
154- if ($ customer ->isLogged () && isset ($ session [$ key . '_address_id ' ])) {
154+ if ($ customer && $ customer ->isLogged () && isset ($ session [$ key . '_address_id ' ])) {
155155 $ address = $ address_model ->getAddress ($ session [$ key . '_address_id ' ]);
156156 }
157157 if (isset ($ session ['guest ' ][$ key ]) && is_array ($ session ['guest ' ][$ key ])) { // billing only
@@ -297,7 +297,7 @@ public function getOrderModel(){
297297
298298 public function getCustomer (){
299299 $ data = $ this ->registry ->get ('session ' )->data ;
300- if ($ this ->registry ->get ('customer ' )->isLogged ()) {
300+ if ($ this ->registry ->get ('customer ' ) && $ this -> registry -> get ( ' customer ' ) ->isLogged ()) {
301301 $ customer_id = $ this ->registry ->get ('session ' )->data ['customer_id ' ];
302302 $ this ->registry ->get ('load ' )->model ('account/customer ' );
303303 $ customer = $ this ->registry ->get ('model_account_customer ' )->getCustomer ($ customer_id );
@@ -494,7 +494,7 @@ public function getWebhookUrl(){
494494 public function isValidOrder ($ order_id ){
495495 if (!$ this ->isAdmin ()) {
496496 $ order_info = $ this ->getOrder ($ order_id );
497- if ($ this ->registry ->get ('customer ' )->isLogged () && isset ($ this ->registry ->get ('session ' )->data ['customer_id ' ])) {
497+ if ($ this ->registry ->get ('customer ' ) && $ this -> registry -> get ( ' customer ' ) ->isLogged () && isset ($ this ->registry ->get ('session ' )->data ['customer_id ' ])) {
498498 if ($ this ->registry ->get ('session ' )->data ['customer_id ' ] != $ order_info ['customer_id ' ]) {
499499 return false ;
500500 }
0 commit comments