We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29635
    • 361 Posts
    This is an auto-generated support/comment thread for FoxyCart Inventory.

    Use this forum to post any comments about this addition or any questions you have regarding its use.

    Brief Description:
    Adds simple inventory management for MODx sites using FoxyCart.com. For use with FoxyCart, standards-based ecommerce, by web designers for web designers.
      Need MODx Ecommerce? Try FoxyCart!
      • 6726
      • 7,075 Posts
      Nice concept ! Had never heard of it... thanks for bringing FoxyCart to MODx, Brett smiley

      I’ll have to check how things work for European customers though, did not see anything about that...
        .: COO - Commerce Guys - Community Driven Innovation :.


        MODx est l'outil id
        • 29635
        • 361 Posts
        This particular inventory snippet would work for anybody, as it’s not really tied to anything but a few TVs in your MODx install, but we definitely need European beta testers!

        More on FoxyCart.com in this MODx forum thread. Please let us know what you want if you’re European.
          Need MODx Ecommerce? Try FoxyCart!
          • 6726
          • 7,075 Posts
          Ok Brett, nice to know : will do !
            .: COO - Commerce Guys - Community Driven Innovation :.


            MODx est l'outil id
            • 29635
            • 361 Posts
            In case anybody’s interested, I did a slight hack of this to actually delete documents instead of reduce the count of the inventory TV. It relies on the document ID rather than a code TV, and it doesn’t need an inventory TV either, so it’s a bit easier. Replace the somewhat large
            if ($detail->product_code != '') {
            block of code (all the way down to the closing } ) with this:
            				if ($detail->product_code != '') {
            					// Since the product_code is really the doc ID...
            					$code = $detail->product_code[0]->tagData;
            					$output .= "code = $code \n";
            					// Delete the document
            					// You could unpublish it just as easily
            					$query = "UPDATE ".$prefix."site_content SET deleted = 1 WHERE id='".$code."'";
            					$modx->db->query($query);
            					$output .= "we just did something... \n" . $query . " ";
            					// }
            				}
            

            Just make sure you’re using [*id*] (or [+id+] instead of your [*code*] (or [+code+] or whatever) TV in your form and link generation.
              Need MODx Ecommerce? Try FoxyCart!
              • 2954
              • 40 Posts
              Hey All,

              Since the XML is generated from a link, I’d suggest escaping the input to prevent sql inject attack.

              Just modify each line to include the modx escape function:

              Was: $code = $detail->product_code[0]->tagData;

              Now: $code = $modx->db->escape($detail->product_code[0]->tagData);

              Unless this is being handled on the foxycart side?
                • 2954
                • 40 Posts
                The Logging file can quickly get bloated, so I recommend that the code be updated to delete the file before it is created. Here’s my new version:

                // ===================================================================================================
                // WRITE THE RESULTS TO A FILE ON YOUR SERVER
                // ===================================================================================================
                if ($myFile) {
                if (file_exists($myFile)) {
                unlink($myFile);
                }
                $spacer = "===============\n";
                $date = date("Y-m-d H:i:s") . "\n";
                $fh = fopen($myFile, ’a’) or die("can’t open file");
                fwrite($fh, $spacer);
                fwrite($fh, $order_record);
                fwrite($fh, $date);
                fwrite($fh, $spacer);
                fwrite($fh, $FoxyData_decrypted);
                fclose($fh);
                }
                  • 4385
                  • 372 Posts
                  The XML duplication bug (it repeats for times) is subtracting four times as much inventory.

                  Is there some way to modify the snippet to only process the first xml?
                    DropboxUploader -- Upload files to a Dropbox account.
                    DIG -- Dynamic Image Generator
                    gus -- Google URL Shortener
                    makeQR -- Uses google chart api to make QR codes.
                    MODxTweeter -- Update your twitter status on publish.
                    • 29635
                    • 361 Posts
                    The XML getting sent 4 times should be fixed at this point. Let me know if it’s still sending extra times for you. Sorry about that.
                      Need MODx Ecommerce? Try FoxyCart!
                      • 29703
                      • 217 Posts
                      I was just wondering before I purchase a Foxycart subscription, how easy it would be to create a photography website using maxigallery and integrate foxycart to create an image purchasing system.

                      I tried to enter this query in the Foxycart forum, but hit a load of blank walls. It would be useful if prospective customers could ask queries without going through a lengthy membership process.

                      Any help would be appreciated.