Need Shipping Address Field From WooCommerce To Test Against

I need the field name for the ship to address 1 and 2 field.  I am not sure of the class name in woocommerce that would contain those attributes.  I have the conditional logic in my child theme but I am not sure how to get the field names to test against.
sharingsunshineAsked:
Who is Participating?
 
sharingsunshineAuthor Commented:
this is my code and it isn't displaying the shipping address anywhere in the checkout fields.  I just need to be able to retrieve the shipping addresses and then I can plug them into an existing set of codes that will do what else is needed.

class POBox_Shipping extends WC_Customer {

function get_shipping_address_1() {

if (!empty($shipping_address_1)){
return $this->shipping_address_1;
}
else {
echo 'this is goofy';
}

add_filter( 'woocommerce_checkout_fields', 'get_shipping_address_1' );
}
}

Open in new window

0
 
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
Let me know if you still need help and I will try and spin up a WP/Woo site to test
0
 
sharingsunshineAuthor Commented:
Yes, I still need help.
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

 
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
If you don't get a reply back from me after 6 hours, just ping back here to send me a reminder.
0
 
sharingsunshineAuthor Commented:
I still need help.  My computer has been working itermittently for 2 weeks and I am waiting for a replacement.  So, that's why I haven't responded sooner.
0
 
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
Do you see separate areas for billing and shipping on the checkout page?  If not, go to settings -> shipping tab -> Shipping options and make sure that the radio option for, " Force shipping to the customer billing address" is not selected.  That will give you the option to see both.

Did you want the shipping to show up somewhere else?
0
 
sharingsunshineAuthor Commented:
I now have the shipping address showing.  No, I don't need to move shipping.  I just need to be able to test the shipping address against a regex.
0
All Courses

From novice to tech pro — start learning today.