• Resolved cqwjds

    (@cqwjds)


    For some items I am selling, they have to be sent to an approved receiver and cannot be sent directly to the purchaser. I have customized my checkout page to use existing fields for Shipping Address and have the page set to default to having the Ship To address section open using:
    add_filter( 'woocommerce_ship_to_different_address_checked', '__return_true', 20);

    I also added javascript to disable the checkbox. However, it looks like there is some event happening when a user clicks on the H3 for “Ship To a Different Address” that is allowing them to uncheck the checkbox and hide the shipping address section. At page load, the class looks like
    <div class="shipping_address">
    When the user clicks on the Ship To a Different Address text, I see the addition of a style to hid the section:
    <div class="shipping_address" style="display: none;">
    How can I fully force the “Ship To a Different Address” to always be displayed, required, and not able to be hidden by the user?

    I had also added these filters but they had no effect and still allow the order to be submitted if the user was able to hide the “Ship To a Different Address” section.

    add_filter( 'woocommerce_cart_needs_shipping_address',  '__return_true', 50 );
    add_filter( 'woocommerce_order_needs_shipping_address',  '__return_true', 50 );
Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter cqwjds

    (@cqwjds)

    oh, and one more detail – How do I force all ship to address fields to empty? I tried

    add_filter('woocommerce_checkout_fields', 'custom_override_checkout_fields', 999);
    
    function custom_override_checkout_fields($fields)
     {
    	$fields['shipping']['shipping_company']['placeholder'] = ''; 
    	$fields['shipping']['shipping_country']['placeholder'] = ''; 
    	$fields['shipping']['shipping_address_1']['placeholder'] = ''; 
    	$fields['shipping']['shipping_address_2']['placeholder'] = ''; 
    	$fields['shipping']['shipping_city']['placeholder'] = ''; 
    	$fields['shipping']['shipping_state']['placeholder'] = ''; 
    	$fields['shipping']['shipping_postcode']['placeholder'] = ''; 
    	
    	return $fields;
     }

    but it had no effect.

    Plugin Support Gabriel – a11n

    (@gabrielfuentes)

    Hi there ??

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    I can also recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    You can also visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    If you do require more help with the actual coding, we’d recommend you hire a developer who can take a look at this, quote you for their services and help you add this feature to your site. We’d recommend getting in touch with a web developer or one of the customisation experts listed at https://woocommerce.com/customizations/.

    Cheers.

    Plugin Support Gabriel – a11n

    (@gabrielfuentes)

    We’ve not seen any activity on this thread for a while, so I’m marking this thread as resolved.

    Hopefully, you were able to find a solution to your problem! If you have further questions, please feel free to open a new topic.

    Cheers!

    Thread Starter cqwjds

    (@cqwjds)

    No, its not resolved. NO one posted any suggestions or help. Please re-activate.

    Telling someone to go hire someone is not resolving a question/issue, it’s avoiding it. Please leave this active for actual resolution & help.

    • This reply was modified 3 years, 7 months ago by cqwjds.
    Mirko P.

    (@rainfallnixfig)

    Hi there,

    Thanks for getting back.

    Kindly note that this particular forum is for questions that are directly related to the features and functionality of the free core WooCommerce plugin, that does not require any additional custom code to function or integrate.

    For more development-oriented questions like yours, the channels mentioned above are the right ones to get in touch with the developers who are best positioned to help you find a solution.

    Thanks so much for your understanding.

    Thread Starter cqwjds

    (@cqwjds)

    ah, ok, so it’s pretty useless for doing anything real in terms of customizing a site. Guidance for all answers seems to be “go pay someone to do that for you, here’s a referral link we make money off of” . nice an useless site in terms of helping, but i’m sure it makes you money and that’s all you care about. what shame its not actually a useful or helpful site.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    ah, ok, so it’s pretty useless for doing anything real in terms of customizing a site.

    Not at all but this needs addressing.

    Guidance for all answers seems to be “go pay someone to do that for you, here’s a referral link we make money off of” . nice an useless site in terms of helping, but i’m sure it makes you money and that’s all you care about. what shame its not actually a useful or helpful site.

    There are no affiliate links here and you do not need to make accusations to volunteers helping you for free on their own time.

    If this free add-on to WordPress is not working for you then feel free to remove it and find something else.

    I’m closing this topic now as your last reply was confrontational and demonstrates that you’re ready to move on.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How to force Shipping address?’ is closed to new replies.