WooCommerce checkout manager plugin issue

Hello,

i’m experiencing a very weird issue with the checkout manager plugin.

I created a checkbox field in the extra fields section. everything ok at that point.

The problem arises when i receive an order and get the admin mail. the new checkbox information is either 1 or nothing at all.

my question is: is there a way to show “Yes” or “No” in the mail the sie admin receives about an order if the user has enabled it or disabled it? if so, how?

thanks in advance.

Hello Alejandro,

Thanks for writing in! What you have in mind will require you to recode the value of the checkboxes for the plugin. You will have to edit the plugin and find this lines:

                        case 'checkbox' :

                            $output[ $key ]['type'] = 'checkbox';
                            $output[ $key ]['value'] = '1';

                            break;

This can be found in wp-content/plugins/tco-woo-checkout-editor/includes/tco_woo_checkout.woo.functions.php line 345 to line 350.

Please note that custom coding is outside the scope of our support. Issues that might arise from the use of custom code and further enhancements should be directed to a third party developer.

Hope this helps.

I only see one value, though, if it’s not checked it doesn’t say anything, is there a way to also register that?

Thanks in advance.

Hi Alejandro,

There could be only one value, with value and none. BUT, maybe you could alter it through email templates. You can find them in \wp-content\plugins\tco-woo-checkout-editor\templates\mail\ folder.

Then change this line

<?php echo wp_kses_post( $field['value'] ); ?>

to this

<?php
if (  $field['label'] == 'your field label here' ) {

$val = wp_kses_post( $field['value'] ); 

echo empty ($val) ? 'No' : 'Yes';

} else {
 
 echo wp_kses_post( $field['value'] ); 

} ?>

and this line

echo wp_kses_post( $field['label'] ) . ': ' . wp_kses_post( $field['value'] ) . "\n";

to this


$val = wp_kses_post( $field['value'] );

if (  $field['label'] == 'your field label here' ) {

$val = empty ($val) ? 'No' : 'Yes';

}

echo wp_kses_post( $field['label'] ) . ': ' .  $val . "\n";

These are for two email templates, and make sure to replace your field label here with your checkbox label.

Thanks!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.