| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
How to pop up a window. | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
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. |
|||||||
#2
|
|||||||
|
|||||||
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.
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#3
|
|||||||
|
|||||||
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? |
|||||||
#4
|
|||||||
|
|||||||
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.
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#5
|
|||||||
|
|||||||
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:
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:
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:
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. |
|||||||
#6
|
|||||||
|
|||||||
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.
__________________
Version 4.1.6 |
|||||||
#7
|
|||||||
|
|||||||
Re: How to pop up a window.
any clues ??? to this one.. Thanx
__________________
Version 4.1.6 |
|||||||
#8
|
|||||||||
|
|||||||||
Re: How to pop up a window.
Hi,
Did you get this resolved Jay77 ?
__________________
Version = X-Cart 4.1.3 Gold Status - Closed Addon: Magnifier OS = Windows Western Australia |
|||||||||
#9
|
|||||||||
|
|||||||||
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
__________________
Version = X-Cart 4.1.3 Gold Status - Closed Addon: Magnifier OS = Windows Western Australia |
|||||||||
#10
|
|||||||||
|
|||||||||
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:
__________________
Richard Williams Rogue Wave Limited Initial Inventory Imports Daily Inventory Updates Daily Inventory Reports Drop Ship Support Order Export to Shipper/Supplier Shopping Feeds That Work Programming for X-Cart richard@roguewavelimited.com http://www.roguewavelimited.com |
|||||||||
|
|||
X-Cart forums © 2001-2020
|