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

Pop up for CVV2 definition - need help

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 04-07-2004, 04:51 PM
 
webman webman is offline
 

Newbie
  
Join Date: Mar 2004
Posts: 5
 

Default Pop up for CVV2 definition - need help

I am trying to make a popup page that describes where to find the CVV2 code on one's credit card. However, I'm having trouble because I can't put the <script></script> html in the page header without the template deleting itself.

Can anyone suggest a way to create a simple popup page?

I'm using the latest version 3.5.x

Thanks!
Reply With Quote
  #2  
Old 04-07-2004, 05:25 PM
  TelaFirma's Avatar 
TelaFirma TelaFirma is offline
 

X-Adept
  
Join Date: Nov 2002
Location: North Carolina USA
Posts: 930
 

Default

Enclose them in {literal} tags.. such as:

Code:
{literal} <script></script> {/literal}
This will prevent Smarty from parsing the script.
Reply With Quote
  #3  
Old 04-07-2004, 06:27 PM
 
webman webman is offline
 

Newbie
  
Join Date: Mar 2004
Posts: 5
 

Default

I tried that but it still didn't work. Probably because I suck at writing javascript. I'll keep trying.

Thanks!
Reply With Quote
  #4  
Old 04-13-2004, 01:10 PM
 
g0t0pless g0t0pless is offline
 

eXpert
  
Join Date: Jul 2003
Posts: 360
 

Default

How would you just add the text to the page. without it being any kind of popup?

I'd be happy if it was just noted below the field.
Reply With Quote
  #5  
Old 04-19-2004, 10:38 AM
 
webman webman is offline
 

Newbie
  
Join Date: Mar 2004
Posts: 5
 

Default

thanks!

I just ended up adding a page describing where to find the CVV2 that opens in a new window.
Reply With Quote
  #6  
Old 05-20-2004, 11:19 AM
  minorgod's Avatar 
minorgod minorgod is offline
 

X-Adept
  
Join Date: Sep 2002
Location: Arivaca, AZ
Posts: 402
 

Default

Ah...an easy one. All curly braces in your script must be enclosed in smarty {literal} tags to keep smarty from mistaking the javascript braces as smarty template tags. I usually just enclose the whole script in literal tags unless I need to substitute smarty variables into the actual javascript. So it would look like this in your template.
Code:
{literal} <SCRIPT language=JavaScript1.2> <!-- function popup_cvv2_instructions(product_id) { var w = "420"; //width of popup window var h = "420"; //height of popup window.open('/path/to/cvv2/instructions.html',"cvv2 help window","width="+w+",height="+h+",resizable,scrollbars=yes"); } --> </SCRIPT> {/literal}
Then on your link or button you want to use to open the window, you'd do this:
Code:
or you could put the exact same syntax from the above href into an onClick event for a button or whatever.
__________________
www.brettbrewer.com
Getting back into x-cart dev after a long hiatus. Modded lots of x-carts from version 3.1.x to 4.1.x. Developer of ImageScaler mod, Pre-login per user coupon mod, Wordpress feed mod, DigitalSubscriptions mod, Phonetic bulk download keys addon for DownloadExpander mod, Serial Number Generator for ESD products, Custom CMS/LMS integrations, external products mod, and more.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 11:24 AM.

   

 
X-Cart forums © 2001-2020