Announcement

Collapse
No announcement yet.

Search results modification

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

  • Search results modification

    I've a new site in v18 that requires a couple of modifications to the search results so that they mimic how other pages look.
    Firstly I want to show the RRP (crossed out) next to the sale price. I've seen an old post relating to this but it's six years old so can't be sure if it is still relevant.
    Secondly I have a free shipping overlay graphic that displays on sub category pages with a conditional statement (when the weight is set to 0). The conditional statement won't work within search results so is there another way to achieve this ?
    Richard Gosler
    Pixelhaus Studios
    Dorset, UK

  • #2
    SD 2018's built-in Help has an article "How do I add my own variables to the search results page" that will be useful.

    For the shipping graphic, this may be tricky as the ShippingWeight variable isn't accessible in the Library so you can't set it to appear in the Search Results.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


    • #3
      Thanks for the info. Will check it out.
      Richard Gosler
      Pixelhaus Studios
      Dorset, UK

      Comment


      • #4
        Here's some example code that will let you add the Free Shipping overlay. It's for a site using Standard Search Results.

        In layout Standard Search Result List replace the lines:
        Code:
        <Actinic:XMLTEMPLATE NAME="ImageLine">
            <script type="text/template"><Actinic:Variable Name="SearchResultLink"/><img src="<actinic:variable name="SearchResultProductImage" />" title="<actinic:variable name="SearchResultProductName" />" <actinic:variable name="SearchResultProductImageSize" /> border="0"/></a></script>
        </Actinic:XMLTEMPLATE>
        With:
        Code:
        <Actinic:XMLTEMPLATE NAME="ImageLine">
            <script type="text/template"><Actinic:Variable Name="SearchResultLink"/><img class="srimage" data-prodref="<Actinic:S_PRODREF/>" src="<actinic:variable name="SearchResultProductImage" />" title="<actinic:variable name="SearchResultProductName" />" <actinic:variable name="SearchResultProductImageSize" /> border="0"/></a></script>
        </Actinic:XMLTEMPLATE>
        In layout Search Results Page Bulk Area RWD add the following at the bottom:
        Code:
        <style>.ShowOverlay {border:5px solid green !important}</style>
        <script type="text/javascript">
            var sw = new Object();
            <actinic:block type="EntireSectionList"><actinic:block type="SectionEntireProductList"><actinic:block if="%28%3cactinic%3avariable%20name%3d%22ProductType%22%20%2f%3e%20%3c%202%29%20%26%26%20%28%3cactinic%3avariable%20name%3d%22ShippingWeight%22%20%2f%3e%20%3d%3d%200%29" >sw['<actinic:variable name="ProductID" encoding="perl" selectable="false" />']=<actinic:variable name="ShippingWeight" encoding="perl" selectable="false" />;</actinic:block></actinic:block></actinic:block>
            $(document).ready(function(){$( "img.srimage" ).filter(function(){return sw.hasOwnProperty($(this).attr('data-prodref'))}).addClass('ShowOverlay');});
        </script>
        The <style>....</style> line is for demonstration only (it will put a green border around the image for 0 weight results) and should be replaced by whatever you use to add the overlay.

        It adds a JavaScript structure associating all Product ID's with their Shipping Weight but only for the zero weight items so this should be quite concise.
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


        • #5
          Thanks! I'l give it a go.
          Richard Gosler
          Pixelhaus Studios
          Dorset, UK

          Comment


          • #6
            With regards to showing the RRP, it has a php conditional statement around it and it's not outputting anything to the page. Is that to be expected ?
            Richard Gosler
            Pixelhaus Studios
            Dorset, UK

            Comment


            • #7
              For the RRP, all you can show is the contents of the Variable as per post #2 above. SellerDeck Conditions or PHP won't work.

              Already covered: See https://community.sellerdeck.com/for...ing-rrp-saving post #5.
              Norman - www.drillpine.biz
              Edinburgh, U K / Bitez, Turkey

              Comment


              • #8
                If you can't adapt the above to do what you want, contact me and I can quote for the small amount of custom code needed.
                Norman - www.drillpine.biz
                Edinburgh, U K / Bitez, Turkey

                Comment

                Working...
                X