Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Creating a New Page to Popup Can't Be This Complicated??

Creating a New Page to Popup Can't Be This Complicated??

Locked

Views: 5,430

Results 1 to 20 of 22
This thread is locked. New replies are disabled.
8 Oct 2008, 7:18 PM
#1
laurenjj avatar

laurenjj

New Zenner

Join Date:
Sep 2008
Posts:
80
Plugin Contributions:
0

Creating a New Page to Popup Can't Be This Complicated??

I've been searching and searching for an answer to what I thought would be a simple one... I've found bits and pieces around random threads but before I start altering 10 different files, I want to make sure I need to.

What I want is basic...I thought...I want to have, say on a clothing product page, a link to a new page that opens via popup with sizing information. Now my first problem is that I can't for the life of me figure out where to set how big the popup page is because currently, when you click on say the 'coupon_help_page' the window opens incredibly small. So I thought rather than trying to dig and find where that javascript was, I'd just upload a new js file in the jscript folder which had a new js function. This didn't work. The function is not being called.

I'm knocking my head against walls here...:frusty:

8 Oct 2008, 10:41 PM
#2
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: Creating a New Page to Popup Can't Be This Complicated??

laurenjj:

I've been searching and searching for an answer to what I thought would be a simple one... I've found bits and pieces around random threads but before I start altering 10 different files, I want to make sure I need to.

What I want is basic...I thought...I want to have, say on a clothing product page, a link to a new page that opens via popup with sizing information. Now my first problem is that I can't for the life of me figure out where to set how big the popup page is because currently, when you click on say the 'coupon_help_page' the window opens incredibly small. So I thought rather than trying to dig and find where that javascript was, I'd just upload a new js file in the jscript folder which had a new js function. This didn't work. The function is not being called.

I'm knocking my head against walls here...:frusty:

The attached file contains the basic files/folders you would need to create a popup.

In addition to these files you also need the following (or similar) placed where you want to call the window from.

<?php echo '<a href="javascript:popupWindow(\'' . zen_href_link(FILENAME_POPUP_LINKS_HELP) . '\')">' . zen_image_button(BUTTON_IMAGE_LINK_HELP, BUTTON_LINK_HELP_ALT) . '</a>'; ?>

[Attachment no longer available]

9 Oct 2008, 2:03 PM
#3
afo avatar

afo

Totally Zenned

Join Date:
Aug 2004
Location:
New York City
Posts:
6,800
Plugin Contributions:
0

Re: Creating a New Page to Popup Can't Be This Complicated??

Clyde should have put that php snippet in code tage to avoid the smilie.

<?php echo '<a href="javascript:popupWindow(\'' . zen_href_link(FILENAME_POPUP_LINKS_HELP) . '\')">' . zen_image_button(BUTTON_IMAGE_LINK_HELP, BUTTON_LINK_HELP_ALT) . '</a>'; ?>
9 Oct 2008, 2:07 PM
#4
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: Creating a New Page to Popup Can't Be This Complicated??

afo:

Clyde should have put that php snippet in code tage to avoid the smilie.

<?php echo '<a href="javascript:popupWindow(\'' . zen_href_link(FILENAME_POPUP_LINKS_HELP) . '\')">' . zen_image_button(BUTTON_IMAGE_LINK_HELP, BUTTON_LINK_HELP_ALT) . '</a>'; ?>

I realized that after posting but the editing time limit had passed.

Thanks afo.
9 Oct 2008, 2:13 PM
#5
afo avatar

afo

Totally Zenned

Join Date:
Aug 2004
Location:
New York City
Posts:
6,800
Plugin Contributions:
0

Re: Creating a New Page to Popup Can't Be This Complicated??

clydejones:

I realized that after posting but the editing time limit had passed.

Thanks afo.

The tip is pretty cool, but I knew the smilie didn't belong. It took me a minute to figure out it was a : followed by p. I thought I'd fix it to avoid confusion. Of course, there's a typo in my post, but whatver. :D

19 Oct 2008, 2:13 AM
#6
momof2 avatar

momof2

New Zenner

Join Date:
Oct 2008
Posts:
25
Plugin Contributions:
0

Re: Creating a New Page to Popup Can't Be This Complicated??

clydejones:

The attached file contains the basic files/folders you would need to create a popup.

In addition to these files you also need the following (or similar) placed where you want to call the window from.

<?php echo '<a href="javascript:popupWindow(\'' . zen_href_link(FILENAME_POPUP_LINKS_HELP) . '\')">' . zen_image_button(BUTTON_IMAGE_LINK_HELP, BUTTON_LINK_HELP_ALT) . '</a>'; ?>

[Attachment no longer available]

