Results 1 to 9 of 9
  1. #1
    Join Date
    Sep 2006
    Location
    Derby UK
    Posts
    99
    Plugin Contributions
    0

    Default Pop up window display problem.

    I have a product which is available in about 24 colour variations. If I set up the colours as attributes with images the resulting product_info page size is too big. To get a reasonable idea of the colours available [mostly woodgrains] the attribute images need to be around 100 wide x 200 high. So I decided to have the attributes, as names only, in a drop down list, and have a link to a pop up window showing the available colour images. I have added the following code to the Product Description

    Code:
    Brooklyn
    <p><script type="text/javascript">
    function openpopup(popurl){
    var winpops=window.open(popurl,"","width=700,height=400,resizable=yes, scrollbars=yes")
    }
    </script>
    
    <a href="javascript:openpopup('http://www.rgdistribution.co.uk/extra_pages/swatch.php')">For available colours click HERE</a></p>
    and it works ok as far as the Product_Info page goes. However, when the product category page is displayed I see the product name, and below it is the code [rather than the link].

    Here is the page: http://www.rgdistribution.co.uk/index.php?main_page=index&cPath=22_23&sort=20a&page=2
    and the product currently modified is the Brooklyn

    Should I add the code to the html_header.php file, or should it be in a .js file in includes/modules/pages/PAGENAME, or somewhere else?

    I have been experimenting for some time now but can't resolve this [although it was quit easy to stuff it up all together :)].
    Crazy



  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Pop up window display problem.

    Try removing th <p> and </p> from this entry see if that helps

  3. #3
    Join Date
    Sep 2006
    Location
    Derby UK
    Posts
    99
    Plugin Contributions
    0

    Default Re: Pop up window display problem.

    Hi kobra, thanks for your help.

    Removed the <p></p> tags but alas the problem remains.

    Are the <script></script> tags removed in some way when the description is truncated for the product category pages? This is why I was thinking that including the script in the description was maybe not a good idea.

    TIA
    Crazy



  4. #4
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Pop up window display problem.

    I think that I recall some quirk about what is parsed & how from the product description for productlisting...As I recall, even html formatting is stripped for this.

    I think that if you might like the display of this using the column grid module that the description is not used...

  5. #5
    Join Date
    Sep 2006
    Location
    Derby UK
    Posts
    99
    Plugin Contributions
    0

    Default Re: Pop up window display problem.

    Hi Kobra

    Tried the column display mod but unfortunately the problem still remains.

    I won't get much time to investigate this further until tomorrow, but it looks like i have to find an alternative way of doing this. Link in a sidebox? EZ Page maybe?

    Thanks for your help.
    Crazy



  6. #6
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Pop up window display problem.

    Will this always be this file?
    http://www.rgdistribution.co.uk/extra_pages/swatch.php

    If so you can move it out of the html product description and into the tpl_product_info_display.php file and I suppose you do not want it selectable on all products so if you have this organized and is only applicable to one category a conditional can be used

  7. #7
    Join Date
    Sep 2006
    Location
    Derby UK
    Posts
    99
    Plugin Contributions
    0

    Default Re: Pop up window display problem.

    Ok, one last dumb question!

    The file will always be /extra_pages/swatch.php and is only applicable to one category, category #22.

    I think the category id variable I am looking for in my conditional statement is $categories_id but it doesn't appear to be available on the product_info_display page.

    I used the following to check for it
    Code:
    if (!isset($categories_id))
    echo"not set";
    http://www.rgdistribution.co.uk/inde...roducts_id=391

    So my question is [assuming I have the correct variable]; How do I make this variable available on this page so I can limit the display of the swatch link to category 22 only?

    Thanks.
    Crazy



  8. #8
    Join Date
    Sep 2006
    Location
    Derby UK
    Posts
    99
    Plugin Contributions
    0

    Default Re: Pop up window display problem.

    Ok, I think I have got it!

    For anyone as far down the php learning curve as me, this is what I did.

    Firstly I had trouble finding which variables were available in the products_info_display.php file. So if you add the following

    Code:
    <?php
       echo '<pre>';
    print_r($_GET);
    echo '</pre>';
    ?>
    at the top of the file it will output the available variables, in my case:

    Code:
    Array
    (
        [main_page] => product_info
        [cPath] => 22_23
        [products_id] => 381
    )
    [FONT=Verdana]Once I had the variable $cPath I inserted the following code
    [/FONT]
    Code:
    <?php 
    if (!isset($cPath))
    echo"not set";
    
    if ($cPath=="22_23"){
    ?>
    <script type="text/javascript">
    function openpopup(popurl){
    var winpops=window.open(popurl,"","width=700,height=400,resizable=yes, scrollbars=yes")
    }
    </script>
    <script type="text/javascript">
    function openpopup(popurl){
    var winpops=window.open(popurl,"","width=700,height=400,resizable=yes, scrollbars=yes")
    }
    </script>
    
    <a href="javascript:openpopup('http://www.rgdistribution.co.uk/extra_pages/swatch.php')">For available colours click HERE</a>
    <?php
    }
    
    
    elseif ($cPath=="22_25"){
    ?>
    <script type="text/javascript">
    function openpopup(popurl){
    var winpops=window.open(popurl,"","width=700,height=400,resizable=yes, scrollbars=yes")
    }
    </script>
    <script type="text/javascript">
    function openpopup(popurl){
    var winpops=window.open(popurl,"","width=700,height=400,resizable=yes, scrollbars=yes")
    }
    </script>
    
    <a href="javascript:openpopup('http://www.rgdistribution.co.uk/extra_pages/swatch.php')">For available colours click HERE</a>
    <?php
    }
    ?>
    And all seems to work ok.

    Maybe this is simple stuff to most of the people here on the forum, and maybe its not the most elegant way to do it - but hey, I DID IT

    Many thanks to Kobra for pointing me in the right direction, there is a pint on the bar for you!
    Crazy



  9. #9
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Pop up window display problem.

    Great!!!!

    Hey what works - works - and this is more a hack for your use anyway...

 

 

Similar Threads

  1. Pop-up window on Cart page does not display text
    By giftmeister in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 4 Oct 2011, 04:30 AM
  2. Pop up window backrounds
    By EAPerformanceParts in forum Templates, Stylesheets, Page Layout
    Replies: 10
    Last Post: 17 Jun 2009, 10:01 AM
  3. Pop-up Window
    By UrbanFool in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 6 Mar 2008, 04:31 AM
  4. Java Pop-Up Window
    By jacque427 in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 2 Nov 2007, 12:12 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg