Skip to content

Commit

Permalink
Fetch product_id using parent_id for multiple variants item
Browse files Browse the repository at this point in the history
  • Loading branch information
VishalKumarRP committed Oct 22, 2023
1 parent be3c67f commit 1fd6b9c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion woo-razorpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -1311,7 +1311,7 @@ public function orderArg1CC($data, $order)
$data['line_items'][$i]['type'] = $type;
$data['line_items'][$i]['sku'] = $product->get_sku();
$data['line_items'][$i]['variant_id'] = (string)$item->get_variation_id();
$data['line_items'][$i]['product_id'] = (string)$product->get_id();
$data['line_items'][$i]['product_id'] = (string)$product->get_parent_id();
$data['line_items'][$i]['price'] = (empty($productDetails['price'])=== false) ? round(wc_get_price_excluding_tax($product)*100) + round($item->get_subtotal_tax()*100 / $item->get_quantity()) : 0;
$data['line_items'][$i]['offer_price'] = (empty($productDetails['sale_price'])=== false) ? (int) $productDetails['sale_price']*100 : $productDetails['price']*100;
$data['line_items'][$i]['quantity'] = (int)$item->get_quantity();
Expand Down

0 comments on commit 1fd6b9c

Please sign in to comment.