0

How to save customers address attribute value in the database and show on the edit page when we reorder/new order?

It's working when I update an already placed order(Value update).

Click on order then open order details and then click on billing/shipping address and update that custom field then it's work.

But then I click on REorder/ new order of that then value not showing in the newly created order that field is blanked.

Please help.

Thank you.

1 Answer 1

0

You Can Try This Following Two Method With Related Factory..

public function saveaddress(\Customapi\Api\Data\CustomerInterface $parameters) { // echo json_encode($parameters);exit; // print_r($parameters); // $postcode = isset($parameters ['postcode'])?$parameters ['postcode']:0; if ($parameters && $parameters->getData()) { $data=$parameters->getData(); // echo json_encod($data);exit; if (!isset($data['email']) || !$data['email']) { $data = array ( 'data' => array ( 'customer' => array ( array ( 'message' => 'email paremer is missing.', 'status' => 'false' ) ) ) ); return [$data]; } if (isset($data['customer_id']) && $data['customer_id']) $data['customer']= $data['customer_id']; // echo json_encod($data);exit; else { $data = array ( 'data' => array ( 'customer' => array ( array ( 'message' => 'some paremer is missing.', 'status' => 'false' ) ) ) ); return [$data]; } $address = $this->account->saveCustomerAddress($data); // echo json_encod($address);exit; return [$address]; } else { $data = array ( 'data' => array ( 'customer' => array ( array ( 'message' => 'some paremer is missing.', 'status' => 'false' ) ) ) ); return [$data]; }

}

public function savebillingshipping(\Customapi\Api\Data\CheckoutInterface $parameters) { $enable = $enable = $this->checkEnable();

    if ($enable && $parameters && count($parameters->getData())) {
        $deviceObject=$this->checkout->savebillingshiping($parameters->getData());
        return array($deviceObject);
    } else {
        return array(['success' => false]);
    }

} 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.