Like in Simple module in Opencart to add your code?

I obtained a function that is executed after pressing the button "Confirm order" you need to add this code:
foreach ($data['products'] as $product) {
 $viberText = "";
 $bitrix24products = "";
 $prodId = $product['product_id'];
 $order_mpn = $this->db->query("SELECT `mpn` FROM `" . DB_PREFIX . "product` WHERE `product_id` = '$prodId'");
 $order_mpn = $order_mpn->row["mpn"];
 $bitrix24option = empty($product['option']) ? "" : "<br/><br/><b>Options:</b>";
 $viberTextOption = empty($product['option']) ? "" : "Options: \n";
 $bitrix24products .= 
 "<b>Title:</b> ".$product['name']." (<a target='_blank' href='http://".$_SERVER['HTTP_HOST']."/index.php?route=product/product&product_id=".$product['product_id']."'>Ssylka</a>)".
 "<br/><b>Quantity:</b> ".$product['quantity']." PCs".
 "<br/><b>Price:</b> ".$product['price']." UAH".
 "<br/><b>Amount:</b> ".$product['total']." UAH".
 "<br/><b>Vendor:</b> ".$order_mpn.
$bitrix24option;

 $viberText .="\nazvanie:\n".$product['name'].
 "\kolichestvo:".$product['quantity']." PCs".
 "\price::". $product['price']." UAH".
 "\Summa: ".$product['total']." UAH".$viberTextOption;

 foreach ($product['option'] as $option) {
 if ($option['type'] == 'checkbox') {
 $bitrix24products .= "<br/>-- Selected: ".$option['name'];
 $viberText .= "\wybrano: ".$option['name'];
 } else {
 $bitrix24products .= "<br/>-- ".$option['name'].": ".$option['value'];
 $viberText .= "\n".$option['name'].": ".$option['value'];
}
}

 if ($product != end($data['products'])) {
 $bitrix24products .= "<br/><br/>------------------------------------------------<br/><br/>";
 $viberText .= "\n";
 } else {
 $bitrix24products .= "<br/>";
 $viberText .= "\n";
}
 $stack[$order_mpn] .= $viberText;
 $stackBitrix[$order_mpn] .= $bitrix24products;
 }

Can someone familiar with this module, tell me where to find this function?
April 4th 20 at 00:45
1 answer
April 4th 20 at 00:47
Solution
Your module

Find more questions by tags OpenCart