Announcement

Collapse
No announcement yet.

Setting condition for bounce page text

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

    Setting condition for bounce page text

    Hello, me again.

    Since changing the shopping method on my website, I have now added a bit of inline code to the bounce page with a message telling customers that an item has been added to cart and to 'View Cart' for further details.

    This works well, however I’ve discovered this same message also appears after using the contact us mailform, when the same bounce page is used to inform that an email has been sent. It also will appear if someone clicks the search icon without having entered any text first.

    Is there a way, possibly using a 'block if' condition, that I can get this 'item added to cart' message to appear just for the cart bounce page, and not where other instances of the bounce page occur.

    Thanks!

    #2
    You wouldn't be able to use a blockif as that only works on the PC before you upload the site.

    You should be able to do it in javascript. I'd assume there's some text that's unique on the bounce page for the add to cart bounce and in javascript you can test for that and add the extra message if it's there.

    Mike
    -----------------------------------------

    First Tackle - Fly Fishing and Game Angling

    -----------------------------------------

    Comment


      #3
      Wrap your message in:
      Code:
      <div id="bouncemessage" style="display:none">
      YOUR MESSAGE
      </div>
      And at the bottom of layout Bounce Page Bulk Area add
      Code:
      <script type="text/javascript">
      if ( $( "th:contains('Shopping Cart')" ).length )
      	{
      	$( "#bouncemessage" ).show();
      	}
      </script>
      So your message will be hidden except on pages with a Shopping Cart heading.
      Norman - www.drillpine.biz
      Edinburgh, U K / Bitez, Turkey

      Comment


        #4
        If your site uses v16.0.5 or above and you have a Cover or Sellerdeck 365 contract, it would be worth using the popup add to cart widget. It replaces the bounce page and is a much slicker way of doing what you want. See the Widgets Extension in the Extensions Catalogue tab in Sellerdeck. You can see it in operation on https://swift.sellerdeck.co.uk.
        Bruce Townsend
        Ecommerce Product Manager
        Sellerdeck Ecommerce Solutions

        Comment


          #5
          Norman - just had a chance to implement your solution, and it appears to work brilliantly. Thank you so much for contributing your expertise to this!
          Just one thing I’m wondering, will this still work if the page has been translated to another language, so 'shopping cart' is say 'panier'? Not a biggie, but just curious really.


          Mike - thanks for the pointers regarding JavaScript. I spent an interesting afternoon on w3schools.com trying to come up with something, and got as far as returning true or false when ca0000001 was in the URL, but got a bit stuck after this! Still a useful exercise for a JavaScript newbie.


          Bruce - thank you for this, I have tested it out and it seems like an elegant solution. I don’t currently have a cover contract and may stick with 16.04 until PSP protocols demand otherwise, but it’s good to know that this bonus will exist when I do next upgrade.

          Comment


            #6
            I looked at the source of a page after it had been translated (via the Google Chrome browser) and the original language was there. So it looks like there will be no issues. Also, the bit of JavaScript runs well before the whole document has loaded so should only see the original text.
            Norman - www.drillpine.biz
            Edinburgh, U K / Bitez, Turkey

            Comment


              #7
              Great, I had a feeling that would probably be the case, but good to have confirmation.

              Thanks again.

              Comment


                #8
                I did a further test using Google Translate. The JavaScript that runs while the page is loading sees the original text. However once translate does its stuff the text nodes on the page get replaced by the foreign language. Here's an alternative fix that avoids the problem:

                Wrap your message in:
                Code:
                <div id="bouncemessage" style="display:none">
                	YOUR MESSAGE
                </div>
                In layout View Cart Page Shopping Cart Grid, replace line:
                Code:
                <table class="checkout"><tr><th><Actinic:Variable Name="CartCaption"/></th></tr></table>
                With:
                Code:
                <table class="checkout"><tr><th id="carttablehead"><Actinic:Variable Name="CartCaption"/></th></tr></table>
                And at the bottom of layout Bounce Page Bulk Area add:
                Code:
                <script type="text/javascript">
                if ( $( "#carttablehead" ).length )
                	{
                	$( "#bouncemessage" ).show();
                	}
                </script>
                So your message will be hidden except on pages with a Shopping Cart heading.
                Norman - www.drillpine.biz
                Edinburgh, U K / Bitez, Turkey

                Comment


                  #9
                  Thanks Norman, interesting about those text nodes! However I haven’t had quite as much luck with the second solution, as my 'Item added to Cart' message no longer appears at all.
                  I shall switch back to your previous implementation for now and may try a few tweaks to see if I can come up with anything else, maybe involving the URL which I guess should always contain ca000001 for the cart bounce page no matter where the customer lives.

                  Comment

                  Working...
                  X