X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Custom Button in Cart (https://forum.x-cart.com/showthread.php?t=45510)

1day2004 02-11-2009 05:55 PM

Custom Button in Cart
 
I have a product which requires a button in place of one of its option values in the shopping cart. The button is supposed to open a pop-up window which is linked to the original option value.

I created the button and everything is fine except the value ($v.option_name) is not inserted into the link.

The link is opening as http ://www.website/view.php?name=

It should open as http ://www.website/view.php?name=banner.option.should.be.here

Code:

{if $k eq 10403 or $k eq 31132 or $k eq 31139 or $k eq 31146 or $k eq 31153}
{include file="buttons/button.tpl" href="javascript:window.open('../view.php?name=$v.option_name','Banner','width=590,height=450,toolbar=no,status=no,scrollbars=yes,resizable=no,menubar=no,location=no,direction=no');" button_title="View Design" style="button"}
{else}
{$v.option_name}
{/if}


Anyone have any ideas why it's working?

Thanks

Vetrivel 02-11-2009 09:58 PM

Re: Custom Button in Cart
 
Try this
Code:

{if $k eq 10403 or $k eq 31132 or $k eq 31139 or $k eq 31146 or $k eq 31153}
{include file="buttons/button.tpl" href="javascript:window.open('../view.php?name={$v.option_name}','Banner','width=590,height=450,toolbar=no,status=no,scrollbars=yes,resizable=no,menubar=no,location=no,direction=no');" button_title="View Design" style="button"}
{else}
{$v.option_name}
{/if}


Quote:

Originally Posted by 1day2004
I have a product which requires a button in place of one of its option values in the shopping cart. The button is supposed to open a pop-up window which is linked to the original option value.

I created the button and everything is fine except the value ($v.option_name) is not inserted into the link.

The link is opening as http ://www.website/view.php?name=

It should open as http ://www.website/view.php?name=banner.option.should.be.here

Code:

{if $k eq 10403 or $k eq 31132 or $k eq 31139 or $k eq 31146 or $k eq 31153}
{include file="buttons/button.tpl" href="javascript:window.open('../view.php?name=$v.option_name','Banner','width=590,height=450,toolbar=no,status=no,scrollbars=yes,resizable=no,menubar=no,location=no,direction=no');" button_title="View Design" style="button"}
{else}
{$v.option_name}
{/if}


Anyone have any ideas why it's working?

Thanks


1day2004 02-12-2009 03:43 PM

Re: Custom Button in Cart
 
Thanks for the suggestion.

I'll give it a try.

Yurij 02-13-2009 02:06 AM

Re: Custom Button in Cart
 
You have to access to variable value in Smarty as {$variable_name}, so in your case URL should be: ../view.php?name={$v.option_name}


All times are GMT -8. The time now is 04:36 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.