We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32241
    • 1,495 Posts
    Hi Susan,

    thanks for sharing that.
    I have a question about you current catalog shop project though. Are you making a full-fledge catalog shop system for MODx? Currently I’m working on a catalog shop system as well, and using AJAX and tab based interface, which I do realize that it’s start to look more like what you want it to be, by reading your previous post. Is it going to be adescendent from shopX or it is a whole new project? If you can give me the list of some of the features that you are wanting to have, it will be awesome, so I know whether we are building the same application or not. If yes, I would love to build it together with you, whether it will be using your code based or my code based, as long as we can finish it up faster, it will be awesome.

    So far what I have is the item module, which support one item having a sub items beneath it. This is a must features that I ignored when building a catalog shop system based on ASP .Net, and I don’t want to repeat the same mistake again. Basically what it does is allowing you to have one item, lets say a tshirt design a, and you want to have an option for sizes, color, and model (girl or boy). By having a sub childs, we can create multiple items that will incorporate all this. With that, we can keep track the real amount of items quantity that we have in stock for specific item option combination, as well as we can assign a different price and weight for the sub childs, but they will be listed under the main item. I also build a multiple files attachment to the item or sub items. Basically you can attached as many files as you want for one item. Another features that I also want to add, and it’s still not being developed yet, I want to have an attributes assigned to each category that will reflect directly to all items being listed under that category. Imagine having a category computer/laptop. Basically I want a different/special attribute assigned to laptop category, for example harddrive, processor, memory, and etc. With this attribute features, we are able to make an extension for the catalog shop to provide comparison module that will compare several items under the same category. I also want this attributes assignment to be inherited accross each sub category. I might need to consult this with Adam I believed. He is the one who create the inherit binding, right?

    Now here comes the category part, basically it will be plain category management system, which will have unlimited sub categories, and I might suggest that it will be limited to not more than 99 sub categories, well in real world that won’t happen, believe me wink

    The next thing will be sales tax and shipping management. The sales tax management will allow the shop owner to define several location based on commbination zip code and country or combination city, state, and country. The shipping management will allow the shopw owner to specified different pricing for different carrier, and it will have a general hook that can be attached to specific carrier, which what it does is sending a web service request and retrieving information of the shipping price.

    The check out system is fairly straight forward, but I want to have this system to be extended further, so allowing the user to check out the cart by popuping a new window, considering when you checkout something, you need to send them to https connection, which it cause a different session management, unless if we append the phpsessid manually, which will cause security breach, because of exposing the SID, but I’m still not sure the best approach to this.

    The final thing will be the transaciton management. This one will be more like the extended system for the checkut process which ties in with the items system. It will record each transaction being made, and it will later able to give a complete report of all the transactions being made, with all the items being sold, and with all the transaction status, whether the user decided to cancel the payment, which usually causing the current item quantity to be decreased from the stock already. So with this system, the shop owner able to revert back all te failed transaction to make all the sold items on that failed transaction to be updated with the right quantity value. More features can be added to this, but it’s better to think of a better code based that can be extended without the needs of me to bloated the system with all unnecessary features.

    The code and data base is able to support multiple shop in one installation. So for mall owner who is willing to have different shops hosted on one system, it will support that. Let say that I’m a fans of multi site system. I always thought it will provide a better service to client, because when I update the core, it will update the system for my clients, even though I do realize that updating multiple site sometimes can cause a lot of headache. But anyway, in case if somebody willing to make a front intrface for mall, it will be do able using the current code based that I build.

    That’s all for now.
    I hope you can share yours as well.

    EDIT: I also use AJAX heavily on the administration side. I’’m using prototype lite, moo.fx, moo.ajax, and pork iframe. The total ammount is about less than 20 or 30 kb, which includes my js addition to extend and combine them all. I also realize the incompatibility of certain features that I use with other browser such as IE, but it’s just making the animation to looks little bit sulkier, other than that, the functionaility is still working fine. Another problem is creating a robust design that can make the interface looks nicer and professional, which I ended up making it looks ugly sad (oh well, what do you expect from a guy like me, FYI, I’m not a designer tongue)

    Another concern that I have, I’m not sure how heavy the system will be, but the database relation is being handled by array and multiple sql connection back and forth, such as sub childs and files. If somebody can give me a heads up on what needs to be watched out when designing a database system and etc, like the amount of mysql query to be made and etc, it will be great.
      Wendy Novianto
      [font=Verdana]PT DJAMOER Technology Media
      [font=Verdana]Xituz Media
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Sounds like you are way ahead of me. I’m just fumbling my way around, and so far I’ve just got the beginnings of a category management module working. ( http://www.sottwell.com/manager guest/guestuser login and run the shopx module.)

      The problem is that I’ve never done a full-fledged shopping application, just a very simple catalog with e-mail ordering, and a small bookshop with credit card ordering. So I really don’t have any experience in what would be necessary or even useful in such a beast.

      I would really be a whole lot happier to leave the design in the hands of someone more experienced in what is needed, and be used for what I’m best at, picking up loose ends and tracking down bugs (the new drop-in menu bar for the manager, and now the Modules main menu item are the sort of thing I’m talking about, although the menu did get a good deal more polish than I originally did).

      So if you don’t mind, I’ll drop my still embryonic project and you tell me what to do with yours, or I’ll get back to twiddling with DocMan. The original ShopX was actually just a very quickly done proof-of-concept to show that a lot of simple things can be done using core MODx features with a minimum of snippets and plugins to act as "glue".

      I am determined to learn two things out of all of this; how to properly use SVN and Javascript/Ajax programming, especially the Prototype library. I expect to be months, if not years, becoming fully comfortable with both. Oh, and OOP and more complex sql queries...
        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
        • 32241
        • 1,495 Posts
        Thanks for the clarification Susan. I look at your sample, and it looks nice and run flawlessly. To be honest, mine is a little bit buggy on the user interface part. The CSS styling is in such a mess, even I don’t want to get back to it and start making it better. The AJAX thing works, but the animation is not working correctly. From what I can see, I like the idea of having that category management in place. I haven’t done that part yet, but I do have the database class for managing the category done, but I need to make the user interface, which usually takes longer. Do you mind sharing your code with me Susan? Do you want to work together with me, creating this ajax base catalog system? I know you have docman currently, so it’s up to you. To be honest, my idea will take longer to finish up, considering I’m aiming at full-fledge catalog system, but I can see the needs of this. Let me know if you are interested Susan.

        Are you currently using SVN from MODx? I have one setup on http://svn.djamoer.net/. You can browse through the thing and look at my code if you want to. It’s open or public viewing. If you want to, I can setup a new account for you and let start cranking out some stuff wink Btw, this is more off-topic, but I like the idea of where you’re headed with docman. The only things that I really want to see is having the docman front interface to be template based. You can download the chunktpl lib that I have, it’s on my svn as well. I’m using intensively on my current catalog script. You can download the latest version and start play around with it. If you build it using that, it will make it easier for some people to adapt on the catalog themes system that I’m building right now, lol grin Hehehee...
          Wendy Novianto
          [font=Verdana]PT DJAMOER Technology Media
          [font=Verdana]Xituz Media
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          I would love to work together on this. DocMan as it is is still useful, if a bit simpllistic. The new version will have version control and be database-driven rather than files in the file system. So that will need concentration and focus; I’d rather get a really good shopping cart/ecommerce module available first.

          I’m still at the baby steps stage with SVN (using it locally with the terminal command line interface until I understand what is going on).

          I’m good at fiddling with css and adjusting the user interface, if somebody else has designed the functionality to start with! So I’ll look into your chunktpl lib, that sounds really interesting. And here’s my entire shopx codebase so far. I made it very modular, each discrete function has its own php file (overkill, perhaps, but makes it so easy to modify or fix bugs, and can easily be converted into functions in a class once it’s all working properly).
            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
            • 25663 MODX Staff
            • 12,272 Posts
            Hey Susan, would it be worth hacking up the mangaer to get rid of the webfx tab implmentation and replace them with ajaxtabs?
              Ryan Thrash, MODX Co-Founder
              Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
              • 32241
              • 1,495 Posts
              Quote from: rthrash at Mar 12, 2006, 08:11 PM

              Hey Susan, would it be worth hacking up the mangaer to get rid of the webfx tab implmentation and replace them with ajaxtabs?

              I think it will be more worth it to have the top menu using ajax to automatically load the content to the main admin frame. The tab for the system config and etc will not make any performance different, concerning it does provide a better response with loading all the current tab content to the frame. My only concern only the frame on the main area that needs to be refreshed everytime I changed template or choose a different page to be edited.

              Anyway, I believe Susan will have a better opinion than me wink
                Wendy Novianto
                [font=Verdana]PT DJAMOER Technology Media
                [font=Verdana]Xituz Media
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                The frames are going away, right? I think it would be a waste of time and effort right now to try to make any major changes in the existing manager.

                I would presume that any new, one-page Manager interface would use AJAX, though. Especially with the Prototype library and all the tutorials and effects libraries being build on top of that, it should be easy enough. Certainly the tabs and AJAX functions I was working on were easy enough; there were actually too many available to easily choose from! I spent two days just trying out different ones. I finally settled on scripts that weren’t quite what I really wanted, but were the lightest, clearest and easiest to customise (kinda like why I chose to go with Etomite/MODx!).

                Measure into large bowl:
                // initialize tabbed interface
                function init () {
                	var tabs = document.getElementsByClassName('tabs');
                	for (var i = 0; i < tabs.length; i++) {
                		$(tabs[i].id).onclick = function () {
                			getTabData(this.id);
                	        }
                       }
                }
                
                function getTabData(id) {
                	var url = '../assets/modules/shopx/includes/process.php';
                	var pars = 'id=' + id;
                	var myAjax = new Ajax.Request( url, {method: 'get', parameters: pars, onLoading: showLoad, onComplete: showResponse} );
                }
                
                function showLoad () {
                	$('load').style.display = 'block';
                }
                
                function showResponse (originalRequest) {
                	var newData = originalRequest.responseText;
                	$('load').style.display = 'none';
                	$('content').innerHTML = newData;
                	autoInit_trees();
                }
                


                Stir in:
                <body onload="init()">
                <div id="load">Loading...</div>
                <div id="container">
                	<div class="tabs" id="tab1">Documentation</div><!-- will display default.php -->
                	<div class="tabs" id="tab2">Categories</div>
                	<div class="tabs" id="tab3">Products</div>
                	<div class="tabs" id="tab4">Authors</div>
                	<div class="tabs" id="tab5">Artists</div>
                	<div id="content">
                	<?php include "../assets/modules/shopx/includes/default.php"; ?>
                	</div>
                </div>
                </body>
                


                Add and beat well:
                <?php
                function stringForJavascript($in_string) {
                   $str = ereg_replace("[\r\n]", " \\n\\\n", $in_string);
                   $str = ereg_replace('"', '\\"', $str);
                   Return $str;
                }
                switch($_GET['id']) {
                	case 'tab1':
                		$content = include "documentation.php";
                		break;
                	case 'tab2':
                		$content = include "categories.php";
                		break;
                	case 'tab3':
                		$content = include "products.php";
                		break;
                	case 'tab4':
                		$content = include "authors.php";
                		break;
                	case 'tab5':
                		$content = include "artists.php";
                		break;
                	default:
                		$content = 'There was an error.';
                		break;								
                	
                } 
                print stringForJavascript($content);
                ?>


                Bake in medium oven, top with freshly whipped CSS, and serve warm.

                Piece of cake! grin
                  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
                  • 32241
                  • 1,495 Posts
                  Use moo.fx and moo.ajax with its strip down version of prototype.lite.js, plus pork.iframe. Believe me, using pork, it will help overhauling the manager a lot faster, considering uploading images is not too much of a problem, and all the get and post will not affect the current manager code that we have, so we can easily overhauled them with no major changes to the current core that we have.
                    Wendy Novianto
                    [font=Verdana]PT DJAMOER Technology Media
                    [font=Verdana]Xituz Media
                    • 25663 MODX Staff
                    • 12,272 Posts
                    Wendy, do you have a link to the pork.iframe?
                      Ryan Thrash, MODX Co-Founder
                      Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                      • 32241
                      • 1,495 Posts
                      Quote from: rthrash at Mar 13, 2006, 08:51 AM

                      Wendy, do you have a link to the pork.iframe?

                      http://beta.zapguide.nl/iframe/

                      The whole concept is to make the old iframe looks like AJAX. The script will automatically generate iframe and postback the content, and return the corresponding response to any element on your DOM. Some people say it’s lame, but I think it’s a great idea though, considering you’re not loosing any functionality at all compare to the old postback system, such as posting files wink
                        Wendy Novianto
                        [font=Verdana]PT DJAMOER Technology Media
                        [font=Verdana]Xituz Media