We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32360
    • 16 Posts
    In this doc it says:
    $base_path = !emptyempty($base_path) ? $base_path : $modx->getOption(’core_path’).’components/storefinder/’;

    Is !emptyempty correct?
      [url=http://www.williamastrom.se]Webdesign and CMS developer William
      • 1778
      • 659 Posts
      ;) not really I guess...

      Just a too fast copy/past I suppose, the good one is !empty($base_path) etc...

      Cheers
        • 22019
        • 390 Posts
        [s]I’ve also just tried this tutorial, correcting minor little things (one of the file locs is wrong, and the duplication of empty above). I fixed all the paths to suit me. Everything has sort of worked, except that this code:

        $stores = $modx->getCollection('sfStore');  
            echo 'Total: '.count($stores);  


        (with my variables in it) returned 01 when there were no entries in the database, and 21 when I added two rows using the method described in the tutorial. I’ve checked in the database and there are, indeed, 2 rows.

        I cleared those rows, and ran the snippet.storefinder.php again (via a web browser - ie a file snippet called by a snippet in MODx mgr, in case this makes ANY difference) again and got the same result.

        Total:01 for zero rows
        Total:21 for two rows

        Any ideas?


        Now appears to work fine. No idea what I would have done differently other than flushing the site cache (which doesn’t explain the extra ’1’ but anyhoo...
          Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86