Thanks for the files and the tips. I, like the original poster have been confused with all the different posts and different ways to do this. I am by no means technical, so pardon me if this is a dumb question. I went through each file to understand what the code was doing. I would require multiple pop up images. Design options, colors, font, monograms, etc. So would I had snippets of code to each file and create a new pop_up_links.php for each pop window I need? Also where you have all caps, such as (FILENAME_POPOUP_LINKS_HELP), I'm assuming this is the actual filename of the image. Am I correct? Thanks in advance for your patience.

19 Oct 2008, 9:53 AM
#7
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: Creating a New Page to Popup Can't Be This Complicated??

momof2:

Thanks for the files and the tips. I, like the original poster have been confused with all the different posts and different ways to do this. I am by no means technical, so pardon me if this is a dumb question. I went through each file to understand what the code was doing. I would require multiple pop up images. Design options, colors, font, monograms, etc. So would I had snippets of code to each file and create a new pop_up_links.php for each pop window I need? Also where you have all caps, such as (FILENAME_POPOUP_LINKS_HELP), I'm assuming this is the actual filename of the image. Am I correct? Thanks in advance for your patience.

Those files were an example showing the necessary files needed to create a popup window and include the language file, the extra_datafile (which contains the filename pointer to the popup file) and the actual popup file folder.

Other examples of popup window files can be found by looking in includes/templates/template_default
You'll notice several folders for popup_*

(FILENAME_POPUP_LINKS_HELP) is a constant which points to that particular popup folder.

I would require multiple pop up images. Design options, colors, font, monograms, etc.
most if not all of these could be handled using the product attribute feature of Zen Cart without having to write code for additional popup windows.

19 Oct 2008, 4:17 PM
#8
momof2 avatar

momof2

New Zenner

Join Date:
Oct 2008
Posts:
25
Plugin Contributions:
0

Re: Creating a New Page to Popup Can't Be This Complicated??

clydejones:

Those files were an example showing the necessary files needed to create a popup window and include the language file, the extra_datafile (which contains the filename pointer to the popup file) and the actual popup file folder.

Other examples of popup window files can be found by looking in includes/templates/template_default
You'll notice several folders for popup_*

(FILENAME_POPUP_LINKS_HELP) is a constant which points to that particular popup folder.

most if not all of these could be handled using the product attribute feature of Zen Cart without having to write code for additional popup windows.
If I can handle it from attributes, that would be my preference. But based on what I've read, I can only add a file (say a small swatch). What I need is for a particular item (say a thank you card), the customer could pick a design option out of 30, they could pick a card color, out of 30, they could pick the ink color, out of 30. And I want them to see the color and the designs. I'm not sure how to accomplish this in attributes. I don't want it to all be on the page as that would be cluttered. If you could elaborate on how I can do that without code that would be wonderful, and greatly appreciated.

19 Nov 2008, 12:55 AM
#9
tech_e avatar

tech_e

Zen Follower

Join Date:
Jan 2007
Posts:
159
Plugin Contributions:
0

Re: Creating a New Page to Popup Can't Be This Complicated??

Clyde, thanks for the great tips about setting up additional popups. You saved me a lot of time. :thumbsup:

I want to add some help tips to the login page, but the popupWindow JavaScript function is not available on that page. How do I add that function to the login page?

19 Nov 2008, 3:22 AM
#10
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: Creating a New Page to Popup Can't Be This Complicated??

Tech-E:

Clyde, thanks for the great tips about setting up additional popups. You saved me a lot of time. :thumbsup:

I want to add some help tips to the login page, but the popupWindow JavaScript function is not available on that page. How do I add that function to the login page?

Once you've created all the necessary files you can place the code wherever you wish on the page.

<?php echo '<a href="javascript:popupWindow(\'' . zen_href_link(FILENAME_POPUP_LINKS_HELP) . '\')">' . zen_image_button(BUTTON_IMAGE_LINK_HELP, BUTTON_LINK_HELP_ALT) . '</a>'; ?>
19 Nov 2008, 5:41 PM
#11
tech_e avatar

tech_e

Zen Follower

Join Date:
Jan 2007
Posts:
159
Plugin Contributions:
0

Re: Creating a New Page to Popup Can't Be This Complicated??

Hi Clyde

I don't think you understand. You are calling a JavaScript function named popupWindow. That function does not exist on the Login/Create New Account page. The popup therefore does not work.

Do you know how to add the popupWindow function to that page?

19 Nov 2008, 6:19 PM
#12
tech_e avatar

tech_e

Zen Follower

Join Date:
Jan 2007
Posts:
159
Plugin Contributions:
0

Re: Creating a New Page to Popup Can't Be This Complicated??

Hi Clyde

I found it. Unless the popupWindow() JavaScript function exists on the page, the popup will not work. It did not exist on the login page.

I added the function to

/includes/modules/pages/login/jscript_main.php

I know this is a core file. I need to figure out where to copy it to.

17 Dec 2008, 11:46 PM
#13
beyoyo2 avatar

beyoyo2

New Zenner

