toolkit Math_Subtract not working for me : (

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ThePen
    Mini Mivite

    • Dec 2012
    • 33

    #1

    toolkit Math_Subtract not working for me : (

    Hey Guys,

    I'm trying to show the difference in price/savings on the category product display for products that are on sale. I'm having trouble getting the math_subtract toolkit function working properly, could some one please check out my code and let me know, where I went wrong, any help would be greatly appreciated :)

    Code:
                     <mvt:if expr="NOT ISNULL l.settings:product:customfield_values:customfields:msrp">
                     <mvt:item name="toolkit" param="math_subtract|difference|l.settings:category_listing:products:customfield_values:customfields:msrp;|l.all_settings:product:price" />
                     <mvt:item name="toolkit" param="currencyformat|formatted_savings|difference" />
                    <div class="product-savings">Savings: &mvt:global:formatted_savings;</div>
                    </mvt:if>
  • wcw
    Developer Partner

    • Mar 2006
    • 11329

    #2
    Re: toolkit Math_Subtract not working for me : (

    In the first line l.settings is correct. In the second line there are two variables. Both should be l.all_settings, not l.settings.
    Bill Weiland - Emporium Plus http://www.emporiumplus.com/store.mvc
    Online Documentation http://www.emporiumplus.com/tk3/v3/doc.htm
    Question http://www.emporiumplus.com/mivamodu...vc?Screen=SPTS
    Facebook http://www.facebook.com/EmporiumPlus
    Twitter http://twitter.com/emporiumplus

    Comment

    • PCINET - Andreas
      Developer Partner




      • Mar 2006
      • 2439

      #3
      Re: toolkit Math_Subtract not working for me : (

      When using toolkit or toolbelt functions always use l.all_settings! For storemorph always use l.settings :)
      Andreas Toman
      PCINET, LLC

      Miva Merchant Design, Development, Integration & Support
      We built over 200 Miva Merchant stores!
      Miva shopping cart design & integration service and see our Portfolio!


      e-mail: [email protected]
      web: www.pcinet.com
      LinkedIn: Andreas Toman
      phone: (786) 250-2056 (Miami, FL)

      Comment

      • ThePen
        Mini Mivite

        • Dec 2012
        • 33

        #4
        Re: toolkit Math_Subtract not working for me : (

        I made the change you suggested and it's not subtracting correctly, I have $16.00 as the "suggested retail price" and $13.98 for the "price", the difference should be $2.02 . . . I'm not sure of what I'm doing wrong, I'm sure its a small detail. I appreciate the help so far, anymore suggestions on this guys? The code below is what i'm using now.

        Code:
        <mvt:if expr="NOT ISNULL l.settings:product:customfield_values:customfields:msrp">
                         <mvt:item name="toolkit" param="math_subtract|difference|l.all_settings:category_listing:products:customfield_values:customfields:msrp|l.all_settings:product:price"/>
                        <div class="product-savings">Savings:&mvt:global:difference;</div>
                        </mvt:if>
        Last edited by ThePen; 11-23-13, 08:32 PM.

        Comment

        • ThePen
          Mini Mivite

          • Dec 2012
          • 33

          #5
          Re: toolkit Math_Subtract not working for me : (

          Thanks!, I always wondered when to use which! :) I'm still having trouble with this one, I did the change but my math is incorrect . . . it prints 20 to the screen instead of $2.02, my price is $13.98 and the "suggest retail price" is $16.00, I have not a clue why it's not working

          Comment

          Working...
          X