Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Popup Window Via Text Link (Instead Of Image Link)

Popup Window Via Text Link (Instead Of Image Link)

Views: 13,589

Results 1 to 20 of 58
17 Apr 2008, 4:10 AM
#1
celtickatt avatar

celtickatt

Zen Follower

Join Date:
Mar 2005
Location:
Tulsa, Ok
Posts:
174
Plugin Contributions:
0

Popup Window Via Text Link (Instead Of Image Link)

I hope this is in the right section (and I'm sure it's been asked before, but sometimes answers are impossible to find in this forum!) If I didn't put it in the right place- admins- please move it to the correct place! Thanks!

I have products that have example images with their attributes (see here: http://accessory-avenue.com/hbhcatal...products_id=66) but instead of cluttering up the page with images (right now I have semi-small images that open into bigger ones via an image popup) I'd like to call a popup (or new window, if that's the only option) from a text link instead of an image. See this site for a good example (where it says, "- Click here to view engraving styles"):
http://www.weddingsbymaria.com/color...ets-p-520.html
That site just uses a text link to open a new window, which would work, but I'd REALLY like to use a text link to open a popup window, like on this site: http://www.theweddingoutlet.com/Wedd...age-Server-Set
(Where it says, "Personalize:" choose any option other than, "No personalization" and it will drop down more options, and that's where you will find the link for the popup that says, "View Design Styles".)

Anyone know how to do that? I'm not sure what script I would need to use and I'm not sure where I would actually put the coding. Even if I had a javascript script for the popup window, I wouldn't know where to upload it and how to call on it.

Thanks in advance!

17 Apr 2008, 4:19 AM
#2
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,184
Plugin Contributions:
0

Re: Popup Window Via Text Link (Instead Of Image Link)

C,
The admins are going to spank you for this double post,
I thought I read this at 9:23 tonight...

17 Apr 2008, 4:30 AM
#3
celtickatt avatar

celtickatt

Zen Follower

Join Date:
Mar 2005
Location:
Tulsa, Ok
Posts:
174
Plugin Contributions:
0

Re: Popup Window Via Text Link (Instead Of Image Link)

I know hangs head but no one was even looking at it where I first posted it and I really didn't know WHERE it should have been posted. I really need help on this one...

(I do apologize, admins!)

17 Apr 2008, 4:34 AM
#4
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,184
Plugin Contributions:
0

Re: Popup Window Via Text Link (Instead Of Image Link)

CelticKatt:

I know hangs head but no one was even looking at it where I first posted it and I really didn't know WHERE it should have been posted. I really need help on this one...

(I do apologize, admins!)

Take a look here:
http://www.zen-cart.com/forum/showthread.php?t=94825
It is not as fancy as you would like
But might work,
What you think?????

17 Apr 2008, 4:36 AM
#5
celtickatt avatar

celtickatt

Zen Follower

Join Date:
Mar 2005
Location:
Tulsa, Ok
Posts:
174
Plugin Contributions:
0

Re: Popup Window Via Text Link (Instead Of Image Link)

haredo:

Take a look here:
http://www.zen-cart.com/forum/showthread.php?t=94825
It is not as fancy as you would like
But might work,
What you think?????

Crazy thing is, that showed no link at all until I hit reply! For those that also read this, here's the link:
http://www.zen-cart.com/forum/showthread.php?t=94825

Off to read it now... brb...

17 Apr 2008, 4:42 AM
#6
celtickatt avatar

celtickatt

Zen Follower

Join Date:
Mar 2005
Location:
Tulsa, Ok
Posts:
174
Plugin Contributions:
0

Re: Popup Window Via Text Link (Instead Of Image Link)

That is exactly what I am looking for. I will head on over there and wait for your notes! Thank you!!!

17 Apr 2008, 4:46 AM
#7
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,184
Plugin Contributions:
0

Re: Popup Window Via Text Link (Instead Of Image Link)

CelticKatt:

That is exactly what I am looking for. I will head on over there and wait for your notes! Thank you!!!

I thought this thread might be a little useful, now 2 people want the little clone files and tpl_module_attribute.php file coding.. I normally take great notes, will half to dig them out from 2 years ago..

17 Apr 2008, 4:51 AM
#8
celtickatt avatar

celtickatt

Zen Follower

Join Date:
Mar 2005
Location:
Tulsa, Ok
Posts:
174
Plugin Contributions:
0

Re: Popup Window Via Text Link (Instead Of Image Link)

Awesome! I'm anxious to see the coding for it. I'm wondering how you can get the "(Guidelines)" to be different for each attribute and what it has to do with the tpl_module_attribute.php (I've been editing that one a lot tonight to change the layout of my attributes.) Is there a way to do the link popup in the comments section of the options name? Your way may be easier though- I have no idea!

17 Apr 2008, 5:06 AM
#9
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,184
Plugin Contributions:
0

Re: Popup Window Via Text Link (Instead Of Image Link)

C,
I need two names from your Option Name Manager you want to apply this too.
How many option Names are you going to apply this too???
& I will rewrite the coding for you this weekend..

17 Apr 2008, 5:23 AM
#10
celtickatt avatar

celtickatt

Zen Follower

Join Date:
Mar 2005
Location:
Tulsa, Ok
Posts:
174
Plugin Contributions:
0

Re: Popup Window Via Text Link (Instead Of Image Link)

Yay! Thank you!!!

I know you only asked for two of my option Names, but I got curious as to how many I actually need when you wondered how many I would need to apply it to, so I listed all the known ones as of this point. I doubt I would need very many more, if even at all. I can't really combine option Names, but I could put information for more than one attribute in the popup itself, if that helps at all. That way I could have two or three main (Guideline) pages to link the popup to, instead of a bunch of little popups. Either way...

Engraving Typestyle:
Monogram Style:
Add Engraved Ornament?
Embroidery Typestyle:
Thread Color For Names/Date:
Thread Color For Design/Monogram
Embroidery Design:
Initial:

21 Apr 2008, 6:31 PM
#11
celtickatt avatar

celtickatt

Zen Follower

Join Date:
Mar 2005
Location:
Tulsa, Ok
Posts:
174
Plugin Contributions:
0

Re: Popup Window Via Text Link (Instead Of Image Link)

Hey haredo,
Just thought I'd see how the mod-finding went! Were you able to find your notes?

22 Apr 2008, 3:12 AM
#12
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,184
Plugin Contributions:
0

Re: Popup Window Via Text Link (Instead Of Image Link)

Are you ready for some Football.

Step 1

includes/ extra_datafiles/1. >

  1. create a php. file called:
  1. popup_monogram_style.php
  1. Now inside this file copy and paste:
<?php // About Us Filename Define define('FILENAME_POPUP_MONOGRAM_STYLE', 'popup_monogram_style'); ?>
> includes/ languages/ english/ your_own_template/1. >
2. create a .php file called
>
3. popup_monogram_style.php
>
4. Now inside this file copy and paste:
>
5. ```html
<?php
//
// +----------------------------------------------------------------------+
// |zen-cart Open Source E-commerce                                       |
// +----------------------------------------------------------------------+
// | Copyright (c) 2003 The zen-cart developers                           |
// |                                                                      |
// | http://www.zen-cart.com/index.php                                    |
// |                                                                      |
// | Portions Copyright (c) 2003 osCommerce                               |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the GPL license,       |
// | that is bundled with this package in the file LICENSE, and is        |
// | available through the world-wide-web at the following url:           |
// | http://www.zen-cart.com/license/2_0.txt.                             |
// | If you did not receive a copy of the zen-cart license and are unable |
// | to obtain it through the world-wide-web, please send a note to       |
// | [email protected] so we can mail you a copy immediately.          |
// +----------------------------------------------------------------------+
// $Id: popup_monogram_style.php 1969 2005-09-13 06:57:21Z drbyte $
//

define('HEADING_MONOGRAM_STYLE', 'MONOGRAM STYLES');
define('TEXT_MONOGRAM_STYLE1', '<strong>Please Take The Time To Accurately Determine Bracelet Size:</strong><br /> All our bracelets are measured from end to end including the clasp.<br /> If you follow our guidelines you will receive a nice fitting bracelet with a little bit of movement and room.<br /><br />
<strong>Measuring Your Wrist:</strong><br />
To determine the bracelet size you need, measure wrist with a soft flexible measuring tape and add 1/2" depending on the desired dangle length.<br /> If you do not have a measuring tape you can use a ribbon or piece of string.<br /> Mark the length then measure with a ruler.<br /><br />
<strong>Please Note:</strong><br /> Depending on the beads used in making your bracelet - your bracelet may vary from the size you specified by up to approximately 1/8".<br /> We make all bracelets "as close as possible" to the size you order.');

define('TEXT_MONOGRAM_STYLE2', '<br />');

define('TEXT_CLOSE_MONOGRAM_STYLE_WINDOW', 'Close Window [x]');
?>
  1. This will be the file you will edit for a customer to view the popup:smile:Step 3

includes/ templates/ your_custom_template/1. >

  1. create a new folder called:
  1. popup_monogram_style
  1. Inside this folder, create a .php file called:
  1. tpl_main_page.php
  1. now inside this file paste and copy
<?php /** * tpl_main_page.php * * @package templateSystem * @copyright Copyright 2003-2005 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 * @version $Id: tpl_main_page.php 2870 2006-01-21 21:36:02Z birdbrain $ */ ?> <body id="popupMONOGRAM_STYLE"> <h1><?php echo HEADING_MONOGRAM_STYLE ?></h1> <div id="braceletSize"><?php echo TEXT_MONOGRAM_STYLE1 ?></div> <div><?php echo TEXT_MONOGRAM_STYLE2 ?></div> <div><?php echo '<a href="javascript:window.close()">' . TEXT_CLOSE_MONOGRAM_STYLE_WINDOW . '</a>'; ?></div> </body> ```Step 4 > includes/ templates/ your_custom_template/ templates/ tpl_modules_attributes.php1. > 2. You are going to edit this puppy. > 3. Find this: > 4. ```html <h3 class="attributesComments"><?php echo $options_comment[$i]; ?></h3> <?php } ``` > 5. Right blow this Add the following: > 6. if (preg_match("/monogram style/i", $options_name[$i])) > { > $guideLink = '<a href="javascript:popupWindowPrice(\'' . zen_href_link(FILENAME_POPUP_MONOGRAM_STYLE) . '\')">(<u>Guidelines</u>)</a>'; > } > else if (preg_match("/engraving typestyle/i", $options_name[$i])) > { > $guideLink = '<a href="javascript:popupWindowPrice(\'' . zen_href_link(FILENAME_POPUP_ ENGRAVING_TYPESTYLE) . '\')">(<u>Guidelines</u>)</a>'; > > } > else if (preg_match("/embroidery typestyle/i", $options_name[$i])) > { > $guideLink = '<a href="javascript:popupWindowPrice(\'' . zen_href_link(FILENAME_POPUP_ EMBROIDERY_TYPESTYLE) . '\')">(<u>Guidelines</u>)</a>'; > > } > else > $guideLink = null; > ?> > 7. The lime green font above will change to your subcategory name. > 8. I did not have a url to your web site to view so I just put up wording > 9. That freekin smile face, must be the code to enter needs to be changed: > 10. delete the :p with : p No space between the colon & p Of all times it happens > 11. The red font above is the Wording you need to change beside the Option Name to whatever you like. The link to view the popup when clicked on.. > 12. I edited all the proper files for the first preg_match to work > 13. Your will half to clone the rest for all of the popups you want > 14. Notice I used 3 preg_match above > 15. You will half to add on if you want more, As it looks by the option names you send back to me..
22 Apr 2008, 4:38 AM
#13
celtickatt avatar

celtickatt

Zen Follower

Join Date:
Mar 2005
Location:
Tulsa, Ok
Posts:
174
Plugin Contributions:
0

Re: Popup Window Via Text Link (Instead Of Image Link)

Hoooooly Lordy, ok... Let me see if I got this right...

Step 1 and two will need to be repeated for each different popup I need (I listed a lot before, but after looking at this I will try to combine several of them, lol!) So for example, if I need the "monogram style" and "embroidery style" (and more for however many I actually need), I would do the following:

Step 1: make the files:
includes/extra_datafiles/popup_monogram_style.php and
includes/extra_datafiles/popup_embroidery_style.php
etc.
and paste the provided code.

**Step 2: **make the files:
includes/languages/english/your_own_template/popup_monogram_style.php and
includes/languages/english/your_own_template/popup_embroidery_style.php
etc.
and paste the provided code; editing to my own needs.

Step 3: make the files:
includes/templates/your_custom_template/popup_monogram_style/tpl_main_page.php and
includes/templates/your_custom_template/popup_embroidery_style/tpl_main_page.php
etc.
and paste the provided code.

Step 4:
Modify the file includes/templates/your_custom_template/templates/ tpl_modules_attributes.php to your code and change the necessary bits.

Am I right so far? Sorry I'm basically repeating what you wrote but I wanted to make sure it's right. Not only for my own clarification but for future readers' as well.

I have a few questions/remarks:

  1. I actually did realize what was going on with the smiley face bit and got a kick out of it rendering as an actual face instead of the : p (put together) code. The only thing to make sure of is if it's supposed to be a capital P or small p.

  2. "Notice I used 3 preg_match above"
    Ok I noticed that, but if it's important, lol, I don't get it. Anything special about it, other than it needing to be there for each set of popups?

  3. This probably sounds stupid, but do I actually need to do anything to get those to SHOW the "Guidelines" link, or will they automatically show up in the "comments" section of the attributes layout? So for example, with a REGULAR attribute that isn't specified here (that doesn't need a popup) I can wrote whatever comment I want and it will show up normally (here's an example page for you, where it says, "Must select, "Yes! Engrave..."" below the attribute name. http://accessory-avenue.com/hbhcatalog/index.php?main_page=product_info&cPath=7_29&products_id=150 ), right? But for those that were specified below and all the correct files were created, it will automatically (without putting anything in the "comments" section of the attribute name) put the "Guidelines" link to the proper popup. Right?

  4. Can the popup contain anything in it? By that I mean, a bunch of html and tables and whatnot, as if it were an actual html page that just opens in the popup? Can it have just a big image (that way if it can't have the html, I can just make a big image in Photoshop and have THAT be in the popup?)

Thanks a TON for helping me/us on this! I really appreciate it! This will really clean up my attribute section!
:thumbsup:

22 Apr 2008, 4:55 AM
#14
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,184
Plugin Contributions:
0

Re: Popup Window Via Text Link (Instead Of Image Link)

I have a few questions/remarks:

  1. I actually did realize what was going on with the smiley face bit and got a kick out of it rendering as an actual face instead of the : p (put together) code. The only thing to make sure of is if it's supposed to be a capital P or small p.

  2. "Notice I used 3 preg_match above"
    Ok I noticed that, but if it's important, lol, I don't get it. Anything special about it, other than it needing to be there for each set of popups?

  3. This probably sounds stupid, but do I actually need to do anything to get those to SHOW the "Guidelines" link, or will they automatically show up in the "comments" section of the attributes layout? So for example, with a REGULAR attribute that isn't specified here (that doesn't need a popup) I can wrote whatever comment I want and it will show up normally (here's an example page for you, where it says, "Must select, "Yes! Engrave..."" below the attribute name. http://accessory-avenue.com/hbhcatal...roducts_id=150 ), right? But for those that were specified below and all the correct files were created, it will automatically (without putting anything in the "comments" section of the attribute name) put the "Guidelines" link to the proper popup. Right?

  4. Can the popup contain anything in it? By that I mean, a bunch of html and tables and whatnot, as if it were an actual html page that just opens in the popup? Can it have just a big image (that way if it can't have the html, I can just make a big image in Photoshop and have THAT be in the popup?)

  1. small p
  2. Very important, without the call of each file for each popup. Guess What: No popup appears.
    A. I cloned CVV popup to enable this into a cart.. The .php code was the cats meow... you will need a preg_match for every popup..
  3. Example: On the site I intergrated this too:
    Bracelets: Guidlines When you click guidlines the popup appears..
  4. To your hearts content. As long as it is edited with html coding...
22 Apr 2008, 5:01 AM
#15
celtickatt avatar

celtickatt

Zen Follower

Join Date:
Mar 2005
Location:
Tulsa, Ok
Posts:
174
Plugin Contributions:
0

Re: Popup Window Via Text Link (Instead Of Image Link)

Awesome. One more question and then I'll try to leave you alone until I try it out personally... say I DID want another actual page to popup instead of the html in the little window, is that possible? Not that I would ever need this example, but if I wanted Google to open up, is that possible?

22 Apr 2008, 5:11 AM
#16
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,184
Plugin Contributions:
0

Re: Popup Window Via Text Link (Instead Of Image Link)

Sure you can,
You would have to write the code for a echo in the tpl_modules_attributes.php

  1. $guideLink = '<a href="javascript:popupWindowPrice(\'' . zen_href_link(FILENAME_POPUP_ EMBROIDERY_TYPESTYLE) . '\')">
  2. you would rewrite the code above to call for an echo
22 Apr 2008, 5:27 AM
#17
celtickatt avatar

celtickatt

Zen Follower

Join Date:
Mar 2005
Location:
Tulsa, Ok
Posts:
174
Plugin Contributions:
0

Re: Popup Window Via Text Link (Instead Of Image Link)

That's where my php language stops! Could you give me the coding for the https://www.google.com example (if I wanted that page to open as the popup)? Mainly I ask because I'm not sure yet how I want to set everything up. Luckily I think I can narrow it down all of my attributes (that need example/guidelines) to about two or three different popups, but it might be easier if I just make each one their own seperate html page, since I'm much more proficient in html. And then I could just call that html page to open. And say I did make that html page for the popup, what would I need to do for Step 2, where all the guideline information/html WOULD have gone:
includes/languages/english/your_own_template/popup_monogram_style.php
(I assume I could just leave it alone since it would be ignored anyway, with having called an html page instead of the info popup, right?)

22 Apr 2008, 5:50 AM
#18
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,184
Plugin Contributions:
0

Re: Popup Window Via Text Link (Instead Of Image Link)

haredo:

Sure you can,
You would have to write the code for a echo in the tpl_modules_attributes.php1. >

  1. $guideLink = '<a href="javascript:popupWindowPrice(\'' . zen_href_link(FILENAME_POPUP_ EMBROIDERY_TYPESTYLE) . '\')">
  1. you would rewrite the code above to call for an echo

Ok,
Is this what you mean...

  1. $guideLink = '<a href="javascript:popupWindowPrice(\'' . zen_href_link(FILENAME_POPUP_BSZLNGTH) . '\')">(<u>Guidelines</u>)</a>';
    }
  2. this is replaces with:
  3. $guideLink = '<a href="http://www.google.com"><u>Google Link</u></a>';}
22 Apr 2008, 5:56 AM
#19
celtickatt avatar

celtickatt

Zen Follower

Join Date:
Mar 2005
Location:
Tulsa, Ok
Posts:
174
Plugin Contributions:
0

Re: Popup Window Via Text Link (Instead Of Image Link)

I do believe that would do it, yes! Thanks! I will try to test this out tomorrow, but it might take a bit longer. I'll be back either after I try or with another question, lol! Thanks again!

22 Apr 2008, 6:53 AM
#20
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,184
Plugin Contributions:
0

Re: Popup Window Via Text Link (Instead Of Image Link)

C,
Just take your time and duplicate the files..
The hard one is the tpl_modules_attributes.php

  1. the lime green text has to be changed to match your subcategory name
  2. and of course that dang :smile:.
  3. Worked like a charm on a site I built.....
  4. And the beauty, Did you Notice: No core files were written on!!!!!!