Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Pop up blocker blocking new window

Pop up blocker blocking new window

Views: 1,031

Results 1 to 3 of 3
20 Nov 2013, 11:50 AM
#1
kitten091182 avatar

kitten091182

Zen Follower

Join Date:
May 2007
Posts:
110
Plugin Contributions:
0

Pop up blocker blocking new window

Hi, I have some code in my sidebox that when clicked should open a new window with information on the product of the page it is on. I have set it to target_blank and the pop up blocker is blocking it. I know that pop up blockers are meant to do that, but I have another piece of code with target_blank and the pop up blocker doesn't block it? I desperately need to get it to open in a new window if anybody could help me please? Here is a link to a product page on my site: http://www.drgreens.co.uk/Environment/Carbon-Dioxide/Evolution-CO2-Analyser in the advice centre sidebox on the right, you will see the "Data Sheet" link that I am referring to. It is brought up by a piece of code in that sidebox which is: ```php

<?php /** * editable sidebox - allows a sidebox editable with the define pages editor to be added to your site * * @package templateSystem * @copyright 2007 Kuroi Web Design * @copyright Portions Copyright 2003-2007 Zen Cart Development Team * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 * @version $Id: blank_sidebox.php 2007-08-10 kuroi $ */ $content = ''; $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">'; $content = file_get_contents($define_sidebox); $content .= '<div class="adbox">'.$extra_field .'</div>'; $content .= '<div class="adbox">' .$current_categories_description_sub .'</div>' ; $content .= '<div class="adbox">'.$products_file_1_link . '</div>' ; // this is where the content that you have via the Admin is pulled in. $content .= '</div>'; ?>

The link being $products_file_1_link. And that code pulls up the code in /includes/modules/pages/product_info/main_template_vars_product_type.php which is:php
/*

  • extract info from queries for use as template-variables:
    */
    $extra_field = $files->fields['extra_field'];
    $products_file_1_title = $files->fields['file_1_title'];
    $products_file_2_title = $files->fields['file_2_title'];
    $products_file_3_title = $files->fields['file_3_title'];
    $products_file_4_title = $files->fields['file_4_title'];
    $products_file_1 = $files->fields['file_1'];
    $products_file_2 = $files->fields['file_2'];
    $products_file_3 = $files->fields['file_3'];
    $products_file_4 = $files->fields['file_4'];
    $products_video = $files->fields['video'];
    $products_video_title = $files->fields['video_title'];
    if (!empty($products_video)) $products_video_link = '<a href="javascript:popupWindow(\''.zen_href_link(FILENAME_FLASH).'&id='.$_GET[products_id]. '\') ">'. $products_video_title . '</a>';

if (!empty($products_file_1_title)) $products_file_1_link = '<a href="' . "product_extra_files/" . $products_file_1 . '"target="_blank">'. $products_file_1_title . '</a>';
if (!empty($products_file_2_title)) $products_file_2_link = '<a href="' . "product_extra_files/" . $products_file_2 . '">'. $products_file_2_title . '</a>';
if (!empty($products_file_3_title)) $products_file_3_link = '<a href="' . "product_extra_files/" . $products_file_3 . '">'. $products_file_3_title . '</a>';
if (!empty($products_file_4_title)) $products_file_4_link = '<a href="' . "product_extra_files/" . $products_file_4 . '">'. $products_file_4_title . '</a>';

20 Nov 2013, 12:11 PM
#2
kitten091182 avatar

kitten091182

Zen Follower

Join Date:
May 2007
Posts:
110
Plugin Contributions:
0

Re: Pop up blocker blocking new window

I've just tried changing the code so that the files go to the downloads folder to be opened/saved from there, as I assumed that the downloads folder might be coded so as to override the pop up blocker, but still no luck :dontgetit

20 Nov 2013, 1:07 PM
#3
kitten091182 avatar

kitten091182

Zen Follower

Join Date:
May 2007
Posts:
110
Plugin Contributions:
0

Re: Pop up blocker blocking new window

I've managed to get it working now :smile: changed it to come from downloads folder and removed the target_blank reference and it seems to be working! Not sure how, but if anybody else has a problem like this I would recommend using the downloads folder because it seems to be set up to overcome this issue.