Code for hooking into other plugins not working
-
After publishing the plugin I realized the slug has been changed so the code in the reade is incorrect. I pushed the new readme but for the meantime till it is published here is the correct code:
/wp-content/themes/Your(Child)Theme/functions.php
/* QR-Code in invoices */ add_action( 'wpo_wcpdf_after_order_details', 'wpo_wcpdf_qr_code', 10, 2 ); function wpo_wcpdf_qr_code ($document_type, $order) { require_once WP_PLUGIN_DIR . '/mxp-sepa-qr-code-addon-for-woocommerce/muxp-sepaqr.php'; $muxp_order = wc_get_order( $order); $order_id = $order->get_id(); if ( !empty($muxp_order->get_total()) && (float)$order->get_total() > 0 ) { echo '<h1>QR-Code for your online banking app<h1>'; echo '<img class="bacs-qrcode" src="' . muxp_get_qrcode($order->get_total(), $order_id) . '" alt="qr-code"></p>'; } }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Code for hooking into other plugins not working’ is closed to new replies.