Link Thumbnail to Pop Up Link in Multiple Column View (v. 2.8x)

When using the multi column view (Columns 2 - Columns 6 in the product layout), clicking an image (or the item name) takes you to the detail screen.

If you would like to change this so that clicking the image opens up a pop up page (while still keeping the item link as-is), you can use the following modification.

Note: this will map images to the pop up pages in order. In other words:

  • Thumbnail URL will link to Pop-Up Page 1
  • Thumbnail 2 will link to Pop-Up Page 2
  • Thumbnail 3 will link to Pop-Up Page 3

If you do not have a pop up page assigned, the image will link to the detail item screen just as it did before.

  1. Open the products_variables.php file in the /enc/ folder.

  2. Find the var_imglink function, around line 596.

  3. In that function, change the code:

    function var_imglink($varsmimage, $varmultilink, $varitem, $varalt, $varclass)

    to:

    function var_imglink($varsmimage, $varmultilink, $varitem, $varalt, $varclass, $varpop='')
  4. In that same function, add the code:

    // IF THERE IS A POPUP USE IT 
    if (!empty($varpop) AND !empty($varsmimage))
    {
    $popimg = applyimgsize(imgpathtourl($varsmimage), $varalt, $imgheight, $imgwidth, $varclass, $varitem);
    $dispimglink = "$popimg
    ";
    }
    // OTHERWISE USE LINK TO DETAIL SCREEN
    else

    just above the code:

    if (!empty($varsmimage))
  5. Open the products_multiple.php file in the /enc/ folder.

  6. Change the code:

    $display_imglink1 = var_imglink($display_sm_image1, $multitemlink, $stripitem, $stripalt, "smalllinkimage1");
    $display_imglink2 = var_imglink($display_sm_image2, $multitemlink, $stripitem, $stripalt, "smalllinkimage2");
    $display_imglink3 = var_imglink($display_sm_image3, $multitemlink, $stripitem, $stripalt, "smalllinkimage3");

    to:

    $display_imglink1 = var_imglink($display_sm_image1, $multitemlink, $stripitem, $stripalt, "smalllinkimage1", $searchrow[PopUpPg]);
    $display_imglink2 = var_imglink($display_sm_image2, $multitemlink, $stripitem, $stripalt, "smalllinkimage2", $searchrow[PopUpPg2]);
    $display_imglink3 = var_imglink($display_sm_image3, $multitemlink, $stripitem, $stripalt, "smalllinkimage3", $searchrow[PopUpPg3]);
  7. Optional: If you want to include all three pop ups, add the code:

    if (!empty($display_imglink2))
    echo $display_imglink2;
    if (!empty($display_imglink3))
    echo $display_imglink3;

    Just under the lines:

    if (!empty($display_imglink1))
    echo $display_imglink1;
  8. Save and reload the files.