We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • I’m going just as far as I can! I’ve got a FINISHED simple method for a single category catalog, and now a FINISHED session-based shopping cart, next is the checkout module. This initial bare-bones system won’t require registration for use. I’ll package it up as shopX level 1.

    Then I’ll go back and make shopX level 2. I’ll rework the catalog to make it multi-category, still using the basic MODx document tree and some creative use of the NewsPublisher snippet (really trying hard not to have to modify it at all!). The only disadvantage this will have is that you won’t be able to have products in more than one category. Then I’ll add permanent (database table) storage for the shopping cart, which I think can use the web_user_attributes table as-is, and add some permanent user data for the checkout, again using the web_user_attributes table. I will not ever use it to store the user’s credit card info. If they don’t want to be bothered entering credit card info when they order, then let them go order from Amazon and hope their databases don’t get cracked.

    I’m going to concentrate on making even the level 1 checkout module as "modular" as possible with a strong API so that it will be easy to add payment methods to it.
      Studying MODX in the desert - http://sottwell.com
      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
      Join the Slack Community - http://modx.org
    • Unfortunately step 2 (storing order info in the SESSION and getting it back out and displaying it) broke my lovely template-with-placeholder setup. Now I have to use two separate templates, because one of them has to be repeated for every order, while the totals template doesn’t get repeated. If anybody has a better idea, I’d be delighted to hear it! I’m especially concerned over localization of currency formatting.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
      • The catalog can be made with the Manager’s document editor as well as with the NewsPublisher. You don’t really need NewsPublisher at all. Of course, the NewsPublisher works with Web users and Web permissions; working from the Manager and the Document Tree you’ll need to use Manager permissions and roles and Manager users.

        The product list is produced by DropMenu, like any other menu. The next level of the system will have nested multi-level categories; it’s just a matter of using folder/documents as categories, and putting the product documents in the appropriate folders.

        The products on the shopX page are displayed with the NewsListing snippet. When there are more categories, each category page will have its own NewsListing snippet, as well as (optionally) its own NewsPublisher snippet to allow the adding of subcategories or product pages from the front-end.

        The catalog itself is completely done with stock MODx features and snippets.

        The ShopCart snippet at this point only uses the SESSION array to store the shopping cart information. The next level will use the database. The POST array returned by the put in cart button is serialized, so it’s easy to store in any medium.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
        • I am SO proud of myself! grin

          I made TVs for shipping methods, so all you have to do is make a new TV containing the logic for your new shipping method and add it to the Checkout document!

          Then you can simply edit the TV from the document editing forms to modify the logic (change prices, etc...).

          MODx makes this almost too easy! cool
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
          • Susan, that’s just plain awesome!

            Congrats!
              Ryan Thrash, MODX Co-Founder
              Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
              • 4266
              • 70 Posts
              Susan, you are Miss "MODx-2005"! kiss
                • 6726
                • 7,075 Posts
                This rocks !
                Go on like this and promoting MODx will be an effortless breeze laugh

                Just one thing : I just tried to add a new item, but once I submitted it, it returned me to http://www.sottwell.com/ and did not add it...
                  .: COO - Commerce Guys - Community Driven Innovation :.


                  MODx est l'outil id
                • That’s odd...I add items, it adds it and sends me to the page I just created. Browser issue? I’m using FF 1.0.7 for OS X 10.3.9 Works in Camino and Safari as well.
                    Studying MODX in the desert - http://sottwell.com
                    Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                    Join the Slack Community - http://modx.org
                  • These TVs are addictive! Now I’m using another one to diplay the "Select Shipping Method" block, so it only displays if there is something in the cart. You can still add/remove options by editing the TV from the manager’s document editing page. I could have used a snippet to do the same thing, but you’d have to edit the snippet. This way, all the editing/modifying can be done on the one page.

                    Next up, payment methods. Should go quickly, now that I’ve got the general idea.
                      Studying MODX in the desert - http://sottwell.com
                      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                      Join the Slack Community - http://modx.org
                      • 4266
                      • 70 Posts
                      Quote from: sottwell at Nov 28, 2005, 08:32 AM

                      That’s odd...I add items, it adds it and sends me to the page I just created.  Browser issue?  I’m using FF 1.0.7 for OS X 10.3.9  Works in Camino and Safari as well.

                      In WinXP it’s ok in FireFox 1.0.7, but in IE6 css is broken (too large letters, proplems with blocks positions).

                      In FireFox I can choose shipping method and it calculates the sum right, but there are no contact form and send button below.