Announcement

Collapse
No announcement yet.

VAT inclusive Prices on Related Items in the Shopping Cart

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

    VAT inclusive Prices on Related Items in the Shopping Cart

    I cannot find a way of displaying the prices on "Related or Also Bought" items in the shopping cart inclusive of VAT - they appear in a table below the items already in the shopping cart.

    I cannot even understand why on earth the default price should be for them to display exclusive of VAT - I think it is misleading!

    As usual, I have probably missed something. Can anyone assist please?

    Many thanks,

    Mike de Malpas

    #2
    Prices are usually added to layouts but they are set to use a fixed layout and not change as per the choices made in site options for example. It's usually just a case of unfixing the layout used and then selecting the one you want to use. Although, i'm not sure i have seen the marketing lists with prices in the cart and checkout process, so have you got an example you can show us?

    Comment


      #3
      Hi Lee,

      Here is an example at http://www.morethanmowers.co.uk/acat...er.html#aHA619

      You will see that the Related Product prices shown on the Product page are inclusive of VAT but when in the shopping cart - shown under the items in the cart, the prices are exclusive of VAT

      Norman gave me some code a year ago to convert exclusive VAT prices to inclusive VAT prices ....

      <actinic:block php="true">
      $aspriceraw = '<actinic:variable encoding="perl" name="AssociatedProduct::ProductPriceRaw" selectable="false" />';
      if ( $aspriceraw > 0 ) formattedcurrency(1.15 * $aspriceraw, 2, '.', ',', ' + £');
      </actinic:block>

      Admittedly this was for component prices shown on the product page. I have fiddled around with this to try to get it to work with product rather than associated product prices but get a message saying that ProductPriceRaw is a variable that is not available for use in the Shopping Cart.

      Any advice would be welcome

      Thanks,

      Mike de Malpas

      Comment


        #4
        I'm still a little lost how the price is getting there in the first place, unless i'm going mad, i've not seen that before. Are you sure it isn't your code adding this price and therefore that just needs tweaking? Can you show the code that's doing the price adding in for you?

        Comment


          #5
          This is the code in the shopping cart:

          <!-- Related Products list begin-->
          <Actinic:REMOVE TAG="RelatedProductLine">
          <table width="<actinic:variable name="ACTSTDWIDTH" />" cellspacing="2" cellpadding="3" border="0">
          <tr>
          <th align="center" colspan="2" class="cartheading"><strong>YOU MAY ALSO BE INTERESTED IN THESE USEFUL RELATED PRODUCTS:</strong></th>
          </tr>
          </table>
          <!-- Also bought list row begin-->
          <table width="100%" cellspacing="2" cellpadding="3" border="0" align="center">
          <tr>
          <Actinic:XMLTEMPLATE NAME="RelatedProductLine">
          <td width="25%" valign="top">
          <table cellspacing=0 cellpadding=0 border=0 align="center" width=100% height=145>
          <tr>
          <td valign="top">
          <p><actinic:variable name="ProductNameOnline" /></p>
          <h3 class="product_price"><actinic:variable name="ProductPriceDescription" /> <Actinic:Variable Name="Price"/> <font size=1>[Excluding VAT]</font></h3>
          <p><Actinic:REMOVE TAG="ImageLine"><img border="0" src="<actinic:variable name="Thumbnail" />" <!--<actinic:variable name="ThumbnailSize" />--> title="<actinic:variable name="ProductNameOnline" />" alt="<actinic:variable name="ProductNameOnline" />"/></Actinic:REMOVE></p>
          </td>
          </tr>
          </table>
          <table cellspacing=0 cellpadding=0 border=0 align="center" width=100%>
          <tr>
          <td valign="top" class="text_product_small_info"><!--<p class="text_product_small_info">--><a href="<actinic:variable name="SearchCGIURL" />?PRODREF=<Actinic:Variable Name="ProdRef"/>&amp;NOLOGIN=1<actinic:block if="%3cactinic%3avariable%20name%3d%22HiddenFields%22%20%2f%3e%20%21%3d%20%22%22">&amp;SHOP=<Actinic:Variable Name="HiddenFields"/></actinic:block>">
          FIND OUT MORE</a><!--</p>-->
          </td>
          </tr>
          </table>
          </td>
          </Actinic:XMLTEMPLATE>
          </tr>
          </table>
          <!--<hr align="left" width="<actinic:variable name="ACTSTDWIDTH" />" />-->
          </Actinic:REMOVE>
          <!-- Related products list end-->

          Comment


            #6
            VAT inclusive Prices on Related Items in the Shopping Cart

            Lee - any ideas please?

            Thanks

            Mike

            Comment


              #7
              PHP won't do this as it's on a Perl generated page.

              JavaScript (or a Perl hack) will be needed. Here's the JavaScript one.

              In layout Related Products In Shopping Cart, use:
              Code:
              <script type="text/javascript">
              	pp = '<actinic:variable name="Price" />'.replace(/&#38;#44;/g, '');
              	pp = pp.replace(/&#38;#163;(\d+)&#38;#46;(\d\d).*/, "$1.$2") * 1.15;
              	if ( pp != 0 ) document.write('£' + pp.toFixed(2));
              </script>
              Note that this omits the price if it's 0 (e.g. a product that depends on Components for its price).
              Norman - www.drillpine.biz
              Edinburgh, U K / Bitez, Turkey

              Comment


                #8
                Norman,

                Many thanks for this but I cannot get the code to work. I have tried it out of Actinic by substituting the Actinic Price code with a straight number and it does not work.

                In Actinic it does produce a price but it bears no resemblance to the product price with or without VAT.

                I have double checked that I have copied and pasted your code correctly.

                Any further thoughts please?

                Many thanks
                Mike de Malpas

                BTW - your other code we recently purchased off you works a dream - thank you.

                Comment


                  #9
                  Oh - dear - it still gives the same result - i.e. the prices are nonsense e.g. £4.50 including VAT for a roller that costs £85 with VAT.

                  This is the test site with the URL of the machine in question.

                  http://www.morethanmowers.co.uk/acat...ary_Mower.html

                  Thanks so much for trying to help

                  Mike

                  Comment


                    #10
                    Hi, Mike

                    Ooops. It was only picking up the last leading digit of the price. I only had low priced items so didn't see the problem.

                    I've fixed post #7. Try the code there now. Note that this is for UK prices only as it looks for encoded £n.nn type patterns.
                    Norman - www.drillpine.biz
                    Edinburgh, U K / Bitez, Turkey

                    Comment


                      #11
                      Norman - well done - cracked it - that works a treat!!

                      Many many thanks.

                      Mike

                      You should be selling all this great code to Actinic so that it becomes standard!!!

                      Comment


                        #12
                        Here's a cleaner and more maintainable version.

                        Edit layout Related Products In Shopping Cart.

                        Put the following code at the very top of that layout:
                        Code:
                        <script type="text/javascript">
                        function vincprice(pp){
                        	// pp contains e.g. &#38;#163;1&#38;#44;234&#38;#46;56 (displays as £1,234.56) we want 1234.56 and the currency symbol
                        	var cs = pp.replace(/(&#\d+;).*/, "$1");	// collect currency symbol
                        	pp = pp.replace(/&#\d+;/g, '') / 100 * 1.15;	// remove all special characters and do calculation
                        	if ( pp != 0 ) document.write(cs + pp.toFixed(2));
                        }
                        </script>
                        And where you want the price to display use:
                        Code:
                        <script type="text/javascript">vincprice('<actinic:variable name="Price" />');</script>
                        This should work with all currencies that use n.nn or n,nn type prices. I.e. anything with 2 digits for the pence field.
                        Norman - www.drillpine.biz
                        Edinburgh, U K / Bitez, Turkey

                        Comment

                        Working...
                        X