We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 453
    • 6 Posts
    Hi all! smiley Apologies if this is a bit of a newbie question, I’ve done a search and couldn’t see anything that helped me smiley

    I am using modx and foxycart for a client who needs a simple order form, with no transactions at this stage. I gather that foxycart isn’t a CMS so all the products etc need to live in modx which is great - it’s all in one place.

    I want the products listed all on one form/page, so users can just enter 1 of these 4 of those etc all on one page. My strategy for doing this is...

    * Create order page resource
    * Create containers for each of the product categories (set not to display on front end)
    * Add a resource to the containers for each product (set not to display on front end)

    And I’ve made variables for each price etc.

    So my question is how do I get the order page to loop through the children? I’m guessing a snippet of some description, but I’ve been fluffing around with that for a few hours and haven’t been able to get it working - php knowledge = minimal!! rolleyes

    Again sorry if this is a really obvious one, and TIA for help!!

    Addle
      • 453
      • 6 Posts
      OK, this is what I have tried tonight.

      So far I have been able to get documentobjects like the title displaying OK, but not my template variables. ARGH!

      Any ideas any php modx gurus?

      TIA smiley

      addle

      <?php
      $docid = isset($docid) ? $docid : "";
      if(empty($docid)) return "";
      $childdoc = $modx->getDocumentChildren($docid);
      foreach($childdoc as $cd){
      //$output = $output.$cd[’pagetitle’]."
      ";
      $grandchild=$modx->getDocumentChildren($cd[’id’]);
      $tvarlist = $modx->getDocumentChildrenTVars($cd[’id’]);
      foreach($tvarlist as $tvl){
      $output = $output.print_r($tvl)."
      ";
      }
      //foreach($grandchild as $gc){
      //$output = $output.$gc[’pagetitle’]."
      ";
      //$output = print_r($tvarlist);
      //}
      }
      return $modx->parseDocumentSource($output);
      ?>
        • 453
        • 6 Posts
        Anyone? I’m out of ideas......!

        Thanks!

        Addle
          • 16278
          • 928 Posts
          Ditto would almost certainly do what you want by way of displaying data from sets of children, though I’m not sure about the interactive side of things in your order form.
          http://ditto.modxcms.com/
          http://www.pogwatch.com/ditto.html

          Treasure Chest (http://modxcms.com/extras/package/470) may also suit, or give you some ideas at least.

          smiley KP
            • 453
            • 6 Posts
            Hi,

            Thanks for the recommendation - this might be just me, but I can’t see where to download Ditto from or how to install it etc - the documentation seems pretty light on for newbies.

            Can anyone point me in the right direction?

            Thanks,
            addle
              • 4310
              • 2,310 Posts
              Try here in the repository.
                • 16278
                • 928 Posts
                Which version of MODx are you using? Ditto is part of the distribution package of MODx Evolution 1.0, so you only need to put the snippet call in to use it, unless you chose not to install the standard snippets in the first place.

                The link above will offer an alpha version of Ditto for Revolution (MODx 2), though you can burrow your way back via Previous Releases to an Evolution version if you need to download it.

                smiley KP
                  • 4310
                  • 2,310 Posts
                  Thanks kp52
                  I’ve corrected the link in my previous post to Evo version 2.1 smiley
                    • 453
                    • 6 Posts
                    Thanks smiley

                    I’ll take a look at Ditto before coming back for more help LOL
                      • 453
                      • 6 Posts
                      OK, I think I’ve spent enough of my time trying to figure this out.... are there any volunteers out there that are interested in lending a hand? Or is there a find a developer thread I should be using?

                      It would be paid work obviously.

                      TIA smiley

                      addle