Question

I started off thinking I could make a little bookmarklet to check the "Notify customer by email" box and then submit a shipment. It should have taken seconds. I've been banging my head against a brick wall for hours! Now it's personal.

Here's what I know:

Checking the "notify customer checkbox is easy enough: $("#send_email").prop('checked',1);

The button tag has this attribute onclick="submitShipment(this)" so I should either be able to trigger the button's click event or call the function directly, passing the button element as the argument. The button can be selected like so: $("button[title='Submit Shipment']")

I've tried all of the following:

  • $("button[title='Submit Shipment']").click();
  • $("button[title='Submit Shipment']").trigger("click");
  • $("button[title='Submit Shipment']")[0].click();
  • $("button[title='Submit Shipment']").onclick();
  • Event.fire($("button[title='Submit Shipment']"),'click');
  • this:

    var evt = document.createEvent("HTMLEvents");
    evt.initEvent('click', true, true ); 
    $("button[title='Submit Shipment']").dispatchEvent(evt);
    
  • and even this:

    $.ajax({
      url:'https://raw.githubusercontent.com/eduardolundgren/jquery-simulate/master/jquery.simulate.js',
        dataType: "script",
        success: function(data, textStatus, jqxhr){
        eval(data);
        $("button[title='Submit Shipment']").simulate("click");
       }
    });
    

I'm all out of ideas! Can anyone help out?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top