Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialJokūbas Maknavičius
7,419 Pointshow to show/hide billing details when delivery shipping
information in the screenshot https://1drv.ms/i/s!AtpJ63Gc5l8sg-1kkQhuaU6HCyOqaw
2 Answers
Ash Brown
Courses Plus Student 251 PointsYou will need to know things
- Override woocommerce checkout page.
- Working with if-else statements.
Alternatively, you can try this plugin https://wordpress.org/plugins/woohide-hide-billing-fields/
Ash Brown
Courses Plus Student 251 PointsI need to first understand what are the two shipping methods. I understand the 2nd shipping method is delivery. Then, what is the first shipping method? Local pickup?
Ash Brown
Courses Plus Student 251 PointsAnd can you share the url of the checkout page?
Jokūbas Maknavičius
7,419 PointsJokūbas Maknavičius
7,419 Pointsfirst is mail second is omniva post
Jokūbas Maknavičius
7,419 PointsJokūbas Maknavičius
7,419 PointsWhat class to use in functions.php
Jokūbas Maknavičius
7,419 PointsJokūbas Maknavičius
7,419 Pointsfind code but not working for some reason
add_filter('woocommerce_checkout_fields', 'xa_remove_billing_checkout_fields');
function xa_remove_billing_checkout_fields($fields) { $shipping_method ='free_shipping:1'; // Set the desired shipping method to hide the checkout field(s). global $woocommerce; $chosen_methods = WC()->session->get( 'chosen_shipping_methods' ); $chosen_shipping = $chosen_methods[0];
}