Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Custom Button in Cart

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 02-11-2009, 05:55 PM
 
1day2004 1day2004 is offline
 

Senior Member
  
Join Date: Dec 2004
Posts: 115
 

Default 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
__________________
Version 4.0.8 Live
Reply With Quote
  #2  
Old 02-11-2009, 09:58 PM
  Vetrivel's Avatar 
Vetrivel Vetrivel is offline
 

eXpert
  
Join Date: Apr 2008
Posts: 398
 

Default 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
Reply With Quote
  #3  
Old 02-12-2009, 03:43 PM
 
1day2004 1day2004 is offline
 

Senior Member
  
Join Date: Dec 2004
Posts: 115
 

Default Re: Custom Button in Cart

Thanks for the suggestion.

I'll give it a try.
__________________
Version 4.0.8 Live
Reply With Quote
  #4  
Old 02-13-2009, 02:06 AM
  Yurij's Avatar 
Yurij Yurij is offline
Banned
 

X-Adept
  
Join Date: Jan 2008
Posts: 486
 

Default 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}
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 12:22 AM.

   

 
X-Cart forums © 2001-2020