Join Date:
Jan 2008
Posts:
16
Plugin Contributions:
0

Re: Creating a New Page to Popup Can't Be This Complicated??

This works great... just what I needed. I would like to make a button to open the Popup... I can make the art easy enough, but how do I actually put the graphic button in the page and make it work?

I have CSS buttoning turned on globally.. but for this I want to use an image... and all I see is an attempt for the CSS button to render "BUTTON_IMAGE_LINK_HELP" in it.

1.3.8a, linux (godaddy)

3 Jan 2009, 2:45 PM
#14
meltdown avatar

meltdown

Totally Zenned

Join Date:
Jun 2006
Location:
My family and I live in Brighton, England
Posts:
947
Plugin Contributions:
0

Re: Creating a New Page to Popup Can't Be This Complicated??

Hmm... Can I call an html page within a javascript snippet? Here is a (poorly excuted) example of what I mean:

<?php echo '<a href="javascript:popupWindow(\''http://beadedlilydesigns.com/test.htm'\')">' . 'More Info' . '</a>)');?>

So that 'More Info' is the text link on which you click to activate the popup

18 Feb 2009, 1:49 AM
#15
giftmeister avatar

giftmeister

Zen Follower

Join Date:
Jan 2009
Location:
Montreal, Canada
Posts:
230
Plugin Contributions:
0

Re: Creating a New Page to Popup Can't Be This Complicated??

It did not exist on the login page.

I added the function to

/includes/modules/pages/login/jscript_main.php

I know this is a core file. I need to figure out where to copy it to.

Did you figure it out? I would also like a popup on the login page. I uploaded the files, I see the text I created, the link...but nothing actually pops.

Cheers,

Robbie

24 Feb 2009, 5:33 PM
#16
agent_kgb avatar

agent_kgb

Zen Follower

Join Date:
Jan 2009
Posts:
111
Plugin Contributions:
0

Re: Creating a New Page to Popup Can't Be This Complicated??

I've been trying to figure out how to do the popups... and finally found this... seems like this is exactly what i need...

unfortunately i am not all that up to speed on coding... and as such, pretty lost as to what i need to do.

I've uploaded the files, and tried putting in the code on the page... however no link is showing up... all i get is this:
zen_image_button(BUTTON_IMAGE_LINK_HELP, BUTTON_LINK_HELP_ALT) . ''; ?>

my guess i need to change some stuff (i did change the YOUR TEMPLATE to MYTEMPLATENAME folders)... what am i missing? i am sure it's something simple...

26 Feb 2009, 1:21 PM
#17
tech_e avatar

tech_e

Zen Follower

Join Date:
Jan 2007
Posts:
159
Plugin Contributions:
0

Re: Creating a New Page to Popup Can't Be This Complicated??

giftmeister:

Did you figure it out? I would also like a popup on the login page. I uploaded the files, I see the text I created, the link...but nothing actually pops.

Hi Robbie

You have to add the popupWindow function to /includes/modules/pages/login/jscript_main.php

<script language="javascript" type="text/javascript"><!--
function session_win() {
  window.open("<?php echo zen_href_link(FILENAME_INFO_SHOPPING_CART); ?>","info_shopping_cart","height=460,width=430,toolbar=no,statusbar=no,scrollbars=yes").focus();
}

function popupWindow(url) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=400,height=300,screenX=150,screenY=150,top=150,left=150')
}
//--></script>

This is what the JavaScript code looks like for that script. I added it right after the session_win function.

1 Mar 2009, 4:05 AM
#18
giftmeister avatar

giftmeister

Zen Follower

Join Date:
Jan 2009
Location:
Montreal, Canada
Posts:
230
Plugin Contributions:
0

Re: Creating a New Page to Popup Can't Be This Complicated??

Thanks! :clap:

12 May 2009, 10:46 PM
#19
giftmeister avatar

giftmeister

Zen Follower

Join Date:
Jan 2009
Location:
Montreal, Canada
Posts:
230
Plugin Contributions:
0

Re: Creating a New Page to Popup Can't Be This Complicated??

I recently got a new computer and noticed that the one pop-up I added two months ago and that worked in all older browsers now only shows in FF3 and not in Google Chrome and just partially in IE8.

Zen's built-in pop-up on the Shopping Cart page is fine in all browsers. The one I added is on the next page, Login, under #1 Checkout Without An Account...there should be a link for "Account_benefits."

Any idea what's going on?

Cheers,

Robbie

17 May 2009, 10:23 PM
#20
giftmeister avatar

giftmeister

Zen Follower

Join Date:
Jan 2009
Location:
Montreal, Canada
Posts:
230
Plugin Contributions:
0

Re: Creating a New Page to Popup Can't Be This Complicated??

In searching the forum, I came across this much simpler popup method and changed mine to it.

http://www.zen-cart.com/forum/showpost.php?p=702960&postcount=1

R