Jump to content


  • Content count

  • Joined

  • Last visited

  • Days Won


npn2531 last won the day on September 4 2014

npn2531 had the most liked content!

Profile Information

Recent Profile Visitors

33,023 profile views
  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. npn2531

    Mail Manager for OSC v2.3

    if (file_exists(DIR_FS_CATALOG_MODULES.'mail_manager/order_confirm.php')){ include(DIR_FS_CATALOG_MODULES.'mail_manager/order_confirm.php'); }else{ tep_mail($order->customer['name'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); } It sounds like you are saying the issue is that the tep_mail command above initiates. Your code looks fine, the only thing I can see that would go wrong is that order_confirm.php is not being located. I don't have this set up, but try something like this and see what happens: if (file_exists(DIR_FS_CATALOG_MODULES.'mail_manager/order_confirm.php')){ echo 'order_confirm found'; // include(DIR_FS_CATALOG_MODULES.'mail_manager/order_confirm.php'); }else{ echo 'order_confirm not found'; //tep_mail($order->customer['name'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); } I know this is a bit simple, but I am not a professional and this is what I know to do.
  10. npn2531

    Mail Manager for OSC v2.3

    Ray, Good catch on the variables in password_forgotten.php. You can add this correction to the mail manager contribution, or if you find anymore corrections post them back here and I will add them to the contribution. http://addons.oscommerce.com/info/9133
  11. npn2531

    Mail Manager for OSC v2.3

    In the example templates that are included in the mail manager, you will find that an unsubscribe link is included that when the recipient of that email clicks on it, it will send an email to you with the word 'unsubscribe' in subject line. You will then have to manually remove that subscriber from your mailing list. The code for this is basic html, just be sure in the email you send out you have something like this: <p style="font-family: Arial, Helvetica, sans-serif; font-size: 11px; line-height: 16px; color: #999999; margin: 10px;"> To be removed from this mailing list click <a href="mailto:unsubscribe@[member=yourwebsite].com?subject=Unsubscribe&body=Please%20remove%20my%20email%20from%20your%20list" ><u>here</u></a></p> In this example, you would need to make sure that 'unsubscribe@@yourwebsite.com' is a valid email account you receive. It could be anything such as 'removeme@myemail.com' as long as it is a valid email you have set up.
  12. npn2531

    Mail Manager for OSC v2.3

    Thank you for spotting this. The mail manager contribution status is open, and it would be appreciated if you posted these changes.
  13. npn2531

    Mail Manager

    If you ran the follow sale letter once or twice a week, you would be sending out to all your sales and it only takes about three clicks. I am not familiar with how to setup cron job, but it is going to involve setting up something on your web server outside the php script itself.
  14. npn2531

    Mail Manager

    I mean 'shipped' not paid.