Catalog Mode: How to get 'buy now' link to open new window?

My store is in catalog mode. The the user clicks the buy now button, it takes them to the url that I set. I would that link to open in a new window.



This is the code in the add-on/catalog_mode/hooks/buttons/add-to-cart-override.tpl :



{if ‘’|fn_catalog_mode_enabled == ‘Y’}

{if $product.buy_now_url != ‘’}

{include file=“buttons/button.tpl” but_id=$but_id but_text=_(“buy now”) but_href=$product.buy_now_url but_role=$but_role|default:“text” but_name=“”}

{elseif $addons.catalog_mode.add_to_cart_empty_buy_now_url != ‘Y’}

 

{/if}

{/if}







I don’t know where (if this is the place) to modify. I know the html will be target=“_blank” Do you know where I place it - or how to accomplish goal? Thanks

This is the file buttons/button.tpl under the template folder depends on your cs-cart version.

[quote name='cscartrocks' timestamp='1386086891' post='172818']

This is the file buttons/button.tpl under the template folder depends on your cs-cart version.

[/quote]



I took a look at that too… any help on where I put the code? ( target=“blank" )

Here is the buttons/button.tpl code for reference:



{if $but_role == “action”}

{assign var=“suffix” value=“-action”}

{assign var=“file_prefix” value="action
”}

{elseif $but_role == “act”}

{assign var=“suffix” value=“-act”}

{assign var=“file_prefix” value=“action_”}

{elseif $but_role == “disabled_big”}

{assign var=“suffix” value=“-disabled-big”}

{elseif $but_role == “big”}

{assign var=“suffix” value=“-big”}

{elseif $but_role == “delete”}

{assign var=“suffix” value=“-delete”}

{elseif $but_role == “tool”}

{assign var=“suffix” value=“-tool”}

{else}

{assign var=“suffix” value=“”}

{/if}



{if $but_name && $but_role != “text” && $but_role != “act” && $but_role != “delete”} {* SUBMIT BUTTON }





{elseif $but_role == “text” || $but_role == “act” || $but_role == “edit”} {
TEXT STYLE }

{$but_text}



{elseif $but_role == “delete”}







{elseif $but_role == “icon”} {
LINK WITH ICON }

{$but_text}



{else} {
BUTTON STYLE *}



{$but_text}

{/if}







Thanks

Hi,

You need to edit file [color=#ff0000]design/themes/[THEME_NAME]/templates/addons/catalog_mode/hooks/buttons/add_to_cart.override.tpl, [/color]add [color=#ff0000]but_target=“_blank”[/color] into [color=#ff0000]{include file=“buttons/button.tpl” …}[/color]



Final code
{if ''|fn_catalog_mode_enabled == 'Y'}
{if $product.buy_now_url != ''}
{include file="buttons/button.tpl" but_id=$but_id but_text=__("buy_now") but_href=$product.buy_now_url but_role=$but_role|default:"text" but_name="" but_target="_blank"}
{elseif $addons.catalog_mode.add_to_cart_empty_buy_now_url != 'Y'}
 
{/if}
{/if}




I hope that helps,





Valentin

[color=#808080][size=2]part of hungryweb.net[/size][/color]

Thank you so much Valentin! Its works perfectly :)

You are welcome!