Announcement

Collapse
No announcement yet.

Linking Recent Viewed to Extended Info

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

    Linking Recent Viewed to Extended Info

    Hi
    As it says in the title. Does any know if it is possible to link recent viewed products to ext info page.

    Elliott
    Elliott - Weybridge Lights

    www.weybridgelights.co.uk

    #2
    The recently viewed items use SearchScript.pl to link to the products. This doesn't have the capability of linking to the Extended Info pages.

    There are many posts regarding linking the Search Results to the Extended Info which is a similar problem. Try searching for "Search Results Extended Info" and you'll see some.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      I did think it was the same as the search results as I did try and change the layout as I did with the related products and it failed.

      Thank you for letting me know how it works.

      Elliott
      Elliott - Weybridge Lights

      www.weybridgelights.co.uk

      Comment


        #4
        Here's a way to do this but it's only suitable for plain Catalog sites. Not useable for sites with logged-in customers.

        In your overall layout, just above the </head> tad add:
        Code:
        <actinic:block if="%3cactinic%3avariable%20name%3d%22IsStoreFrontPage%22%20%2f%3e" >
        	<actinic:block php="true">
        		$handle = fopen('pid-xinfo.js', 'w');
        		fwrite($handle, "var xl=new Object();");
        		<actinic:block type="EntireSectionList">
        			<actinic:block type="ProductList">
        				<actinic:block if="%3cactinic%3avariable%20name%3d%22IsPopUpPageGenerated%22%20%2f%3e">
        					fwrite($handle, "xl['<actinic:variable name="ProductID"/>']='<actinic:variable name="ExtendedInfoPageName" encoding="perl" selectable="false" />';");
        				</actinic:block>
        			</actinic:block>
        		</actinic:block>
        		fclose($handle);
        	</actinic:block>
        </actinic:block>
        <script type="text/javascript" src="pid-xinfo.js"></script>
        In your recent products layout, replace all:
        Code:
        <a _HREF_=
        with
        Code:
        <a onclick="if(xl['_PID_'])this.href=xl['_PID_'];" _HREF_=
        leaving the rest of the line intact.

        NOTES.

        You may also have to turn off "Highlight Located Text" in Settings / Search Settings / Results.

        This works by creating a helper file "pid-xinfo.js" that contains a list of Product ID's and Extended Info Page names. This only contains entries for products with Extended Info pages. When you click on a recently viewed product, this list is checked and the link diverts to the Extended Info page if it exists.

        This file is only created when you generate the store top page.

        It may become large on sites with many products so check its length.
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          I will have to give it a go later.
          At the moment I have about 6000 product all with ext page. So I will have to see how big the file is and is worth it or not.

          Would this work with the search results as well.

          I will post back later to tell you how it went.

          Thanks

          Elliott
          Elliott - Weybridge Lights

          www.weybridgelights.co.uk

          Comment


            #6
            The helper file will only need loaded once when a visitor first arrives. After that it will be loaded from their browser cache.

            Size of file will be roughly

            number_of_products * (productID_length + Extended_Info_page_filename_length + 10)

            The helper file would also be usable with the search results. Similar JavaScript would need added to the search result links.
            Norman - www.drillpine.biz
            Edinburgh, U K / Bitez, Turkey

            Comment


              #7
              Originally posted by NormanRouxel View Post

              It may become large on sites with many products so check its length.
              What would you say is a big file or what would your max file size be.


              Thanks
              Elliott - Weybridge Lights

              www.weybridgelights.co.uk

              Comment


                #8
                Over 250Kb might slow down initial visitors but will have negligible effect on their viewing subsequent pages.

                If you have 6000 products, each with an extended info page then that allows for 250 / 6 characters per item so you could have 40 chars of product ID and page name. Might be OK.
                Norman - www.drillpine.biz
                Edinburgh, U K / Bitez, Turkey

                Comment


                  #9
                  Hi
                  Thanks you for the info. Will post back soon.

                  Elliott
                  Elliott - Weybridge Lights

                  www.weybridgelights.co.uk

                  Comment


                    #10
                    I have just added this to my site and it works a treat. The file is 158k. Not sure is that is to big, but will have to do some testing.

                    Now got to work out if we can do the search results with the same file.

                    Thanks Norman - Top class !!!!!!
                    (Actinic need you to work for them and get some your great work around into actinic)

                    Elliott
                    Elliott - Weybridge Lights

                    www.weybridgelights.co.uk

                    Comment


                      #11
                      That's possible. We can turn the product anchor on the Search result links into the Product ID and lookup that. Here's how:

                      Edit layout "Search Results Page Bulk Area" and look for the line:
                      Code:
                      			<actinic:variable name="SearchResultsList" />
                      Replace with:
                      Code:
                      			<span id="allsearchresults">
                      				<actinic:variable name="SearchResultsList" />
                      			</span>
                      			<script type="text/javascript">
                      				function gotoextended(anc){
                      					var bits = anc.href.match(/.*\#(.*)/);		// extract anchor
                      					if ( bits != null )
                      						{
                      						var pid = unescape(bits[1].substring(1).replace(/_/g,'%'));	// convert anchor into product ID
                      						if ( xl[pid] ) anc.href = xl[pid];		// if Ext Info page, go to it
                      						}
                      					return true;	
                      				}
                      				// add an onclick to all search results links that looks for the extended info page
                      				var slinks = document.getElementById('allsearchresults').getElementsByTagName('A');
                      				for (var i=0; i<slinks.length; i++)
                      					{
                      					slinks[i].onclick = function(){gotoextended(this);};
                      					}
                      			</script>
                      Norman - www.drillpine.biz
                      Edinburgh, U K / Bitez, Turkey

                      Comment

                      Working...
                      X