Announcement

Collapse
No announcement yet.

Need some really basic help with template based batch reports

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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!

    #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
    Lead Developer / Miva, Inc.
    [email protected]
    http://www.miva.com

    Comment


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

      Comment


        #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