• Resolved dineshkrish

    (@dineshkrish)


    Hello, I have problem on shipping calculation I have created the static shipping address by hidden values

    <input type="hidden" name="ship_to_different_address" value="1">
    <input type="hidden" name="shipping_first_name" id="shipping_first_name" value="Test First Name">
    <input type="hidden" name="shipping_last_name" id="shipping_last_name" value="Test Last Name">
    <input type="hidden" name="shipping_company" id="shipping_company" value="Test company">
    <input type="hidden" name="shipping_address_1" id="shipping_address_1" value="Test address">
    <input type="hidden" name="shipping_city" id="shipping_city" value="Test">
    <input type="hidden" name="shipping_postcode" id="shipping_postcode" value="10001">
    <input type="hidden" name="shipping_state" id="shipping_state" value="NY">
    <input type="hidden" name="shipping_country" id="shipping_country" value="US">

    While getting data in class-wc-tax.php $location = WC()->customer->get_taxable_address(); i got only country and not stored in `woocommerce_sessions’ table. Please Advice

    https://www.ads-software.com/plugins/woocommerce/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Mike Jolley

    (@mikejolley)

    Where have you placed this code?

    Thread Starter dineshkrish

    (@dineshkrish)

    I have placed on form-shipping.php (my theme)

    $temp = WC()->session->get( 'customer' );
    echo "<pre>";
    print_r($temp);
    echo "</pre>";<code>upon the code result is</code>Array
    (
        [postcode] =>
        [city] =>
        [address_1] =>
        [address_2] =>
        [state] =>
        [country] => US
        [shipping_postcode] =>
        [shipping_city] =>
        [shipping_address_1] =>
        [shipping_address_2] =>
        [shipping_state] =>
        [shipping_country] => US
        [is_vat_exempt] =>
        [calculated_shipping] => 1
    )

    Plugin Contributor Mike Jolley

    (@mikejolley)

    Do you have any options like “ship to billing address only” enabled in the settings?

    Thread Starter dineshkrish

    (@dineshkrish)

    nope… I have used this for certain product orders, other wise have a check box Ship to a different address?

    Plugin Contributor Mike Jolley

    (@mikejolley)

    https://dl.dropboxusercontent.com/s/269ttaendbpswm0/2016-06-17%20at%2016.13.png?dl=0

    ^ Maybe you can either output some of those values to the console to debug, or ensure there are not 2 fields on your page with the same ID.

    Thread Starter dineshkrish

    (@dineshkrish)

    You the guy Awesome . That related problem I had met that is a("#ship-to-different-address").find("input").is(":checked") coding I had missed. Thanks lot you saved my time.. Thanks again Mike ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Tax calculation’ is closed to new replies.