Buy Now Button - New Window

I am using the cart as a catalog only and every now and again populating it for external address redirection. I want to know the following:

1) Is there a way to make the button go to a new window ONLY for external links?
2) Is there a way to rename the buttons? The only options I see are Buy Now and Add To Cart...

Ted

  • aecnu

    Greetings Ted,

    Welcome to WPMU Dev!

    1) Is there a way to make the button go to a new window ONLY for external links?

    Not out of the box as my testing has confirmed, and I dug deep trying to figure out which line to add what I believe to be the code for this target="_blank"

    Of course if we custom code this in every update will result in the need to custom code it in again.

    It is my opinion that a radio button giving the option to open it up in a new window would make a great feature request.

    2) Is there a way to rename the buttons? The only options I see are Buy Now and Add To Cart

    The change can be made in the template-functions.php file at around line 1607:

    $button .= '<input class="mp_button_addcart" type="submit" name="addcart" value="' . __('Add To Cart &raquo;', 'mp') . '" />';
    	      } else if ($settings['list_button_type'] == 'buynow') {
    	        $button .= '<input class="mp_button_buynow" type="submit" name="buynow" value="' . __('Buy Now &raquo;', 'mp') . '" />';
    	      }
    	    } else {
    
    	      $button .= $variation_select;
    
    	      //add quantity field if not downloadable
    	      if ($settings['show_quantity'] && empty($meta["mp_file"])) {
    	        $button .= '<span class="mp_quantity"><label>' . __('Quantity:', 'mp') . ' <input class="mp_quantity_field" type="text" size="1" name="quantity" value="1" /></label></span>&nbsp;';
    	      }
    
    	      if ($settings['product_button_type'] == 'addcart') {
    	        $button .= '<input type="hidden" name="action" value="mp-update-cart" />';
    	        $button .= '<input class="mp_button_addcart" type="submit" name="addcart" value="' . __('Add To Cart &raquo;', 'mp') . '" />';
    	      } else if ($settings['product_button_type'] == 'buynow') {
    	        $button .= '<input class="mp_button_buynow" type="submit" name="buynow" value="' . __('Buy Now &raquo;', 'mp') . '" />';

    Please advise if you want me to submit this ticket as a feature request regarding the link opening in a new window or you want to see if I can get the lead devloper in here to possibly hack it in for us?

    Cheers, Joe

  • ted_joffs

    I think it would be sweet to have the target=blank be a feature, so yeah a request would be helpful. I think it would also be wise to have the button rename be in the admin or even rename-able per product post. Just a though. It might also be cool to add in the ability to have the variants each have a unique external link field -- this would help Amazon affiliates and others; like me -- a lot.

    While not "really" resolved. I am marking it such since it is as close as I can get without hacking code files -- so I will take it out of the box. :slight_frown:

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.