Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter roadpaperweight

    (@roadpaperweight)

    I just made the change I needed by adding the field ID and commenting out // this.appendStreetNumber();

    I can try to make a more generalized solution but I won’t have time before new years.

    I would think you could just add to the settings page a check box “if you need to separate the street number from the street name, check here”
    Have a field that says “please enter the ID of the street number field. Set it to option, hook in before WC billing fields and put a hidden field with the option (which will be false if it doesn’t exist/isn’t active).

    Then just If((“#id”).val) the ID of the hidden field and use the data as needed. I am really not great at JS, but I think it should be pretty straight forward to add this in. The php part is simple and I more or less understand your js, so I think it shouldn’t be that hard 🙂

    I think these were all the changes I made to the JS file. It is working for me.

    line 20 I added: ‘billing_street_number’: ”,
    line 30 I added: ‘billing_street_number’: ”,
    line 85 changed to: ‘street_number’: [‘billing_street_number’, ‘short_name’],

    line 98 changed to: ‘street_number’: [‘billing_street_number’, ‘short_name’],

    line 148 commented out: // this.appendStreetNumber();

    Sure. There a a few things you need for this to work.

    1. There must be a popbox button for your desired popbox somewhere on the page. It doesn’t have to be visible to the user, but it must exists.

    2. You need to know the selectors of the popbox button.

    3. You need to know the selector of the image you want to use.

    4. You need to be able to add JS/Jquery to your website. It can be with a plugin or, depending on your theme, there may be a place to include it.

    If you aren’t sure how to do this, add the popbox button to the bottom of your screen. In the advanced section of the popbox elementor widget, give the popbox button a css ID.

    For the image you want to use, go to that elementor widget’s advanced section and give it a CSS ID as well.

    You also want to give your image a link so the cursor shows that it is clickable, http://www.mysite.com/# will do.

    Then it’s just Jquery.

    (function($) {

    $(document).ready(function(){

    $(“#cssSelectorForYourImage”).click(function(){
    event.preventDefault();
    $( “#cssSelectorForYourPopBoxButton > div > div.elementor-button-wrapper > a” ).trigger( “click” );
    })

    });

    }(jQuery));

    I wanted to target the a in my popbox button. That is probably what you want to do as well. for me, the selector looked like this #cssSelectorForYourPopBoxButton > div > div.elementor-button-wrapper > a

    After you get it working, if you don’t want the button to be seen by users, give your popbox button a z-index of zero and move it up behind your slider or some other big element on your site.

    I got it working under a specific set of circumstances.

    Check my answer here.

    https://ww.wp.xz.cn/support/topic/how-to-customize-the-way-it-pops-from-a-menu-entry/#post-10605151

    If that situation doesn’t work for you, message back what you are trying to do.

    Hey. I just got this working. It works because I have “schedule an appointment” and “contact us” buttons elsewhere on the page. What you need to do is add some jquery to stop the click event from the menu and then simulate a click even on the button/popbox you want.

    This is the code I used for both menu links. I assigned IDs for the popbox buttons under the advanced tab so my selectors were reasonable. I would assume that this would work even if you hid the buttons off screen or under a slider/picture/whatever.

    (function($) {
    $(document).ready(function(){
    $(“.menu-item-266”).click(function(){
    event.preventDefault();
    $( “#scheduleAppointmentButton > div > div.elementor-button-wrapper > a” ).trigger( “click” );
    })

    $(“.menu-item-267”).click(function(){
    event.preventDefault();
    $( “#contactUsButton > div > div.elementor-button-wrapper > a” ).trigger( “click” );
    })
    });
    }(jQuery));

    Thread Starter roadpaperweight

    (@roadpaperweight)

    Link

    milanospizza.cl/checkout/order-received/2495/?key=wc_order_5aee0aa80d0e1

Viewing 5 replies - 1 through 5 (of 5 total)