Need some really basic help with template based batch reports

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • teedle
    Mini Mivite

    • Mar 2017
    • 53

    #1

    Need some really basic help with template based batch reports

    I'm trying to build a custom .csv with a batch report template. Found some help here, but I'm bad so I need more help with the template language... I can see it has a loop for orders which is perfect:
    Code:
    <mvt:foreach iterator="order" array="admin_order:orders">
    
    </mvt:foreach>
    But I don't know how to then individually loop through each product and also each attribute. I want to add statements to check if product attributes contain certain words so I can enter correct words or just commas.
    Code:
    <mvt:foreach iterator="???" array="???">
    
    </mvt:foreach>
    Any help at all (even just links to the right docs) is appreciated!
  • Nick
    Super Moderator











    • Dec 2011
    • 575

    #2
    Here is a code snippet to see the variables and values of an array:
    Code:
    <mvt:eval expr="decodeattribute(glosub(miva_array_serialize(VARIABLE FOR ARRAY HERE), ',', '<br>'))" />
    The array for the items in an order will be in the order:items array. If you navigate to the INVC page within the admin you can use that code as an example of how the array is structured.

    The snippet below will output the variables and values of a product within the item array.
    Code:
    <!-- EXAMPLE: -->
    <mvt:foreach iterator="order" array="admin_order:orders">
        <mvt:foreach iterator="item" array="order:items">
            <mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:item), ',', '<br>'))" />
        </mvt:foreach>
    </mvt:foreach>
    Hopefully this helps!
    Last edited by Nick; 12-10-19, 09:32 AM.
    Nicholas Adkins
    Technical Training Specialist / Miva, Inc.
    [email protected]
    https://www.miva.com/mivalearn

    Comment

    • teedle
      Mini Mivite

      • Mar 2017
      • 53

      #3
      Thanks for the detailed reply Nick I'll give it a shot

      Comment

      • Bruce - PhosphorMedia
        Developer Partner











        • Mar 2006
        • 11256

        #4
        The existing Template Based Batch Reports will also have some examples of gathering pretty much everything you would want from the orders.
        Bruce Golub
        Phosphor Media - "Your Success is our Business"

        Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
        phosphormedia.com

        Comment

        Working...
        X