1

I have a client requirements to hide 'billing section' of wrodpress checkout page when choose 'bitpay payment method' since bitpay doesn't demand the billing section. I tried lot but as the payment methods come through API, I couldn't hook the id/selector of radio button. I don't know how to sort it out. Expert's please pay ur kind attention.

enter image description here

code stuffs :

html:

<div class="woocommerce-billing-fields">
.....
</div>

<li class="payment_method_bitpay">
    <input id="payment_method_bitpay" class="input-radio" name="payment_method" value="bitpay" checked="checked" data-order_button_text="Proceed to BitPay" type="radio">

    <label for="payment_method_bitpay">
        Bitcoin <img src="http://localhost/wp/wp-content/plugins/bitpay-for-woocommerce/assets/img/icon.png" alt="Bitcoin"> </label>
            <div class="payment_box payment_method_bitpay">
            <p>You will be redirected to bitpay.com to complete your purchase.</p>
        </div>
</li>

js:

jQuery(document).ready(function($){
        $('#payment_method_bitpay').on('click',function(){
            $('.woocommerce-billing-fields').hide();
        })
})
Wahidul Alam
  • 1,216
  • 4
  • 26
  • 56
  • Can you post some code that highlights what you want to hide - do you want to hide the other payment methods or some content following the Bitcoin payment selection? – Jayx Apr 01 '15 at 19:43
  • yes .. you know in checkout page there are billing section, I have to hide 'billing section' following the Bitcoin payment selection. Code stuffs are simple u know, just hook the selector and on click/on change hide a div.But i cant select the selector. jQuery(document).ready(function($){ $('#payement_method_bitpay').on('click',function(){ $('.billing-section').hide(); }) }) – Wahidul Alam Apr 01 '15 at 19:47
  • The jQuery you pasted only explains what doesn't work - can you please add the HTML (at least) to your question (i.e.: edit your question). If the content follows the radio button directly, it might even be possible to hide it without using JavaScript, but no-one can answer your question or guess their way through it without the HTML - maybe add your JavaScript to the question as well so that users can help debug. – Jayx Apr 01 '15 at 19:53
  • thanks @Jayx I am editing, please keep ur eyes on it – Wahidul Alam Apr 01 '15 at 20:05
  • Just an opinion here but it seems counter-intuitive since the users are filling out their billing information *before* they reach the option to choose Bitcoin as an option to pay. Customers will be filling out the billing information regardless since that will be shown first before selecting Bitcoin. Also important to note here that PayPal does not require any billing information from WooCommerce either. – Michael Apr 03 '15 at 17:01
  • Sometimes clients demand wired , they became weird :P .. – Wahidul Alam Apr 03 '15 at 18:18

0 Answers0