Latest News: (loading..)

npn2531

Members
  • Content count

    1,159
  • Joined

  • Last visited

  • Days Won

    6

npn2531 last won the day on September 4 2014

npn2531 had the most liked content!

About npn2531

Profile Information

  1. CRELoaded, that's what I was thinking of, not OSCMAX. That was my introduction to OSCommerce. I like OSCommerce for the same reason I liked the old VW beatles I used to have back in the 70's: I could work on them. That is one advantage, at least to me, of the Spaghetti code, you can look at a catalog page and kind of see what is going on. I look at something like Magento, and I am overwhelmed. I also don't work on cars anymore, they are just too complex now, (even though I finally got that perfect set of snap-on wrenches). Cars work much better now, and are far better pieces of machinery than before, but they are just too complex for me.
  2. Actually something like this was done with OSCommerce over a decade ago. OSCMax is the example I am thinking of.
  3. That is correct, you have to have php to output html. However, I believe much of the 'spaghetti-ness' of OSCommerce could be unraveled without fundamentally changing it's existing structure. I was able a few years ago to produce for the community a version of OSCommerce that utilizes the 360 grid div's instead of the tables, tr and td's, and in doing that could see how much easier that task would have been if much of the php could be moved back someplace, for example, into application.top or to the includes folder. For example, take a look at this section of the current download of index.php: require('includes/application_top.php'); // the following cPath references come from application_top.php $category_depth = 'top'; if (isset($cPath) && tep_not_null($cPath)) { $categories_products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'"); $categories_products = tep_db_fetch_array($categories_products_query); if ($categories_products['total'] > 0) { $category_depth = 'products'; // display products } else { $category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'"); $category_parent = tep_db_fetch_array($category_parent_query); if ($category_parent['total'] > 0) { $category_depth = 'nested'; // navigate through the categories } else { $category_depth = 'products'; // category has no products, but display the 'no products' message } } } require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT); require(DIR_WS_INCLUDES . 'template_top.php'); if ($category_depth == 'nested') { $category_query = tep_db_query("select cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'"); $category = tep_db_fetch_array($category_query); ?> <h1><?php echo $category['categories_name']; ?></h1> This could be changed to require('includes/index.php'); require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT); require(DIR_WS_INCLUDES . 'template_top.php'); <h1><?php echo $category['categories_name']; ?></h1> 'All' you would have to do would be to create a new file, 'index.php', in the includes folder. This new file would hold the queries that generate $category['categories_name']. Application_top would be referenced from this new file includes/index.php instead of from index.php. This removes core progamming from the original index.php. You would then make all your html and template changes in index.php, without touching core progamming in your new file includes/index.php. If you needed to update core programming, you could do so without touching your html and template changes. (It is pretty unlikely, the basic php like 'echo' or variable disignations like '$' , which as you note could not be removed from index.php, are going to be need much updating. ) But that is a simple example, on one page. The current cm_ , the current bm_ , the current ht_ is a start on this.
  4. OSCommerce is the definition of spaghetti code, and that is why it is so hard to conceive of any practical method of writing and installing add-ons for OSCommerce that doesn't affect the 'core code'. Look at the index.php for the latest download of 2.3.4. It contains queries, html, queries with html, php where variables are defined, etc, etc. What part of that is 'core code'. All of it? 1. Get the html and php separated first. There is a well known and widely used method for doing this, the MVC model. In short, the V stands for 'view' and are template files with the html and maybe so some basic 'if then' php statements to help display the html options. The M and C, model and controller files have all the rest. (Javascript, CSS and language are separate files) 2. Do step 1. above and you can create an extension installer like word press and some other open-sourced shopping carts use. Take the example of a current popular open sourced shopping cart, which has 8 letters in the name first letter o last letter t. in the current version of their cart, you can install modules by uploading an xml file through the admin. This file is stored in a separate section of the cart structure and contains all the html and php needed to run the extension. It will 'overide' core code of the shop, as well as upload new files needed for the extension. Kinda of like you can override a css selector by duplicating that selector lower down the same CSS file, and making changes on the duplicated selector. Delete your duplicate selector and the CSS functioning is back the original. In this cart, you delete the xml file, and you are back to unchanged original core code. (Deleting that files also initiates instructions to delete any new tables or fields it created in the database). To write an extension, you write all your programming, no matter where in the core code it needs to function, on a single xml file, (and in new files if any needed) The bonus of using xml files, is that you can list the xml files you are using in the admin, and look at a tidy list of all the extensions you installed. And not just a list, you have a separate folder, the folder containing the xml files, that has all of your add-on programming archived. Unravel OSCommerce's spaghetti code first.
  5. Thanks for the tip, I will take a look.
  6. Jeepers, what if you have stuff commented out, or how in the world would it make sure it wasn't inserting something within the wrong set of { } or something.
  7. Darn, I was hoping I would never have to cut and paste again, oh well.
  8. In looking at the instructions for installing SEO header tags reloaded http://addons.oscommerce.com/info/8864 I see that the reader is instructed to 'Upload or Merge' files. Having spent a significant portion of my youth cutting and pasting snippets of code into my OSCommerce site installing add-on, this caught my attention. What does 'Merge' mean? Is that something other than manually cutting and pasting snippets of code into a file? Is there a program or something that will merge two OSCommerce files full of html, php, javascript and misc stuff? I have been unable to find a good answer googling or searching this site, and thank you in advance for direction on this.
  9. Thanks, that seemspretty much what I 'm looking for. I guess I just need to get this loaded and see what is there. Having a content module in the header would certainly seem a great way to get a horizontal header installed, for example.
  10. Thanks, 'bm box modules, cm content modules, tp template'. I would imagine you would have to change a lot more than that to get the popular contributions installed. I can see that some contributions are incorporated into a vanilla 2.3.4 and perhaps the BS gold version. Is there a straight forward list of what these contributions are?
  11. Thanks for the info on the add ons. I am further out of the loop than I thought, and need to spend some serious time on the 2.3.4 documentation, esp in regard to modules (bm_*, cm_*, tp_*) and hooks. Perhaps, Gary you could recommend a particularly well rewritten add-on that is 'hooked' to one of these modules, one you have written perhaps, I could use to as a study guide/model.
  12. I'm not sure I would know if an add-on was properly written or not.
  13. I guess my question about add-ons, is: Add-ons add stuff all over the place, there is no modular approach that I know about such as what you have on Word Press, so what exactly is the core in OSC? How would you add even a SEO module with out sticking bits and pieces of php and html in a number of files?
  14. On #6, is it possible to use 2.3 add-ons most of use use without touching the core? Is there a list of add-ons, that don't 'touch the core'?