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

Adding Login Popup to Descriptions

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 04-22-2011, 06:08 AM
  mizNRG's Avatar 
mizNRG mizNRG is offline
 

Senior Member
  
Join Date: Jun 2010
Posts: 157
 

Default Adding Login Popup to Descriptions

I have a few products that require customers to login to view special prices based on membership levels. Ideally, I'd like to include a message like: "Login to view Special Dealer Pricing" with a link that will open up the login popup window so they can login without leaving the product description. I'm sure this is possible - I even think I saw something on here regarding something similar. If someone could help me out with this I would really appreciate it.

Thanks,
Mel
__________________
X-Cart 4.4.4 Gold
Reply With Quote
  #2  
Old 04-23-2011, 07:58 AM
  vasilis's Avatar 
vasilis vasilis is offline
 

X-Adept
  
Join Date: Feb 2009
Posts: 761
 

Default Re: Adding Login Popup to Descriptions

you could insert a link in the product description with URL "http://<your_domain>/login.php" and embed this in the text you want: e.g. if you use the plain text editor in your product description, the inserted code could be:
Code:
<a href="http://<your_domain>/login.php">Login to view Special Dealer Pricing</a>
where you replace "<your_domain>" with your domain. If x-cart is installed under a directory then you use:
Code:
<a href="http://<your_domain>/xcart_root_dir/login.php">Login to view Special Dealer Pricing</a>
where "xcart_root_dir" is the name of the directory your x-cart is installed under.
__________________
Vasilis Vrontisis
X-Cart Development, Maintenance & Customization
https://[URL="http://www.craftforweb.com"]craftforweb.com[/url]
vasilis@craftforweb.com
Reply With Quote
  #3  
Old 04-25-2011, 11:43 AM
  mizNRG's Avatar 
mizNRG mizNRG is offline
 

Senior Member
  
Join Date: Jun 2010
Posts: 157
 

Default Re: Adding Login Popup to Descriptions

Thanks, but I've tried that and it doesn't give me the popup window. Instead it brings me to the static page. I would like to have the login popup window appear so that they aren't redirected away from the product that they are viewing. When you login on the home page it brings up the popup, however I can't figure out where that code is to copy it.
Attached Thumbnails
Click image for larger version

Name:	LoginPopup.jpg
Views:	304
Size:	119.9 KB
ID:	2555  
__________________
X-Cart 4.4.4 Gold
Reply With Quote
  #4  
Old 04-25-2011, 11:49 PM
  vasilis's Avatar 
vasilis vasilis is offline
 

X-Adept
  
Join Date: Feb 2009
Posts: 761
 

Default Re: Adding Login Popup to Descriptions

Sorry, I didn't notice that you referred to a popup window.

try:
Code:
<a onclick="javascript: return !popupOpen('login.php');" title="Login to view Special Dealer Pricing" href="http://<your_domain>/login.php">Login to view Special Dealer Pricing</a>

or

Code:
<a onclick="javascript: return !popupOpen('login.php');" title="Login to view Special Dealer Pricing" href="http://<your_domain>/<xcart_root_dir>/login.php">Login to view Special Dealer Pricing</a>
__________________
Vasilis Vrontisis
X-Cart Development, Maintenance & Customization
https://[URL="http://www.craftforweb.com"]craftforweb.com[/url]
vasilis@craftforweb.com
Reply With Quote
  #5  
Old 04-26-2011, 10:43 AM
  mizNRG's Avatar 
mizNRG mizNRG is offline
 

Senior Member
  
Join Date: Jun 2010
Posts: 157
 

Default Re: Adding Login Popup to Descriptions

That worked perfectly! Thank you!
__________________
X-Cart 4.4.4 Gold
Reply With Quote
  #6  
Old 07-04-2011, 04:57 PM
 
upupcreative upupcreative is offline
 

Advanced Member
  
Join Date: Aug 2010
Posts: 66
 

Default Re: Adding Login Popup to Descriptions

does this only work if you're linking to a .php file? i'm trying to link to a .gif file (i want to have a color chart that pops up) but i get an error.

thanks,
julie
__________________
Version 4.4.2
Reply With Quote
  #7  
Old 07-05-2011, 11:04 AM
  vasilis's Avatar 
vasilis vasilis is offline
 

X-Adept
  
Join Date: Feb 2009
Posts: 761
 

Default Re: Adding Login Popup to Descriptions

the popupOpen Javascript function opens a popup window with a form and this form has it's action set to the 'login.php' script, ie when submitted, the 'login.php' script is run with passed parameters the input user name/email and password of the logged in user. So, the function expects a php script for an argument (inserted in the parenthesis).

You could insert a Javascript function that opens a popup window, something like:
Code:
var newwindow; function popupwin(url) { newwindow=window.open(url,'name','height=400,width=200'); if (window.focus) {newwindow.focus()} }
where 'url' is your image file url and then insert the anchor code anywhere in your page:

Code:
<a href="javascript: popupwin('your_domain/path_to_image/image_name');">Pop it</a>
__________________
Vasilis Vrontisis
X-Cart Development, Maintenance & Customization
https://[URL="http://www.craftforweb.com"]craftforweb.com[/url]
vasilis@craftforweb.com
Reply With Quote
  #8  
Old 07-20-2011, 10:26 AM
  mizNRG's Avatar 
mizNRG mizNRG is offline
 

Senior Member
  
Join Date: Jun 2010
Posts: 157
 

Default Re: Adding Login Popup to Descriptions

Up until recently, the login pop-up window worked fine. Now, when you try to log in using the pop-up it just sits there the the "Please Wait" message after you click on Submit. The regular login on the right hand side works, though. Does anyone know what could be causing this?
__________________
X-Cart 4.4.4 Gold
Reply With Quote
  #9  
Old 07-25-2011, 04:09 AM
  vasilis's Avatar 
vasilis vasilis is offline
 

X-Adept
  
Join Date: Feb 2009
Posts: 761
 

Default Re: Adding Login Popup to Descriptions

can you provide an example link?
__________________
Vasilis Vrontisis
X-Cart Development, Maintenance & Customization
https://[URL="http://www.craftforweb.com"]craftforweb.com[/url]
vasilis@craftforweb.com
Reply With Quote
  #10  
Old 07-25-2011, 04:21 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: Adding Login Popup to Descriptions

Quote:
Originally Posted by mizNRG
Up until recently, the login pop-up window worked fine. Now, when you try to log in using the pop-up it just sits there the the "Please Wait" message after you click on Submit. The regular login on the right hand side works, though. Does anyone know what could be causing this?
Have you made any changes to cart - upgraded cart or upgraded jquery?
__________________
Steve Stoyanov
CFLSystems.com
Web Development
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 01:50 AM.

   

 
X-Cart forums © 2001-2020