Skip to content

Commit

Permalink
Merge pull request #539 from razorpay/bugfix/shipping-engine-name-cha…
Browse files Browse the repository at this point in the history
…nges

[PLUGIN1CC - 3282] adding shipping method name for shipping engine
  • Loading branch information
nkttiwari authored Mar 28, 2024
2 parents dbffc78 + 2707def commit 2c9ddb2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions woo-razorpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -2150,6 +2150,10 @@ public function update1ccOrderWC(& $order, $wcOrderId, $razorpayPaymentId)
if($razorpayData['shipping_fee'] == 0)
{
$item->set_method_title( 'Free Shipping' );
if(isset($razorpayData['notes']) && isset($razorpayData['notes']['shipping_method_name']))
{
$item->set_method_title($razorpayData['notes']['shipping_method_name']);
}
}
else
{
Expand Down Expand Up @@ -2221,6 +2225,11 @@ public function update1ccOrderWC(& $order, $wcOrderId, $razorpayPaymentId)
// $item->set_method_id( "flat_rate:1" );
$item->set_total( $razorpayData['shipping_fee']/100 );

if(isset($razorpayData['notes']) && isset($razorpayData['notes']['shipping_method_name']))
{
$item->set_method_title($razorpayData['notes']['shipping_method_name']);
}

$order->add_item( $item );

$item->save();
Expand Down

0 comments on commit 2c9ddb2

Please sign in to comment.