We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9145
    • 13 Posts
    Hi all,

    I am working on this website: http://www.massage-chair-relief.com. You’ll notice if you go to http://www.massage-chair-relief.com/human_touch.html, there is a list of the different models of the Human Touch Massage Chair. That list is output by a Ditto script. So here’s the deal. I’m trying to place the product price under "Availability" on each chair. However, product_price is a template variable for the price of each specific color option for the chair. The different color options are the same price for each chair model, so I need a way to get that price under "Availability".

    Am I making any sense?
    Thanks!
      • 9145
      • 13 Posts
      The hierarchy goes like this:

      -Human Touch Massage Chairs
      -Human Touch HT1650
      -Black
      -Cognac

      "Black" and "Cognac" are not documents. They just contain the information for the chair (ie. price).

      Using the getField snippet, how would I get the field product_price from "Black" or "Cognac"?

      Thanks.
        • 4310
        • 2,310 Posts
        You could have the [*product_price*] attached to the ’chair’ template, use @INHERIT as the default value, overwrite it with the actual price on each ’chair’ document, then the children ’black’ & ’cognac’ will inherit the value.
        When you use Ditto to aggregate all the ’chairs’ the placeholder [+product_price+] should be available.
          • 9145
          • 13 Posts
          Sure that would work, but I’m trying to avoid having to create a new template variable for all the chair models and creating a price for them. The site has a lot of chairs, and that would take ages. Is there a way that I can just pull the price from a chair model’s children (ie. black and cognac)?
            • 9145
            • 13 Posts
            Okay, we’re getting closer, but [+id+] gets the id of the chair model. product_price is a template variable for the chair colors (underneath chair model in the heirarchy). How do I get the id of that page?