Announcement

Collapse
No announcement yet.

Customising Search Results

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

    Customising Search Results

    I have set up an RRP variable that I want to show on my filter and search results, nearly all of our products are reduced so it is crucial that I can show the customer the rrp without them actually having to go into a product.

    While this works fine on sections not using filters I am having difficulty adding it to filter and search results. I have tried simply adding it as a variable to the "tabular search result" layout but nothing shows when published. Does any one know of a way I can either get my rrp variable to show or an alternative method of showing the rrp (really don't want to have to add it into the product name for cosmetic reasons).

    Thanks Ben

    #2
    Your RRP variable won't be accessible to the search results.

    However you can add a JavaScript structure to the search results that associates the Product ID with your variables value.
    Here's how:

    Add the following to the top of layout "Search Results Page Bulk Area":
    Code:
    <!-- add JavaScript RRP structure -->
    <script type="text/javascript">
    	var rn = new Object();
    	<actinic:block type="EntireSectionList"><actinic:block type="ProductList"><actinic:block if="%3cactinic%3avariable%20name%3d%22ProductType%22%20%2f%3e%20%3c%202">rn['<actinic:variable name="ProductID" encoding="perl" selectable="false" />']='<actinic:variable name="MyRRP" encoding="perl" selectable="false" />';</actinic:block></actinic:block></actinic:block>
    	
    	function showrrp(pid){
    		if(rn[pid]) document.write(' RRP ' + rn[pid]);
    	}
    </script>
    N.B. Change the MyRRP to whatever variable name you use.

    Edit file SearchScript.pl (in your Site folder) and look for the line:
    Code:
    		$ACTINIC::B2B->SetXML('S_ITEM', ($nCount + 1));
    Add the following below it:
    Code:
    		$ACTINIC::B2B->SetXML('S_PID', $$rarrResults[$nCount]);		# Norman save ID
    In your Search Results layout (e.g. Standard Search Result) where you want the RRP to show, put:
    Code:
    <script type="text/javascript">showrrp('<Actinic:S_PID/>');</script>
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Thanks Norman, I have done as you said but an error is appearing. "A JavaScript error has been found on the page ('Object expected')."

      Any ideas?

      Comment


        #4
        Code works for me. If you're able to upload and point me to the live site that will help.
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          Here is the site, as you will see it is halfway through being built but you will get the idea of where it should sit on the filter results.

          http://www.theskitest.co.uk/cgi-bin/...&Action=Search

          Comment


            #6
            It's working. Search for "K2 AMP" and see!

            You'll need to tweak the code to put in a £ sign.
            Norman - www.drillpine.biz
            Edinburgh, U K / Bitez, Turkey

            Comment


              #7
              Thanks Norman, it is showing on some products but not all! Nearly everything is in the sale with an RRP at the minute but only some show it! How do I now make this show on filter results as that is where I was looking to see it before? Thanks, Ben

              Comment


                #8
                You are probably experiencing this bug. Wait for V12.0.2 where it should be fixed.
                Norman - www.drillpine.biz
                Edinburgh, U K / Bitez, Turkey

                Comment


                  #9
                  I have a similar issue where there is a variable SummaryText which places a short summary in the product summary layout rather than the sometimes lengthy product description.

                  http://www.graphicz.gb.com/mtye/acatalog/earphones.html

                  I would like this SummaryText to appear in Filtered Search Results as filtering is used heavily to populate sections on the site in question.

                  I implemented the above fix and placed the code at the top of the Tabular Filter Results layout but on upload the Summary text appears until the loading graphic appears, then vanishes! I remember having a similar issue with something else but regret I can't remember it just now.

                  Test site: Go to : http://www.graphicz.gb.com/mtye/ and click one of the boxes - IN2UIT for example - below the Nivo Slider,

                  How can I make my SummaryText stay put?

                  This is v 12.0.2

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

                  Comment


                    #10
                    The JavaScript structure is being generated and is used when after loading each product line to display the extra text.

                    This would be fine for ordinary search results as that's all that happens.

                    However the re-ordering of the results that happens when the page fully loads and the filtering / sorting code kicks in is overwriting the earlier generated stuff. There's a massive amount of SD code involved, and several hours work (at least) to overcome, so way beyond what I can do on this Forum.
                    Norman - www.drillpine.biz
                    Edinburgh, U K / Bitez, Turkey

                    Comment


                      #11
                      Thank you Norman.

                      Perhaps the developers can offer some guidance?

                      Or if several of us think it is a good idea we could club together to commission the work?
                      Jonathan Chappell
                      Website Designer
                      SellerDeck Website Designer
                      Actinic to SellerDeck upgrades
                      Graphicz Limited - www.graphicz.co.uk

                      Comment


                        #12
                        php doesn't work in the filtered results either
                        Jonathan Chappell
                        Website Designer
                        SellerDeck Website Designer
                        Actinic to SellerDeck upgrades
                        Graphicz Limited - www.graphicz.co.uk

                        Comment


                          #13
                          Best I can come up with is this if it helps anyone:

                          In Tabular Search Result look for
                          Code:
                          <actinic:block if="%3cactinic%3avariable%20name%3d%22SearchResultShowsDescription%22%20%2f%3e"><p class="product-text"><actinic:variable name="SearchResultFullDescription" /></p></actinic:block>
                          and amend it to

                          Code:
                          <actinic:block if="%3cactinic%3avariable%20name%3d%22SearchResultShowsDescription%22%20%2f%3e"><div><div style="height:100px; overflow: hidden;">
                              <p class="product-text"><actinic:variable name="SearchResultFullDescription" /></p></div>... Click more info button:</div>
                          </actinic:block>
                          However, different browsers seem to cut off lines at different heights, so the following can be used:

                          Code:
                          <actinic:block if="%3cactinic%3avariable%20name%3d%22SearchResultShowsDescription%22%20%2f%3e"><div><div id="filterheight">
                              <p class="product-text"><actinic:variable name="SearchResultFullDescription" /></p></div><span style="font-size:16px;color:#227FBA;">... Click more info button:</span></div>
                          </actinic:block>
                          CSS to add to Page Head
                          Code:
                          <style type='text/css'>
                          /*This will work for chrome */
                                              #filterheight
                                              {
                                                  height:98px; overflow: hidden;;
                                              }
                          /*This will work for firefox*/
                                              @-moz-document url-prefix() {
                                                  #filterheight{
                                                  height:103px; overflow: hidden;
                                              }
                                              }
                                          </style>
                                          <!--[if IE]>
                                          <style type='text/css'>
                          /*This will work for IE*/
                                          #filterheight
                                          {
                                              height:99px; overflow: hidden;
                                          }
                                          </style>
                                          <![endif]-->
                          Last edited by graphicz; 15-Jul-2013, 06:32 PM. Reason: Add browser specific styling
                          Jonathan Chappell
                          Website Designer
                          SellerDeck Website Designer
                          Actinic to SellerDeck upgrades
                          Graphicz Limited - www.graphicz.co.uk

                          Comment


                            #14
                            The Search and Filtering Settings 'Results' tab give the option to tick to include 'Properties' in the filtered search results.

                            I ticked it and none of the data entered in to properties dialogue of product details showed.

                            The properties tag seems to be a placeholder for user defined variables but neither Support or I can work out where to set the value for the variable. When the box is ticked all that shows in the filtered search results layout is <p class="product-text"></p> whatever I put in properties.

                            Where is this elusive Properties value defined?????

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

                            Comment


                              #15
                              I've had a good poke around now and have a VERY complex workaround. Custom code needed in JavaScript Header Functions, Tabular Search Result, Filtered Product Summary, actinicsearch.js and SearchScript.pl! And this code needs to be hard-coded for the Variables you want to display. No general solution.

                              It seems that a 2 different layouts are used on what looks like the same page. E.g. on the Demo Store / Necklaces page, it first displays using layout Products / Filtered Product Summary, pretty much as static HTML.

                              Click any of the filter check-boxes and the page redisplays, this time using layout Search Results / Tabular Search Result but with this layout processed by actinicsearch.js as each product is put on the page.

                              Even worse the normal pages were displaying prices inc-vat, filtered pages were displaying prices ex-vat and if you cleared the filter they went back to inc-vat. There's a setting to make the Search Results (and Filtered Products) display prices inc-vat but it's a rather confusing out of the box experience.
                              Norman - www.drillpine.biz
                              Edinburgh, U K / Bitez, Turkey

                              Comment

                              Working...
                              X