Skip to content

Commit

Permalink
updated changes to set billing info through save shipping info ajax c…
Browse files Browse the repository at this point in the history
…all (#203)
  • Loading branch information
ramth05 authored Sep 29, 2020
1 parent 432553e commit 62254dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
18 changes: 0 additions & 18 deletions Controller/Payment/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,24 +167,6 @@ public function execute()
}
else
{
//setting updated billing address
if(empty($_POST['billing_address']) === false)
{
$billing_address = json_decode($_POST['billing_address'], 1);

foreach ($billing_address as $field => $field_value)
{
if(isset($billing_address[$field]) and
(empty($billing_address[$field]) === false))
{
$set_field = "set".ucfirst($field);
$this->getQuote()->getBillingAddress()->$set_field($field_value);
}
}

$this->getQuote()->save();
}

$amount = (int) (number_format($this->getQuote()->getGrandTotal() * 100, 0, ".", ""));

$payment_action = $this->config->getPaymentAction();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ define(
getRzpOrderId: function () {
var self = this;

//update shipping and billing before order into quotes
require('Magento_Checkout/js/model/shipping-save-processor').saveShippingInformation();

$.ajax({
type: 'POST',
url: url.build('razorpay/payment/order?' + Math.random().toString(36).substring(10)),
Expand Down

0 comments on commit 62254dc

Please sign in to comment.