0

I added a picture to a shipping method which opens in a lightbox (thanks to @LoicTheAztec Custom Flat Rate Description Text in Woocommerce checkout page ).

The Lightbox is working as long as I don't change the shipping class with the radio buttons. After If I choose another Woocommerce shipping class on cart page (WC loader shows up and site becomes white) the picture won't open in my lightbox. The same happens on checkout page. When the checkout page is loading the payment gateways I got the same problem, the lightbox is not working

Would be great if someone can tell me why is this happening. Why is my javascript stop working, after the Woocommerce loading happend :-/.

Thank you all in advance :).

Tob S
  • 43
  • 6
  • 1
    I have tested again my answer code and it works perfectly without any problem. So if you have changed the code, you should provide it in your question as nobody can guess what is wrong… – LoicTheAztec Oct 24 '18 at 14:19
  • Hi Loic. Maybe it was a little confusing. The problem is regarding my lightbox and loading the javascript for it. I'm using your code (the image is displayed, but the lightbox effect isn't working all the time). add_action( 'woocommerce_after_shipping_rate', 'action_after_shipping_rate', 20, 2 ); function action_after_shipping_rate ( $method, $index ) { if( is_cart() || is_checkout ) return; if( 'flat_rate:1' === $method->id ) { echo __(""); } } Lightbox stops loading after choose another shipping class. – Tob S Oct 24 '18 at 16:46
  • Don't use code in comment zone, Update your question instead please as it's not readable. So this is related to your lightbox and not to my code. You should add the necessary code in your question. Please remember that "*Questions seeking debugging help must include the desired behavior, a specific problem or error **and the shortest code necessary to reproduce it in the question itself**"*. – LoicTheAztec Oct 24 '18 at 17:00

0 Answers0