Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Coernel82/SEPA-QR-for-Woocommerce

Repository files navigation

A little comment on the archiving of this repository

As you can see this repository has been archived. The most active fork is the one of petermorlion: https://github.com/petermorlion/SEPA-QR-for-Woocommerce This project was just a hobby project and I had help by a professional programmer for the first version. Now I am on my own - and I am not a programmer at all. So the project was very time consuming. Due to my wife having a baby in summer and also having an anxiety disorder for 7 months now my resources are limited. I am so open about the mental illness as I want to raise awareness in the public that mental illnesses are very, very common, especially depression and anxiety disorders. (I am fine though, am able to live a good life and work etc.! - also thanks to good medication!) I am very happy that petermorlion is taking over to keep this QR-Code-project alive. However as Peter and I agree this project should be obsolete as it should be included in the core of WooCommerce. You can find the discussion here and also adress this: woocommerce/woocommerce#27661 (comment)

SEPA-QR-for-Woocommerce (GDPR-compliant)

Plug-and-Play Plugin for Woocommerce

Before you start

The plugin comes as is and free. However a real person has put real work into it. So if you use it please do s.th. good. Use your efforts, your time for beneficial projects or whatever!

Prerequisite

php GD2 extension must be installed as the QR-Code generator by fellwell15 requires this. I guess this is a standard module and for most people nothing has to be done here!

Installation

Nothing special:

Manual installation

  • Download the ZIP-file via "Code --> Download Zip"
  • Extract ZIP-File and make a new ZIP-File from the mxp-sepaqr directory
  • In Woocommerce via "install" and upload or manually placing mxp-sepaqr.zip into the plugin folder.

What it does

places an image with the SEPA-QR-Code in the

  • thank-you-page after placing an order
  • email you get from woocommerce

In the backend:

  • the QR code generator creates the QR-code locally. There is no Google-API nor external server in use!
  • the QR code generator is from fellwell15
  • plugin registers a get-parameter (configurable, default mxp_qr) for testing purposes and, if desired, to create links to the cached QR codes.
  • the prefix mxp is used throghout the plugin to avoid collisions with other plugins and functions. mxp stands for www.musicalexperten.de (musical experts). Remember where you've seen it first! ;-)

Hooking into other plugins

I use a plugin for PDF-invoices and packaging slips. Refer to this sample to hook the QR-Code into whatever you like:

/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="' . esc_attr(muxp_get_qrcode($order->get_total(), $order_id)) . '" alt="qr-code"></p>';
	} 
}

Translation

https://translate.wordpress.org/projects/wp-plugins/mxp-sepa-qr-code-addon-for-woocommerce/

Configuration / if it does not work

The plugin comes with a little fallback: In case the BIC, IBAN, etc. are not shown open the mxp-sepaqr.php in the programing code you can hardcode some variables and translations. You'll find explanations in the comments.

Advanced configuration of the qr-code itself

Have a look at fellwell15

Testing and troubleshooting

Simple way

Install the plugin and order s.th. in your shop using BACS (direct bank transfer).

To test if the QR-Code generator is working

www.yourwebpage.de/?mxp_qr=something = creates a real QR with dummyvalues 11-11 Working example

To find an existing cached QR-Code, query for a valid md5 string. If it does not exist in cache or transients, a sad smiley will appear.

www.yourwebpage.de/?mxp_qr=351436ef4b279e1811a6c68a2dd58b1b results in a sad smiley. Working example

Remarks

Storing the QR code in cache or transients is only needed if you want to use a link instead of a picture inside the email. Details in the program code.

Support

The program has been written by a professional programmer - however fully free of charge and without detailed knowledge about WooCommerce. The program comes as is and we cannot give support. I have no clue about it and the programmer can't work for free!

Full integration in Woocommerce

I am more then happy if someone integrates the code into the Woocommerce core! The topic is discussed here: woocommerce/woocommerce#27661

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages