WordPress.org

Forums

WooCommerce - excelling eCommerce
How do I set the postal code? (1 post)

  1. visualxl
    Member
    Posted 1 year ago #

    Hi,

    I currently set all my shipping address automatically like this:

    // Hook in
    	add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
    
    	// Our hooked in function - $fields is passed via the filter!
    	function custom_override_checkout_fields( $fields ) {
    $fields['shipping']['shipping_first_name']['default'] = 'Jackie';
    	$fields['shipping']['shipping_last_name']['default'] = 'Chan';
    	$fields['shipping']['shipping_company']['default'] = 'Company x';
    	$fields['shipping']['shipping_address_1']['default'] = 'X Road';
    	$fields['shipping']['shipping_address_2']['default'] = '#0X-01';
    	$fields['shipping']['shipping_city']['default'] = 'Singapore';
    	$fields['shipping']['shipping_postcode']['default'] = '123456';
            return $fields;
    }

    Prior to the recent woo commerce updates, it runs fine. But after the recent updates, the postal cannot is the only value that I cannot set. I need to set the default postal code. Please asssit

    http://wordpress.org/plugins/woocommerce/

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce - excelling eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic