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)
-   -   Adding Login Popup to Descriptions (https://forum.x-cart.com/showthread.php?t=59018)

mizNRG 04-22-2011 06:08 AM

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

vasilis 04-23-2011 07:58 AM

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.

mizNRG 04-25-2011 11:43 AM

Re: Adding Login Popup to Descriptions
 
1 Attachment(s)
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.

vasilis 04-25-2011 11:49 PM

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>

mizNRG 04-26-2011 10:43 AM

Re: Adding Login Popup to Descriptions
 
That worked perfectly! Thank you!

upupcreative 07-04-2011 04:57 PM

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

vasilis 07-05-2011 11:04 AM

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>

mizNRG 07-20-2011 10:26 AM

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?

vasilis 07-25-2011 04:09 AM

Re: Adding Login Popup to Descriptions
 
can you provide an example link?

cflsystems 07-25-2011 04:21 AM

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?

mizNRG 08-02-2011 12:21 PM

Re: Adding Login Popup to Descriptions
 
I applied a patch to correct the Bill To/Ship To issue - https://bugtracker.qtmsoft.com/view.php?id=38558.

Other than that, no.

JoeS 08-21-2011 04:36 AM

Re: Adding Login Popup to Descriptions
 
Quote:

Originally Posted by vasilis
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>


Can you please advise where to insert the code, do I insert it into home.tpl? I need a popup box on the home page to make visitors aware of a new product, so they can either click on it to go to the product page, or simply close it and stay on home page, thanks for your help.

vasilis 08-21-2011 05:36 AM

Re: Adding Login Popup to Descriptions
 
where in the home page do you need the new product link inserted? Different nested template files are engaged in the home page, regarding the specific place you want it.

JoeS 08-21-2011 06:00 AM

Re: Adding Login Popup to Descriptions
 
Well, I am not after a link on the home page, I am looking to integrate a popup box that apears on site visit, it is to advertise a new product. Can you help? Thanks

JWait 08-21-2011 10:21 AM

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?


I don't know why it would have worked fine previously, it probably shouldn't have. Let me explain... Some time ago I was working on moving the login box from the left menu to the header in an older version of x-cart. I started by copying the menu login box to the header and when I tried to use it I got the same "wait" state as you did. Once I removed the login box from the menu however everything worked fine.

It seems you can not have two instances of the login box on the same page. Just the fact that all checkout options x-cart has use a separate header and remove the menus form checkout pages reinforces this.

Its possible that the login popup and the "normal" login are "technically" on the same page.... just some thoughts.

vasilis 08-22-2011 12:59 AM

Re: Adding Login Popup to Descriptions
 
Maybe, it is a case of using two instances of a specific id named control in the same web page, something that is irregular for html coding....

Regarding the popup window displaying when the home page loads, you just place the popup window code without using any function and link, e.g. something like:

Code:


<script language="JavaScript">
<!--
window.open('new_product_url','windowname',' height='320,width=320,scrollbars,resizable');
// -->
</script>


You could place this code for example, inside the welcome.tpl template file, so it will execute only when your home page first loads.

mizNRG 08-22-2011 05:41 AM

Re: Adding Login Popup to Descriptions
 
Quote:

Originally Posted by JWait
I don't know why it would have worked fine previously, it probably shouldn't have.

Its possible that the login popup and the "normal" login are "technically" on the same page.... just some thoughts.


I figured out what was causing the issue w/ my popup. At some point after adding the coding I changed the login settings from HTTP to HTTPS. It didn't even occur to me that I needed to change the code to match. Such a silly oversight caused way too much frustration. Glad to have it fixed finally.


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

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