This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Add the field to the checkout page | |
| */ | |
| add_action( 'woocommerce_after_order_notes', 'some_custom_checkout_field' ); | |
| function some_custom_checkout_field( $checkout ) { | |
| echo '<div id="some_custom_checkout_field"><h2>' . __('My Field Header') . '</h2>'; | |
| woocommerce_form_field( 'some_field_name', array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| User-agent: * | |
| Disallow: /*add-to-cart=* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DELETE FROM wp_options | |
| WHERE option_name LIKE '_transient_wc_%' OR option_name LIKE '_transient_timeout_wc_%'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DELETE FROM wp_options | |
| WHERE option_name LIKE '_wc_session_%' OR option_name LIKE '_wc_session_expires_%'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function conditional_checkout_field( $checkout ) { | |
| echo '<div id="conditional_checkout_field">'; | |
| $check_in_cart = conditional_product_in_cart(xxxx); //replace xxxx with the product id | |
| // Check if the product is in the cart and show the custom fields if it is | |
| if ($check_in_cart === true ) { | |
| echo '<h2>'.__('My Custom Checkout Field').'</h2>'; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action('woocommerce_after_order_notes', 'conditional_checkout_field'); |
NewerOlder