Announcement

Collapse
No announcement yet.

Use the extended info image as the search result product image?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Use the extended info image as the search result product image?

    How can I edit actinicsearch.js to use the extended info image as the search result product image (<actinic:variable name="SearchResultProductImage" />)?

    Thanks
    Jonathan
    Jonathan Chappell
    Website Designer
    SellerDeck Website Designer
    Actinic to SellerDeck upgrades
    Graphicz Limited - www.graphicz.co.uk

    #2
    This would be VERY difficult to do. It would need a direct tweak to the database to get the extended info image to be made available to the Perl scripts. You'd need patches to the Perl to get at that image and probably tweaks to actinicsearch.js to return that image.

    Alternatives:

    1) Use Product Pages instead. Extended Info pages are essentially redundant since Product Pages were introduced.

    2) Use the Extended Info Image in the Product Image layout(s) and the Product Image in the Extended Info pages.

    3) Create a JavaScript structure indexed by Product Ref, that contains each products Extended Info Image. Tweak actinicsearch.js (function ReplaceProductDetailstemplate) to look up that image instead of the Product Image. JS structure easily created by a set of nested EntireSectionList / SectionEntireProductList loops.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Thank you Norman. It is originally a Chris Dicken site which uses your AutoProductImages V2.00. The product image layout is replaced with the following, and this is what the search results layout is picking up, javascript mouseover and all!
      How can this be remedied? Live site is adalise.com
      Code:
      &lt;actinic:block php="true" &gt;
      // AutoProductImages V2.00
      include_once 'dpimagesupport.php';
      
      $DefaultProductImageWidth = 450;
      $DefaultProductImageHeight = 450;
      $ToolTipProductImageWidth = 160;
      $ToolTipProductImageHeight = 160;
      $ToolTipOffsetX = 0 + '20';
      $ToolTipOffsetY = 0 + '20';
      $GenerateToolTip = 0;
      $ScaledImageQuality = 100;
      $ProductImageFileName = '&lt;actinic:variable name="ExtendedInfoImage" selectable="false" /&gt;';
      $ImageBackgroundColour = 'white';
      $ProductImageWidth = '&lt;actinic:variable name="ExtendedInfoImageWidth" selectable="false" /&gt;';
      $ProductImageHeight = '&lt;actinic:variable name="ExtendedInfoImageHeight" selectable="false" /&gt;';
      $MakeProgressiveJpg = 1;
      $ProductImageFileName = str_replace('\\', '/', $ProductImageFileName); // replace troublesome backslashes
      $ProductName = htmlspecialchars('&lt;actinic:variable name="ProductName" encoding="html" selectable="false" /&gt;');
      unset($ProductImageMd5);
      unset($bkgndr);
      unset($ProductImage);
      $errmessage = '';
      $ScaledImageName = $ProductImageFileName;
      if ( ($ProductImageWidth != $DefaultProductImageWidth) || ($ProductImageHeight != $DefaultProductImageHeight) )
      {
      // we have to resize
      if ( strlen($ImageBackgroundColour) != 6 ) $ImageBackgroundColour = 'ffffff'; // use white as default
      $bkgndr = hexdec(substr($ImageBackgroundColour, 0, 2)); // use defined values
      $bkgndg = hexdec(substr($ImageBackgroundColour, 2, 2));
      $bkgndb = hexdec(substr($ImageBackgroundColour, 4, 2));
      
      $ProductImageMd5 = md5_file($ProductImageFileName);
      $ScaledImageName = 'auto-resize/api_' . $ProductImageMd5 . '_' . $DefaultProductImageWidth . '_' . $DefaultProductImageHeight
      . '_' . $ImageBackgroundColour . '_' . $ScaledImageQuality . '.jpg';
      if ( ! file_exists($ScaledImageName) )
      {
      list($errmessage, $ProductImage, $TempImageWidth, $TempImageHeight, $ProductImageType) = imageopen($ProductImageFileName);
      if ( $errmessage == '' )
      {
      $ScaledProductImage = fitandscaleimage($ProductImage, $DefaultProductImageWidth, $DefaultProductImageHeight, $bkgndr, $bkgndg, $bkgndb);
      $errmessage .= saveimageforced($ScaledProductImage, $ScaledImageName, $ScaledImageQuality);
      }
      }
      }
      
      if ( $GenerateToolTip &amp;&amp; ($errmessage == '') )
      {
      $ToolTipFileName = $ProductImageFileName;
      if ( ($ProductImageWidth != $ToolTipProductImageWidth) || ($ProductImageHeight != $ToolTipProductImageHeight) )
      {
      // we have to resize
      if (! isset($ProductImageMd5) ) $ProductImageMd5 = md5_file($ProductImageFileName);
      $ToolTipFileName = 'auto-section-thumbnails/app_' . $ProductImageMd5 . '_' . $ToolTipProductImageWidth . '_' . $ToolTipProductImageHeight
      . '_' . $ImageBackgroundColour . '_' . $ScaledImageQuality . '_' . $MakeProgressiveJpg . '.jpg';
      if (! isset($bkgndr) )
      {
      if ( strlen($ImageBackgroundColour) != 6 ) $ImageBackgroundColour ='ffffff'; // use white as default
      $bkgndr = hexdec(substr($ImageBackgroundColour, 0, 2)); // use defined values
      $bkgndg = hexdec(substr($ImageBackgroundColour, 2, 2));
      $bkgndb = hexdec(substr($ImageBackgroundColour, 4, 2));
      }
      if ( ! file_exists($ToolTipFileName) )
      {
      if ( ! isset($ProductImage) )
      {
      list($errmessage, $ProductImage, $TempImageWidth, $TempImageHeight, $ProductImageType) = imageopen($ProductImageFileName);
      }
      if ( $errmessage == '' )
      {
      $ScaledToolTipImage = fitandscaleimage($ProductImage, $ToolTipProductImageWidth, $ToolTipProductImageHeight, $bkgndr, $bkgndg, $bkgndb);
      if ( $MakeProgressiveJpg ) imageinterlace($ScaledToolTipImage, 1);
      $errmessage .= saveimageforced($ScaledToolTipImage, $ToolTipFileName, $ScaledImageQuality);
      }
      }
      }
      }
      
      if ( $errmessage == '' )
      {
      // generate the IMG tag
      echo "&lt;img src=\"$ScaledImageName\" border=\"0\" width=\"$DefaultProductImageWidth\" height=\"$DefaultProductImageHeight\"";
      echo " alt=\"&lt;actinic:variable name="ProductName" selectable="false" /&gt;\"";
      if ( $GenerateToolTip )
      {
      echo " onmouseover=\"ddrivetip('$ProductName','$ToolTipFileName','',$ToolTipProductImageWidth,$ToolTipOffsetX,$ToolTipOffsetY);\"";
      echo " onmouseout=\"hideddrivetip();\"";
      }
      echo "/&gt;";
      }
      else
      {
      echo "&lt;font color=red&gt;ERROR: $errmessage - $ScaledImageName &lt;/font&gt;";
      }
      &lt;/actinic:block&gt;
      
      &lt;actinic:block if="%3cactinic%3avariable%20name%3d%22IsProductImageDisplayed%22%20%2f%3e"&gt;
      &lt;actinic:variable name="PinterestButtonLayout" value="Product Pin It Button Layout" /&gt;
      &lt;/actinic:block&gt;
      Jonathan Chappell
      Website Designer
      SellerDeck Website Designer
      Actinic to SellerDeck upgrades
      Graphicz Limited - www.graphicz.co.uk

      Comment


        #4
        Solved! Switching to Tabular Search Result from Standard Search Result solved the problem!
        Jonathan Chappell
        Website Designer
        SellerDeck Website Designer
        Actinic to SellerDeck upgrades
        Graphicz Limited - www.graphicz.co.uk

        Comment

        Working...
        X