• hi
    i have a site that uses woocommerce checkout forms plugin. we added a field called deliveryinstructions with 2 radio optoins. deliver even if the customer isnt home or dont deliver if the customer isnt home.

    we are trying to display the selected radio text value in woocommerce PDF invoices and packing slip. i put this code in the custom template
    <?php $this->custom_field(‘deliveryinstructions’, ‘Delivery Intructions:’); ?>

    however this returns a 1 or 2, depending on which radio button they selected.

    is there a way to display the actual text value from the radio options instead of a 1 or 2 value?
    thank you

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor kluver

    (@kluver)

    Hi @ariban99,

    That should be no problem. Could you tell us which checkout form plugin you are using?

    Thread Starter ariban99

    (@ariban99)

    Hi
    I am using
    Checkout Field Editor for WooCommerce

    Customize WooCommerce checkout fields(Add, Edit, Delete and re-arrange fields).
    Version 1.4.2 | By ThemeHigh | View details

    Plugin Contributor alexmigf

    (@alexmigf)

    Hello @ariban99

    If you set the checkbox value to 1 and 2, you need to do a conditional to print the text you want, like this:

    <?php
    	$delivery_instructions = $this->custom_field(‘deliveryinstructions’);
    	if( !empty($delivery_instructions) && $delivery_instructions == 1 ) {
    		echo '<strong>Delibery Instructiions:</strong>: At home';
    	} elseif( !empty($delivery_instructions) && $delivery_instructions == 2 ) {
    		echo '<strong>Delibery Instructiions:</strong>: Not at home';
    	}
    ?>
    Thread Starter ariban99

    (@ariban99)

    thank you i will try that

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘custom checkout form’ is closed to new replies.