Announcement

Collapse
No announcement yet.

Creating Alternative Message in "Select Shipping Destination"

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

    Creating Alternative Message in "Select Shipping Destination"

    Select Shipping Destination is in Checkout Page 0. The standard message is "If you want the delivery address to be different from the invoice address, please check this box". To the right there is a check box.

    Now for my problem;

    Stihl products cannot be delivered by courier to the customer (because they require a safety demonstration)

    When there are ONLY Stihl products in the basket I want to REPLACE the standard text and check box with the following: Your basket contains STIHL products which will be delivered direct to our premises in Melksham, Wilts for customer collection and a product safe handling demonstration."

    If there are both Stihl products and other products in the basket, I want to insert some additional text after the standard text and check box as follows: " Your basket contains STIHL products which will be delivered direct to our premises in Melksham, Wilts for customer collection and a product safe handling demonstration."

    When there are NO Stihl products in the basket, I want only the standard text and check box to appear.

    I have tried in vain for hours to achieve this and "Teddy" is now firmly in the corner!

    I am using Actininc Business V9

    I would be grateful if anyone can solve this for me.

    #2
    Firstly are you advising on the Stihl product page that they are not allowed to be sold on the Internet to non trade/qualified users so that when it comes to checkout they are not suddenly made aware of that restriction late in the process?

    Then, assuming your Stihl products have a suitable unique means of identification during the checkout process, for example if ONLY your Stihl products have the exact word Stihl in its product names or maybe unique starting product reference for all Stihl items eg: STIHL-123456, then you could use Java Script to display a hidden div if one or more macthing products are listed in the cart at checkout time.

    Some ideas.

    Comment


      #3
      Ian's JavaScript solution would be a good way to go. Lets assume that either your Product ID's or names for such products will contain "Stihl" (n.b. case sensitive).

      If you look in layout Cart Product Details there are ProdRef and ProductNameOnline items that display the Product Reference and Product Name respectively.

      Surround them with <span class="prodinfotag"> and </span>.

      Now on the appropriate checkout page, below the cart display, you could have some jQuery code (you'd also need to load jQuery). Like:
      Code:
      <div id="stihlwarning" style="display:none">Your basket contains STIHL products.....</div>
      <script type="text/javascript">
      if ( $( ".prodinfotag:contains('Stihl')" ).length ) $( "#stihlwarning" ).show();
      </script>
      N.B. Code above is untested.
      Norman - www.drillpine.biz
      Edinburgh, U K / Bitez, Turkey

      Comment


        #4
        Originally posted by NormanRouxel View Post
        Ian's JavaScript solution would be a good way to go. Lets assume that either your Product ID's or names for such products will contain "Stihl" (n.b. case sensitive).

        If you look in layout Cart Product Details there are ProdRef and ProductNameOnline items that display the Product Reference and Product Name respectively.

        Surround them with <span class="prodinfotag"> and </span>.

        Now on the appropriate checkout page, below the cart display, you could have some jQuery code (you'd also need to load jQuery). Like:
        Code:
        <div id="stihlwarning" style="display:none">Your basket contains STIHL products.....</div>
        <script type="text/javascript">
        if ( $( ".prodinfotag:contains('Stihl')" ).length ) $( "#stihlwarning" ).show();
        </script>
        N.B. Code above is untested.
        Many thanks Norman.

        I tried the code in your example, updating Card Product details as instructed and placing the Javascript code in the Checkout Page 0, but nothing was displayed. The Product Name contains the word "Stihl".

        Do you have any other thoughts please?

        Comment


          #5
          Do you have any other thoughts please?
          Not without a link to the page in question. And a note re how to add some Stihl products.
          Norman - www.drillpine.biz
          Edinburgh, U K / Bitez, Turkey

          Comment


            #6
            P.S. If your site is www.morethanmowers.co.uk then you have some of my add-ons, and these already load jQuery. So you only need the code in post #3 above.
            Norman - www.drillpine.biz
            Edinburgh, U K / Bitez, Turkey

            Comment


              #7
              Originally posted by NormanRouxel View Post
              Not without a link to the page in question. And a note re how to add some Stihl products.
              Norman,
              Here is the link to the live site with 1 x Stihl chainsaw:

              http://www.morethanmowers.co.uk/acat...l#.UwYlLfl_t8F

              Below is the code from the relevant part of the Checkout Page 0 if that helps

              <h2 class="checkout"><Actinic:Variable Name="DeliveryLocationTitle"/></h2>

              <table border="1" width="<actinic:variable name="ACTSTDWIDTH" />" cellspacing="1" cellpadding="3">
              <tr>
              <td width="33%"><span class="actrequired"><Actinic:Variable Name="LocationPrompt"/></span></td>
              <td width="34%"><Actinic:LOCATION TYPE="DELIVERSELECTCOUNTRY"><actinic:variable name="DeliveryCountryList" /></Actinic:LOCATION></td>
              <td width="33%"><Actinic:LOCATION TYPE="DELIVERSELECTSTATE"><actinic:variable name="DeliveryStateList" /></Actinic:LOCATION></td>
              </tr>
              <actinic:block name="IsLocationInvoiceShipSeparately"><actinic:block if="%3cactinic%3avariable%20name%3d%22InvoicePrompt016Visible%22%20%2f%3e">

              <!-- Norman Rouxel Code Here -->
              <div id="stihlwarning" style="display:none">Your basket contains STIHL products.....</div>

              <script type="text/javascript">
              if ( $( ".prodinfotag:contains('Stihl')" ).length ) $( "#stihlwarning" ).show();
              </script>
              <!-- end of Norman Rouxel Code -->

              <!-- below is the standard shipping box code -->
              <tr>
              <td colspan="2" valign="top"><Actinic:Variable Name="InvoicePrompt016"/></td>
              <td valign="top"><input type="checkbox" <Actinic:Variable Name="InvoiceSeparateCheckStatus"/> name="SEPARATESHIP" value="YES"/></td>
              </tr>
              <!-- end of shipping code -->

              </actinic:block></actinic:block>
              <tr>
              <actinic:block if="%3cactinic%3avariable%20name%3d%22InfoRequiredForDeliveryPostCode%22%20%2f%3e" >
              <td width="33%"><span class="actrequired"><actinic:variable name="DeliverPrompt008" /></span></td>
              <td width="34%"><input type="text" name="DELIVERPOSTALCODE" size="10" maxlength="12" value="<Actinic:Variable Name="DeliverPostalCode"/>" /></td>
              </actinic:block>
              <actinic:block if="%3cactinic%3avariable%20name%3d%22InfoRequiredForDeliveryResidential%22%20%2f%3e" >
              <td width="33%"><Actinic:Variable Name="ResidentialPrompt"/><input type="checkbox" name="DELIVERRESIDENTIAL" <Actinic:Variable Name="DeliverResidential"/> /></td>
              </actinic:block>
              </tr>
              </table>

              Comment


                #8
                Norman - yes thank you - I have jQuery installed.

                Comment


                  #9
                  There is no sign of you doing his bit:
                  If you look in layout Cart Product Details there are ProdRef and ProductNameOnline items that display the Product Reference and Product Name respectively.

                  Surround them with <span class="prodinfotag"> and </span>
                  And you've positioned:
                  Code:
                  <!-- Norman Rouxel Code Here -->
                  ...
                  <!-- end of Norman Rouxel Code -->
                  Within a blockIf so it may not show. And not within a TD cell so it won't display ever. Put it somewhere that always displays (within a TD and put some visible text in to be sure).

                  Note that my code is NOT doing all 3 things you want. It is only displaying a single message if some Stihl things are in the cart and hiding that message if there are no Stihl at all.
                  Norman - www.drillpine.biz
                  Edinburgh, U K / Bitez, Turkey

                  Comment


                    #10
                    Originally posted by NormanRouxel View Post
                    There is no sign of you doing his bit:


                    And you've positioned:
                    Code:
                    <!-- Norman Rouxel Code Here -->
                    ...
                    <!-- end of Norman Rouxel Code -->
                    Within a blockIf so it may not show. And not within a TD cell so it won't display ever. Put it somewhere that always displays (within a TD and put some visible text in to be sure).

                    Note that my code is NOT doing all 3 things you want. It is only displaying a single message if some Stihl things are in the cart and hiding that message if there are no Stihl at all.
                    Norman,

                    Thank you - you are a genius! You have helped my several times before for which I say "thank you" again.

                    I have got it all working now and am just fiddling with refinements.

                    Many thanks

                    Comment


                      #11
                      Assuming it's only the Product Name that contains the required text, then you can remove the <span class="prodinfotag"> and </span> from the ProdRef line. So now only product lines in the cart have class prodinfotag.

                      Now in the JavaScript.
                      Code:
                      var totalLinesInCart = $( ".prodinfotag" ).length;
                      Sets the total number of products.

                      And:
                      Code:
                      var stihlLinesInCart = $( ".prodinfotag:contains('Stihl')" ).length;
                      will set the number of Stihl products in the Cart.

                      So you could do some conditional code that detects no Stihl, only Stihl or no Stihl by comparing these 2 new variables.
                      Norman - www.drillpine.biz
                      Edinburgh, U K / Bitez, Turkey

                      Comment


                        #12
                        Dear Norman,

                        Thank you again for your further suggestion which I shall try later today.

                        Comment


                          #13
                          Dear Norman,

                          I have tried in vain to write the code for this but my knowledge of JavaScript is very thin and even thinner on integrating it with html.

                          May I please pay you for the solution?

                          The lines of code (after removing my pathetic efforts) are as follows:

                          Code:
                          <table border="0" width="<actinic:variable name="ACTSTDWIDTH" />" cellspacing="1" cellpadding="3">
                          <tr>
                             <td width="33%"><span class="actrequired"><Actinic:Variable Name="LocationPrompt"/></span></td>
                             <td width="34%"><Actinic:LOCATION TYPE="DELIVERSELECTCOUNTRY"><actinic:variable name="DeliveryCountryList" /></Actinic:LOCATION></td>
                             <td width="33%"><Actinic:LOCATION TYPE="DELIVERSELECTSTATE"><actinic:variable name="DeliveryStateList" /></Actinic:LOCATION></td>
                          </tr>
                          <tr>
                          	<td colspan="3"><div id="stihlwarning" style="display:none"><b>N.B.</b> Your basket contains STIHL products which are subject to <b>DELIVERY RESTRICTIONS</b>. <a href="javascript:openWindow('http://www.morethanmowers.co.uk/acatalog/Stihl_Ordering_and_Delivery_Rules.html')";>CLICK HERE FOR FURTHER INFORMATION</a></div></td>
                          	<td colspan="3"><script type="text/javascript">
                          		if ( $( ".prodinfotag:contains('Stihl')" ).length ) $( "#stihlwarning" ).show();	
                          </script></td>
                          </tr>
                          <tr>
                          	<td><div>  <script type="text/javascript">
                          	var separateInvoice;
                          	var stihlLinesInCart = $( ".prodinfotag:contains('Stihl')" ).length;
                          	var prodLinesInCart = $( ".prodinfotag" ).length;
                          	if (prodLinesInCart > stihlLinesInCart)	{
                          		var separateInvoice = 1;
                          		}else{
                          		var separateInvoice = 0;
                          	}
                          	</script></div>
                          <actinic:block name='IsLocationInvoiceShipSeparately'><actinic:block if='%3cactinic%3avariable%20name%3d%22InvoicePrompt016Visible%22%20%2f%3e'>
                          	<tr>
                          		<td colspan=2 valign='top'><Actinic:Variable Name='InvoicePrompt016'/></td>
                          		<td valign='top'><input type='checkbox' <Actinic:Variable Name='InvoiceSeparateCheckStatus'/> name='SEPARATESHIP' value='YES'/></td>
                          	</tr>
                          </actinic:block></actinic:block>
                          It is InvoicePrompt16 and InvoiceSeparateCheckStatus that I want to hide when nothing but Stihl products are in the checkout basket, otherwise it should always appear. When Stihl products are in the basket, without or without other products, the Stihl waring should appear. This latter part is working fine.

                          Many thanks,

                          Mike

                          Comment


                            #14
                            I'm away for the weekend and cannot look at this until Monday.

                            If you email me (click my name to the left) then I can get enough info to be able to quote.
                            Norman - www.drillpine.biz
                            Edinburgh, U K / Bitez, Turkey

                            Comment


                              #15
                              Norman,

                              I am just checking that you got my email yesterday. I am off for a week to France tomorrow evening. If you have a chance to quote/do the work before then, that would be great. No problem if that is not possible.

                              Comment

                              Working...
                              X