So I just added a Buy Now button in my store using this previously answered question: Magento 1.9 How to add buy now button in product page?

Everything works fine, however I'm getting a pop up after pressing the Buy Now button.

It reads:

www.mystore.net says: https://www.mystore.net/checkout/cart/add/uenc/aHR0cHM6Ly93d3cucGI4ZWxtYXJrZXQubmV0L3dhbmQuaHRtbA,,/product/8/form_key/qPvLAuhxmDQklkqt/

Image: https://i.stack.imgur.com/av4aq.png

Is there anyway to just bypass it throwing this message?

Javascript added to app/design/frontend/ultimo/pixel/template/catalog/product/view.pthml:

var productBuyNowForm = new VarienForm('product_addtocart_form');
productBuyNowForm.submit = function (button, url) {
  if (this.validator.validate()) {
    var form = this.form;
    var oldUrl = form.action;
    if (url) {
        form.action = url;

    /* add return Url */
    var inputreturn= document.createElement("input");
    inputreturn.type = "hidden";
    inputreturn.name = "return_url";
    inputreturn.value = "<?php echo Mage::getUrl('checkout/onepage')?>";
    /* add return Url */
    // Append a line break 
    var e = null;
    try {
    } catch (e) {
    this.form.action = oldUrl;
    if (e) {
        throw e;

    if (button && button != 'undefined') {
        button.disabled = true;

Button added to app/design/frontend/ultimo/pixel/template/catalog/product/view/addtocart.phtml:

<button type="button" 
    title="<?php echo $buttonTitle ?>"
    class="button btn-cart" 

1 Answer 1


Remove this line:


It was probably added for debugging and then forgotten to remove.

Tip: Use console.log for debug output to print to the browser console instead of alert

Pro Tip: Every major browser comes with a JavaScript debugger where you can set breakpoints and inspect variables. This is even better than adding debug output to your code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.