We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17301
    • 932 Posts
    If this is returning a value '[[+amount[[+MIGX_id]]]]' then you have something in your code that isn't displayed above. Can you please post the complete code that you're using.

    The first code also may not work if the code posted is different, but what did the console error log say in MODX?
      ■ email: [email protected] | ■ website: https://alienbuild.uk

      The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
      • 46886
      • 1,154 Posts
      Ok that's great! Everyone jumped in too, wonderful! Thank you all!

      Ok well if that line outputs then you need to just make more lines with the tv names, Burgers, Dranken, Broodjies...its just the same code with the different product group name

      if the first outputs then you just need the whole list. I do think we will be able to strip out the null values too this way, but let's get the full list first
        • 54524
        • 34 Posts
        I changed the naming like this:
        <select name="amount[[+MIGX_id]]">
                <option value="0">0</option>
                <option value="1">1</option>
                <option value="2">2</option>
                <option value="3">3</option>
        </select>

        Just a little detaill.

        It's not possible to make more lines. Every TV contains many products. What I see now is the full list of the products with their values. But only the first value is processed. There is not just one TV for one product, then it would be easy.
          • 46886
          • 1,154 Posts
          Well its not good to adjust that, everyone is working off the code as you provided it before, we can't have multiple moving parts or nothing will work.

          What's the output? All of the products are outputted? I really don't understand this:

          But only the first value is processed.


          You mean that all the items are outputted, but only the first value in the checkboxes passes? I really am not sure what you mean.

          I think you should go back to the original code because everyone has been working off of that code.

          If you can see the output is detailed enough then maybe its ok, but if its just broken data then I don't know if its useful.


            • 54524
            • 34 Posts
            I understand, it is just not working when I use title because then you'll always see the names of the titles.

            Oke I try to make it more clear, this is what I have right now:
            For example a small list, to keep it simple.

            This is what a person fill in the form:
            - product 1: value 1
            - product 2: value 2
            - product 3: value 3


            Then I get this in my mailbox:
            - product 1: value 1 = this one is working, it matched with the filled form.
            - product 2: value 0 = the others aren't working, the will stay at zero.
            - product 3: value 0


              • 17301
              • 932 Posts
              Can you post your migx tv setup and also report back what as in the error log from the hook.
                ■ email: [email protected] | ■ website: https://alienbuild.uk

                The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
                • 54524
                • 34 Posts
                Not sure if this is what you need.

                [
                {"caption":"Algemeen", "fields": [
                    {"field":"title","caption":"Titel","inputTV":"Titel"},
                   {"field":"description","caption":"Beschrijving","inputTV":"Beschrijving"},
                    {"field":"price","caption":"Prijs","inputTV":"Prijs"}
                ]}
                ]


                this is the call:
                <ul>[[getImageList? &tvname=`Burgers` &tpl=`tLoadlist`]]</ul>


                and then this is tLoadlist:
                <li>
                <p>
                <strong>[[+title]]</strong>
                		[[+description]]
                		[[+price]]
                </p>
                
                <select name="amount[[+MIGX_id]]">
                        <option value="0">0</option>
                        <option value="1">1</option>
                        <option value="2">2</option>
                        <option value="3">3</option>
                </select>
                </li>


                Okay the error logs seems to be usefull.

                This is from the method that kinds of works..
                [2018-09-06 12:06:43] (ERROR @ /www/core/model/modx/modparser.class.php : 540) Could not find snippet with name product_Kipschnitzel.
                [2018-09-06 12:06:43] (ERROR @ /www/core/model/modx/modparser.class.php : 540) Could not find snippet with name product_Varkensschnitzel.
                

                This is from the method with the hook processOrder.. (I changed the code in tLoadlist back to 'product_[[+title]]' to make it all match)
                [2018-09-08 01:37:03] (ERROR @ /www/core/model/modx/modcachemanager.class.php : 344) Error caching lexicon topic lexicon/en/core/default
                [2018-09-08 01:37:22] (ERROR @ /www/core/cache/includes/elements/modsnippet/32.include.cache.php : 22) There were no values matching product_


                I'm thinking how to fix it.
                What do you think?

                  • 46886
                  • 1,154 Posts
                  Ok those first errors mean those products are not set up properly. It wants a snippet but I thought these were tvs... that solution only works for the first value of some of the products, right?

                  Kind of working doesn't help us really, unfortunately, it doesn't mean that there is a direct fix necessarily.

                  Let's remember that previously you were getting all the output, with only the null results showing up, do you remember that? Am I correct about that?

                  If so, you need to go back to that arrangement, the only issue then was to get the right name of the values so that they can output non-programmically so you can then modify them. [[+fields]] was outputting them programmically and so we can't modify the output.
                    • 54524
                    • 34 Posts
                    Yes that's correct.
                    It does help us, we haven't been so close. I think that we can make it work with just a little twist.
                    First we need to understand how it's getting the first value and why the other values can't.

                    All the output, with only the null results showing up: that's exactly what I've now, with exception the first value.

                    No I don't think I want to go back to [[+fields]] because that's just not a part of the problem.

                    Does anyone knows how I can also get the other values in the list?
                    There must be something simple.
                      • 54524
                      • 34 Posts
                      @nuan88 and @LK thanks for the help!
                      I have been trying many things with naming this morning.
                      Now I've it working for a part of the products.
                      I need to figure out why some doesn't process.
                      But I will figure that out, I guess smiley