We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29635
    • 361 Posts
    So you’d take:
    <input type="hidden" name="price" value="100.00" />

    And make it like this:
    <input type="hidden" name="price" value="[+phx:mo=`Resellers`:then=`[*product_price:math=`? * .80*]`:else=`[*product_price*]`+]" />


    So we’re saying:
    [+phx: ... invoke PHx
    :mo=`Resellers` ... IF the user is a MEMBER of the RESELLERS web group...
    then ... we’re gonna do some stuff...
    [*product_price:math=`? * .8`*] ... we’re saying, "output the product price multiplied by 0.8"
    else ... if they’re not a Reseller
    [*product_price*] ... output the product_price TV or placeholder (depending on whether you’re using a Ditto call or a template or etc.)

    Check the PHx wiki page for details about PHx: http://wiki.modxcms.com/index.php/PHx

    If you wanted to set explicit reseller prices rather than doing math to calculate them you could just as easily use another TV instead of the product_price TV with the PHx math modifier.

    Make sense? If not, let me know where I lost you.
      Need MODx Ecommerce? Try FoxyCart!
      • 32380
      • 137 Posts
      A big thanks for your help, i will have a play around with it and lte you know if i get lost, but it’s now making scence, once again many thnks!! laugh
        • 32380
        • 137 Posts
        A silly question, i have been playing with this and have now got my head around how this works but could you help me with a formula for reduce a price by a percentage i have been trying but to no avail?
          • 32380
          • 137 Posts
          im still having problems, i can get it to work with std users but it will not preform the math for group users,

          I have set up a web user called test and have added him to group called band1, i have left the pages "All Document Groups (Public)" but when i login the price is just showing the std price

          this is the line in the form i am now in the form

          <input type="hidden" name="price" value="[*phx:mo=`band1`:then=`[Price:math=`?*.80`*]`:else=`[*Price*]`*]"/>

          note `Price` is a template veriable

          also form is a chunk!
            • 3707
            • 241 Posts
            Try this instead
            <input type="hidden" name="price" value="[+phx:mo=`band1`:then=`[*Price:math=`?*.80`*]`:else=`[*Price*]`+]"/>
              • 32380
              • 137 Posts
              Brett, Susan & Bob many thanks its people like u guys that make modx so good!!