We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27421
    • 67 Posts
    Hello,

    I’m trying to use getResources to create a Revolution version of the simple Ecommerce tutorial outline here http://codingpad.maryspad.com/2010/06/16/ecommerce-with-modx-and-paypal/.

    For some reason this snippet call returns a blank page
    [[!getResources? &parents=`27` &includeContent=`1` &tpl=`store-front-tpl` &includeTVs=`1` &processTVs=`1` &tvPrefix=``]]


    Template chunk for "store-front-tpl"
    <p><strong>[[+product_name]]</strong></p>
    <p><img src="[[+product_image]]" alt="[[+longtitle]]" /><p>
    <p>[[+product_desc]]</p>
    <p><strong>Price: $ [[+product_price]].00</strong></p>
    <p>[[+product_addtocart]]</p>
    


    If I call the snippet without including the template it returns an array.
    Array
    (
        [tpl] => 
        [tplOdd] => 
        [tplFirst] => 
        [tplLast] => 
        [sortby] => publishedon
        [sortbyTV] => 
        [sortbyAlias] => 
        [sortbyEscaped] => 0
        [sortdir] => DESC
        [sortdirTV] => DESC
        [limit] => 5
        [offset] => 0
        [tvFilters] => 
        [depth] => 10
        [parents] => 27
        [includeContent] => 1
        [includeTVs] => 1
        [showHidden] => 
        [showUnpublished] => 
        [showDeleted] => 
        [resources] => 
        [processTVs] => 1
        [tvPrefix] => 
        [idx] => 1
        [first] => 1
        [last] => 2
        [toPlaceholder] => 
        [debug] => 
        [id] => 29
        [type] => document
        [contentType] => text/html
        [pagetitle] => Rashguards
        [longtitle] => Rashguards
        [description] => 
        [alias] => 
        [link_attributes] => 
        [published] => 1
        [pub_date] => 0
        [unpub_date] => 0
        [parent] => 27
        [isfolder] => 
        [introtext] => 
        [content] => 
        [richtext] => 1
        [template] => 6
        [menuindex] => 1
        [searchable] => 1
        [cacheable] => 1
        [createdby] => 1
        [createdon] => 2010-12-06 11:02:00
        [editedby] => 1
        [editedon] => 2010-12-06 11:03:00
        [deleted] => 
        [deletedon] => 0
        [deletedby] => 0
        [publishedon] => 2010-12-06 11:02:00
        [publishedby] => 1
        [menutitle] => 
        [donthit] => 
        [haskeywords] => 
        [hasmetatags] => 
        [privateweb] => 
        [privatemgr] => 
        [content_dispo] => 0
        [hidemenu] => 0
        [class_key] => modDocument
        [context_key] => web
        [content_type] => 1
        [product_price] => 30
        [product_name] => Rashguards
        [product_image] => assets/images/ProductImages/2008/rashguard_front_small.jpg
        [product_desc] => 
        [product_addToCart] =>


    It seems like this should be simple enough, but I’ve been messing with this for hours and can’t get it to work.

    Any insights would be greatly appreciated.

    Thanks to Owan H. this issue has been resolved. It turns out there was a permissions issue with core>components>getresources and not all of the necessary files were loaded into the "getResources" folder. This happened after migrating to a new server.
      • 8609
      • 607 Posts
      hmm, not sure it will make a difference but try renaming your chunk without the hyphens.
        • 27421
        • 67 Posts
        Taking out the hyphens didn’t help. It’s something with the template, but not the name.
          • 27421
          • 67 Posts
          I tried using this same template with Ditto and got the same results. I’m totally stumped huh
            • 22464
            • 9 Posts
            Hi bodhiC, your code looks valid to me. The only thing I can think of is that maybe each of the child resources of the selected ’parents’ resource list are hidden from Menus. If that is the case then you will need to set the ’showHidden’ property in your getResources snippet call.
              Owan Hunte
              Web Developer
              Barbados-based web development.

              Before you bash it, learn it! There is nothing more annoying than an ill-informed rant.
              • 27421
              • 67 Posts
              Thanks Owan, I checked and the child resources are not hidden from menus. The parent resource was unpublished. I published it, cleared cache and still no luck.
                • 22464
                • 9 Posts
                Hmm, are you running this code in a Live site? If it’s not a live site I would be willing to check your MODx installation. I promise not to mess around with anything if u give me the login. You could always change the login to something other than what u have to something temporary. I’m online right now so I can check for u right now and let u know if anything looks out of sorts.
                  Owan Hunte
                  Web Developer
                  Barbados-based web development.

                  Before you bash it, learn it! There is nothing more annoying than an ill-informed rant.
                  • 27421
                  • 67 Posts
                  Sorry it took so long to respond, I had to step out for a while. It’s on a development site and I’m fine with letting you have a look. PM me and I’ll give you log-in credentials. Thanks for your help.
                    • 22464
                    • 9 Posts
                    No worries, I had to step out too actually. Check your inbox, I’ve PM-ed you. And I’m glad to help out, I’ve had many in the O.S. community help me out a great deal with all the O.S. tools I’ve used.
                      Owan Hunte
                      Web Developer
                      Barbados-based web development.

                      Before you bash it, learn it! There is nothing more annoying than an ill-informed rant.