Skip to main content
added 211 characters in body
Source Link
Amit Bera
  • 77.7k
  • 20
  • 124
  • 239

Issue1:YouIssue1: You need set customeridcustomer id at customer address object customer address object for set customer id to address

$customer->save();
/* add this code */
 $address->setCustomerId($customer->getId());
 $address->save();

Also for checking create address validate for save then try below code:

/* use to validate */
$valid = $address->validate();
if (!is_array($valid)) {
$address->save()
}

Issue1:You need set customerid at customer address object for set customer id to address

$customer->save();
/* add this code */
 $address->setCustomerId($customer->getId());
 $address->save();

Issue1: You need set customer id at customer address object for set customer id to address

$customer->save();
/* add this code */
 $address->setCustomerId($customer->getId());
 $address->save();

Also for checking create address validate for save then try below code:

/* use to validate */
$valid = $address->validate();
if (!is_array($valid)) {
$address->save()
}
Source Link
Amit Bera
  • 77.7k
  • 20
  • 124
  • 239

Issue1:You need set customerid at customer address object for set customer id to address

$customer->save();
/* add this code */
 $address->setCustomerId($customer->getId());
 $address->save();