Changing the code and adding an arbitrary notification.
-
Good afternoon. Prompt with a question please. I have a price calculator and, in addition to the quantity, the length is also taken into account: 2 pieces of 10 meters each – an example. I have changed the plugin code. Introduced a variable from the calculator plugin and replaced the line in ITEMS.
В файле:
/wp-content/plugins/notification-for-telegram/index.php// product_meters - line 520 $product_meters = wc_get_order_item_meta($item_id, ‘Length of one piece (m)’, true); // line 535 - Can't think of anything better than this if ($product_meters) { $linea = $linea . $quantity . «pieces. x » . $product_meters . «meters. x » . $item_name . » — » . $line_total . » » . $currency_code . $extrafiledhook . «\r\n»; } else { $linea = $linea . $quantity . «pieces. x » . $item_name . » — » . $line_total . » » . $currency_code . $extrafiledhook . «\r\n»; }Is it possible to change the line
$linea = $linea.$quantity." x " .$item_name . " - ". $line_total." ". $currency_code.$extrafiledhook."\r\n" ;and add a variable via a function without changing your plugin code? So that the changes are not overwritten with updates? Perhaps through a filter somehow?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Changing the code and adding an arbitrary notification.’ is closed to new replies.