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

    I have a problem inside the chunk &thankyou:

    <tr><td class="label">Store:</td><td>[[storeName? &id=`[+store+]`]]</td></tr>


    The snippet storeName:

    <?php
    $table = $modx->getFullTableName("stores");
    $query = "SELECT id,nom FROM $table WHERE id = '$id' LIMIT 1";
    $result = $modx->db->query( $query );
    $row = $modx->db->getRow( $result );
    return $row['name'];


    But nothing returns.

    I try this:

    <tr><td class="label">Store:</td><td>[[storeName? &id=`2`]]</td></tr>


    It's work. The name is display.

    If I use this:

    <tr><td class="label">Store:</td><td>[+store+]</td></tr>


    It's work and [+store+] display 2.

    So, why it's doesn't work?

    Help please.

    By the way, I'm in Evo 1.4.0RC2

    This question has been answered by neoziox. See the first response.

    • discuss.answer
      • 37909
      • 153 Posts
      With the number of replies, I found a "hack" (because I thought that the placeholder must be work like a normal variable inside the snippet).

      Inside the thankyou chunk I put this:

       <tr><td class="label">Store:</td><td>[[storeName]]</td></tr>


      And this is my storeName snippet:

      <?php
      $id = $_POST['store'];
      $table = $modx->getFullTableName("stores");
      $query = "SELECT id,nom FROM $table WHERE id = '$id' LIMIT 1";
      $result = $modx->db->query( $query );
      $row = $modx->db->getRow( $result );
      return $row['name'];


      And it's work perfectly.