vubbanka / eCard

eCard repozitár obsahuje knižnicu obaľujúcu platoby kartou od VÚB banky
1 stars 0 forks source link

Suggestion to add before & after actions to thank you page for wrapping the thankyou_page #3

Open erikkubica opened 1 year ago

erikkubica commented 1 year ago

Hi,

It's nice to be able to style things, unfortunately your plugin does not really allow it, because you generate HTML without any wrapper:

some code from hooks
<p>foo bar</p>
<form> with pay button</form>
some code from other hooks

I cannot just .woocommerce-order p { some style } because it would style all the paragraphs.

My recommendation is to add do_action( 'wc_gateway_vub_thankyou_page_before', $order_id ); and do_action( 'wc_gateway_vub_thankyou_page_after', $order_id ); to woocommerce-gateway-vub.php function thankyou_page()

This also allows to target custom modifications to be made before and after your output which is always nicer to have then a wrapper, but the wrapper could be there by default + the hooks.

Also button value seems to be hard-coded to "Prejsť k platbe" but irl it' displaying "Objednaj" which makes no sense, not sure where does this text is changed to "Objednaj". It should be ['value' => __( 'Proceed to payment', 'your-text-domain', 'id' => 'VUBbutton'] and include it in a translation file.

I can create a PR but not right now.