![]() |
How to pop up a window.
I'm trying to pop up a window from a product page in the store. Here is the <a> I'm using:
<a href="javascript:void(0);" onClick="window.open('/store/files/images/small/-free-ship.html','mywindow','width=600,height=665')">(Cl ick here for Details)</a> This pops up a window but the window holds the error message: You don't have permission to access /store/files/images/small/-free-ship.html on this server. |
Re: How to pop up a window.
Put the file somewhere other than the files directory, or change the .htaccess in there to 'Allow from All' instead of Deny from all. Also make sure your file is really called -free-ship.html...looks like you might have an extra hyphen in there.
|
Re: How to pop up a window.
Well, when I use the full URL like http://roguewavemarine.com/blah/blah... it will show the window but apparently not when I use the file ref as above.
Maybe there is an easier way? What I want to do is to pop up a little help window from the product page. I want to be able to show the contents of one of the $config values in the window. Do you know of any "built-in" way to do this? Or an easy way? |
Re: How to pop up a window.
Tough to show the variables in there without making it a php file and calling smarty and all of the associated X-Cart stuff.
|
Re: How to pop up a window.
This describes how to use an existing facility to add popup windows as needed to your store.
In the directory store/skin1/help there are several popups as a standard part of X-Cart. They are named like hlp_XXXX.tpl. You should create a new file in this directory replacing the "XXXX" in the name with something appropriate to your application. For example I created a file hlp_freeship.tpl to explain to the customer the details of our free shipping offer. You should add only letters and numbers - no underscores etc. (except for the underscore after the "hlp"). This tpl file will be processed by Smarty and can contain anything that a normal tpl file can contain. After adding your code and/or HTML to the file all you have to do is set up a link where you want the customer to be able to invoke the popup. To do this use this as a template: Code:
<A href="javascript: void(0);" onclick="javascript: window.open('popup_info.php?action=XXXXX','YYYYY','width=600,height=460,toolbar=no,status=no,scrollbars=yes,resizable=no,menubar=no,location=no,direction=no');" >ZZZZZ</A> You'll need to change the XXXXX to invoke the correct hlp tpl file. For the example above it would be set to "freeship" which will cause the hlp_freeship.tpl file to be invoked. Change the YYYYY to the popup page title. Change the ZZZZZ to the text that the customer will see. This a normal <a> link so you can put other things in for the customer to see. ADDITIONAL INFO: I've put the following at the top of my hlp_freeship.tpl to get some config and cart values to display in the popup: Code:
{php} All this does is make all of the $cart and $config values available to Smarty. Then in the HTML of the tpl file you can drop in a Smarty reference like Code:
${config.Shipping.freeshipthreshold} or any other $config or $cart value. (freeshipthreshold is our value, you won't have one of these). This all depends on what php values are available at the time of your popup. It is context sensitive. I'm not a Smarty expert so there may be a better way to do this, but this works. |
Re: How to pop up a window.
Thanks for your mod to open a pop up window.
I have implemented what you have suggested and can get the popup to open but it tells me " the file does not exist or you do not have permission to access the file " - the file is in the right location - could this be something to do with .htaccess?. Any help would be greatly appreciated. Thanks. |
Re: How to pop up a window.
any clues ??? to this one.. Thanx
|
Re: How to pop up a window.
Hi,
Did you get this resolved Jay77 ? |
Re: How to pop up a window.
A very useful method - thank you willirl.
It works good for what I want to use it for, that is, to save writing duplicate content. I would really appreciate some clarification regarding the method you used. For example :- Where does the page title (YYYYY) come into play? What is the benefit of the php code you included? I am VERY new to this. Could I prevail upon you to explain in more detail how this php code would work, a real life example would be truly appreciated. Is it possible to use different text file content for the hlp_XXXX.tpl or do I have to use different hlp_XXXX.tpl files for each product page. That is, can I use prod01.txt for hlp_prod.tpl then use prod02.txt in hlp_prod.tpl for another product. Hope I made myself clear! Once again, thank you for a very useful methodology. Regards |
Re: How to pop up a window.
The page title is the text that is shown in the browser title bar when the page pops up. Also shown in tab if you are using tabbed browsing.
The php just makes the cart and config values available in Smarty on the popped up page so you can show the user something from the cart. (if you want to). I think that the second assign should be Code:
$this->assign("config", $config); |
Re: How to pop up a window.
Thank you for the clarification willirl - it is appreciated.
I substituted 'Specifications' for 'YYYYY' but it didn't show in the page title but that is a minor thing that I am not really concerned about. I apologise for taking up your time but in your opinion is there a method whereby I can create a global text variable ($prod_spec for example) then assign different texts to this varaible, enabling me to use the variable for the same hlp_XXXX.tpl. If not then it appears my solution is to create more hlp_XXXX.tpl files, each one having different text. Thanks once again for the method and for your reply. Regards |
Re: How to pop up a window.
I'm not sure how you would do this.
|
Re: How to pop up a window.
Quote:
I was barking up the wrong tree. What I finished up doing was to create a pop-up window called hlp_productlink.tpl, then created several text variables in Admin called txt_prod_speci_001, txt_prod_speci_002 etc. Within hlp_productlink.tpl I then called the appropriate text. For example, {$lng.txt_prod_speci_001} or {$lng.txt_prod_speci_002} and so on. However, having done that, I can't help thinking there must be a better way. Regards |
Re: How to pop up a window.
Greetings,
I've followed these instructions and still get an error in the popup window: Page not found! The requested page does not exist or you are not allowed to access it! I've changed the .htaccess to allow for all. Is there any other suggestions? Does it matter that I need the pop up window on my checkout page but it seems like the help files are unsecure? I've searched for the cvv2_tpl link ( so that maybe I could duplicate it) as that popup works fine. Thanks so much! |
Re: How to pop up a window.
I'm not sure what's wrong but I think you're on the right track. I don't have any experience with http vs. https. Perhaps someone else here might be able to help.
|
Re: How to pop up a window.
Hi,
Thanks jgilford, I have seen your site www.junkyjewelry.com, it is very beautiful. I have tried adding some JavaScript popup code in product thumbnail in the products page that would open a small window/popup for additional information or small information /description about product on mouseover (like your site which shows Zoom image).Ideally it should take info from the detailed description field (product page) and show in this popup. Searched the forum but couldnâ–“t find the post/thread on this.Can you help me to do this code or any hints. Is it possible to show a product description/small description in a small popup? Any help/inputs on this would be highly appreciated. |
Re: How to pop up a window.
If you're getting the
Quote:
message, you need to make sure that the hlp_XXXX.tpl files you're creating are all lowercase. You'll see in includes/popup_info.php there is this line of code: PHP Code:
|
Re: How to pop up a window.
Quote:
I am having the same message, files are in lower case. Did somebody get this working? |
All times are GMT -8. The time now is 08:02 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.