I am trying to develop a plugin in wordpress and learn PHP. I made a regrettform setting page in plugin in admin area and the form is working just perfect. The mail attachment is achived with use of the dompdf library. T The form have 3 options radio button and the goal is to replace the string customer_completed_order' with the option value from the form
Is there anyone who can help and point me in a direction to achive this
<?PHP
function attach_regret_form_pdf_to_email( $attachments, $email_id, $order ) {
if( ! is_a( $order, 'WC_Order' ) || ! isset( $email_id ) || $email_id !=
'customer_completed_order' ) { return $attachments; }
?>
<body>
<br>
<div class="clear">
<h2>Regrettform setting page</h2>
<p>You have the option here to select from three different orderstatuses the
Regrettform will be attached to </p>
<p>Go to woocoomerce admin panel order, select the order you would like to edit, and
at the box Send order email (on the right side) and <b>Choose an email to send</b> ,
</p>
<p>Select from the list Prosessing order , Completed order, Order details </p>
<br>
<p><b>Just Select one of the option button and hit save</b> </p>
<form action="" method="post" >
<input type="radio" name="option" value="customer_complete`your
text`d_order"onClick="submit();" CHECKED/>customer_completed_order
<input type="radio" name="option"
value="customer_prosessed_order">customer_prosessed_order
<input type="radio" name="option" value="customer_invoice">customer_invoice
<span class="error">* <?php echo $optionErr;?></span>
<br><br> <input type="submit" name="Save changes" value="Save">
<?php
echo "<h2>You have selected:</h2>";
echo $option;