osCommerce, Who Cares About Product Viewed

Tracking the number of times a product is viewed is a great feature for any shopping cart to have. osCommerce has that feature. Having known that and having studied calculus so I thought it may be a good idea to also collect the time series data of the rate of change of a product being viewed. Well, that went on for almost 10 years (didn’t I say time-series data?). One day (life of a business owner first and geek second), so I thought there should be enough data to do some trend analysis and to see if it would be possible to identify a signal to purchase conversion. You know, something is not right when I was doing a sanity check on the aggregated numbers, and they are not tracking my Google Analytic numbers.

Guess what?!

osCommerce apparently indiscriminately tracked all “clicks” including robot clicks. Great! Perhaps I will have to figure out a way to reverse bootstrap my data to make something out of it. With all kidding aside, there are really more than one reason that the rate of change of product viewed from visitors may become important, as I can totally see it having a relationship in influencing supply chain management.

So if you care about product viewed and you are in the same school of thought as I on I care not robo-clicks, then go to your products_info.php file and change the line that  update the products_viewed column with this:

if (!$spider_flag) tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . 
  " set products_viewed = products_viewed+1 where products_id = '" . 
  (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . 
  (int)$languages_id . "'");

What this does is that it utilizes the default spider flag to discount a spider (robot) click–please keep that spider file up-to-date. The detail change was also documented in this pull request on my GitHub.

As for now, let’s wait another 10 years, I shall crack that code!

 

Member Approval Add On for Responsive osCommerce

This member approval plugin was put together for a B2B osCommerce site. The main feature was to be able let the site administrator to validate and approval every newly sign-up account prior to it having full access to competition sensitive information such as price and inventory. The front-end is fully responsive, and it has an upload page to allow a new account to submit the necessary registration documentation such as reseller permit, business license, picture of a store front, and etc. to verify its B2B status. One minor admin core file change required.

Features

Front-end:

  1. Accordion style login and registration.accordion_style_login_page
  2. Simple modal password forgotten.modal_password_forgotten
  3. User-friendly registration upload page. A time limit key (defaulted to 3 days) and a matching email are required to complete the upload.  registration_upload_verification
  4. The page is accessible at the end of the registration process, and via the link in the registration email. The simple jQuery fileupload tool is mobile ready and simplifies the shoot and upload. registration_upload

Admin:

  1. Admin dashborad shows customers requiring approval .customer_approavl_dashboard
  2. Simple to use customer approval interface lets the admin access the customer’s registration upload link and execute instant account approval and confirmation (email to customer). It also has some built-in flexibility allowing the admin to reset or expire the upload link.customer_approavl_admin
  3. In addition, the customer status is also added to the standard customer update page.customer_details_update_admin

Installation:

  1. Download the member approval plugin zip file https://github.com/clustersolutions/osc-member-approval/archive/master.zip.
  2. Tar over the OSC catalog.
  3. Uninstall/disable all other login/registration modules.
  4. Install Modules->Content->Member Approval Registration. cm_module_install
  5. Install Modules->Header Tags->Member Approval Header & Footer Scripts. ht_module_install
  6. Install Modules->Dashboard->Customers For Approval. d_module_install
  7. One admin core file chane. In catalog/admin/includes/boxes/customers.php, replace:
    'link' => tep_href_link(FILENAME_CUSTOMER)

    With:

    'link' => tep_href_link('customers_member_approval.php')

That’s it.

And as always, tested on Edge.

Using Smart Slider2 For WordPress In osCommerce

Ok, I am a big fan of WordPress’s plugins more than osCommerce’s addons. So it is natural that I would look for a WordPress slider to use in osCommerce before installing one of osCommerce’s addons. Well, that’s because I had done both and I tend to go with the path of less resistance. Perhaps that was the path of less resistance to me as I can code a little so it was easier to hack than had to show our creative folks on how to create or update a nifty animated slide. Here I am going to show you how I had hacked Smart Slider 2 for WordPress into an OSC demo store that I am creating. I am also going to assume that you had integrated WordPress into OSC. I must say the result had turned out great. There was definitely a learning curve on figuring out how to use the slider’s admin inteface, but once that’s done you can for sure update your OSC front page with ease.

osc_smart_slider2

Click to see it in action.

  1. Ok, here we go, and as always go to your WordPress Plugins, and I did a search using the keyword “slider” to look for a slider plugin that I could use. I had never heard of Smart Slider 2 before, but that’s what I had decided to go with after checking out their demo site. Also, you are seeing the full version of Smart Slider here as after testing the demo version I had decided to pay that $19 bucks and really gave it a “test drive.” Yes, click install now and activate and it’s done.smart_slider2
  2. Great, go the the Sliders tab and begin creating your first slider. You should definitely go to their online documentation site when you are stuck. The live preview and the ability to preview the slides in difference responsive modes was nice!

    Create you first test slider using Smart Slider's admin interface

    Create you first test slider using Smart Slider’s admin interface

  3. It may be easier to just import one of their sample sliders to modify it as your own. The import sample slider is a convenience feature.smart_slider_sample_import
  4. Now let’s get the slider you had created integrated into OSC. Get the slider number in the shortcode from step 2 above, and use it to prepare the slider number in the block of codes below (look inside the do_shortcode() function). In this example I was adding two sliders into the front page; hence, the double do_shortcode() function call. Let’s finish this step by adding this block of codes right before the closing </head> tag in your template_top.php file.
    <?php
     //Wordpress Environment...
    
     require('contents/wp-load.php');
    
     $smartslider2_frontpage = do_shortcode('[smartslider2 slider="4"]') . '' . do_shortcode('[smartslider2 slider="23"]');
    
     do_action('nextend_css');
    
     $css = NextendCss::getInstance();
    
     $smartslider2_css = '<script type="text/javascript">
    (function (w, d, u) {
     if(w.njQuery === u){
     w.bindNextendQ = [];
    
     function pushToReady(x) {
     w.bindNextendQ.push([alias.handler,"ready", x]);
     }
    
     function pushToLoad(x) {
     w.bindNextendQ.push([alias.handler,"load", x]);
     }
    
     var alias = {
     handler: w,
     ready: pushToReady,
     load: pushToLoad
     }
    
     w.njQuery = function (handler) {
     alias.handler = handler;
     return alias;
     }
     }
    })(window, document);
    </script>';
    echo $css->generateCSS();
    echo $smartslider2_css;
    
    ?>
  5. Next, add the below block of codes just before the closing </body> tag in template_bottom.php file. So, in step 4 and 5 we had basically set up the slider and asked OSC to output the necessary CSS links and Javascript codes in the header and footer to run the sliders. Typically speaking, you should be able to output the required header CSS and footer JS for WordPress by calling the wp_header() and wp_footer() functions. I tried that first but it didn’t work in this case so I had to go through Smart Slider’s codes and “re-render” them just as they did.
    <?php
     //Wordpress SmartSlider2 Footer JS...
     $js = NextendJavascript::getInstance();
     $js->generateJs();
    ?>
  6. Last step…it is to add the sliders to our OSC frontpage. It is up to you on where to put the sliders. I did mine by replacing the new products and upcoming products modules in OSC’s index.php file.
     // include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS);
     // include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS);
    
     //Wordpress SmartSlider2 Front Page...
    
     echo $smartslider2_frontpage;

Done! Ok, one last comment I had on Smart Slider 2 was the showcase slider had a short fall to me because it couldn’t do loop around. The showcase slider had integrate nicely into our full page Bootstrap design, but it was abandoned as I found the rewinding showcase a bit annoying. I had integrated a few WordPress plugins into OSC before and I think I would consider this one as difficult as I had to do a little more code digging to get it to work. However, you are definitely not limited to using Smart Slider 2 though.

Adding an FAQ Page To osCommerce using WordPress in 5 Steps.

Have you ever added an FAQ page to your osCommerce store, or any pages for that matter? Well, the steps here are nothing like that if you had “integrated” WordPress into osCommerce by following this post.

  1. From you WordPress go to Plugins and do a search for FAQ. I pick Arconix FAQ for my install as I like it being simple. Install and activate, done!faq_1
  2. Now, create an Q & A inside the FAQ menu. Click publish.faq_2
  3. You need to make the FAQ plugin available in a page, and to do this you’d need to create a page, and then add the FAQ shortcode (yep, that square bracket denotes a WordPress shortcode) into the content of that page. Click publish again.faq_3
  4. Click on View Page on the top menu and you should be able to see the FAQ page you had just created. Note the URL for the FAQ page. See this page live here.faq_4
  5. Make that URL link available in your osCommerce. I added mine to the footer content module information link with this line, and don’t forget to update your language file also.
    <li><a href="<?php echo tep_href_link('wordpress/faq/'); ?>"><?php echo MODULE_CONTENT_FOOTER_INFORMATION_FAQ; ?></a></li>

A nifty little Q & A tool with drop down with content that’s very easy to update. So what do you want your plugins to do?

Integrating WordPress Into osCommerce

I had been integrating WordPress into osCommerce 2.2 since 2008 based on several online tutorials. It was a daunting task as there were a few files that needed to be modified and it was a maintenance nightmare whenever there’s a software upgrade. Then there were other similar integration attempts in both communities, OSC into WordPress or WordPress into OSC, and I had no clue what had became of them. Well, since the modular top and bottom templates implementation in OSC 2.3, integrating WordPress and OSC had actually gotten a lot easier; hence, the creation of this WordPress-OSC template. The idea was basically to make OSC’s modular header and footer available in a WordPress template. So let’s take this out for a spin…

  1. Install WordPress in a sub-folder inside the OSC catalog. Here, my sub-folder name is “wordpress.”

    Install WordPress inside of OSC's catalog

    Install WordPress inside of OSC’s catalog and make sure that it is working.

  2. Create a symbolic link of the OSC includes folder in the wordpress sub-folder. This allows WordPress to call OSC functions. You should be able to do this via Cpanel, but this was the shell command I used in my wordpress folder:
    ln -s ../includes .
  3. Download my Westfalia theme on Github, and copy it inside your “wordpress/wp-content/themes/” folder.
  4. Login to your WordPress and activate the Westfalia theme (for Bootstrap version but I have the 2.3 version somewhere on a production server. You really should be migrating to the Bootstrap/responsive version anyway, but do ask if you really want it).

    Activate the Westfalia theme for WordPress

    Activate the Westfalia theme to integrate WordPress with OSC

  5. That is! Now, set your permalinks, create a page, and you can set your OSC link to point to the page like this:  define(‘FILENAME_SHIPPING’, ‘wordpress/shipping/’);

    Your integrated WordPress and OSC

    Your WordPress theme should now look seamless with OSC.

Yes, modifing an OSC page gets a lot easier. I had never gotten into OSC’s Articles Manager as my teeth clench every time I had to install an OSC addon. Oh, you should also install an SEO as well as the Akismet plugins as a minimum for your WordPress install. Hey, what’s fun without a little adventure, right?

 

 

A Responsive osCommerce

About a year ago I started updating osCommerce 2.3.1 with Mini Template with all the “belts and whistles” that I had accumulated over the past ten years. At the time my thought was to add a separate mobile package later to make this engine mobile ready. Well, a lot had changed in the last 11 months, and responsive is the only way to go.

This was not an easy decision as I really like Mini Template and its flexibility to server our marketing goals. But having a responsive engine far out weight marketing flexibility for now…well, until Mini Template goes responsive…

So you may share my frustration with osCommerce if you are in the online trenches and perhaps just don’t have the time and resources to wait or implement some of the good add-ons that should’ve been in the core engine. Thank goodness for Gary Burton and the osCommerce community for pushing out the responsive osCommerce fork. So in the last month I had forked Gary’s project and began incorporating what I thought was good add-ons to this responsive osCommerce fork. Hopefully, write once and use again by many?!

So here is  a tally on what I had done so far, and please feel free to download, test, use and add to it…

  1. Header Tag SEO (you should know why this is needed).
  2. Ultimate SEO URL5 by FWR (yeah, I use Magento but I like the simplicity of OSC. Plus, it’s a good idea to keep all the indexed URLs the same. Is there a Magento hack out there that offers OSC style URLs?)
  3. Simple Registration that I hack up several years ago (for real, you want people to sign up and you are asking them for birthday, address, phone no. and etc.?)
  4. Facebook Login with the ability to re-request permission (this may becoming useless as Facebook is changing permission requirements, but for continuity sake for us.)
  5. Simplified checkout (from 3 to 2 pages, but 2 pages are still too long.)

Coupon Code & Gift Voucher (CCGV) is in the work. The thread that support this add-on is so dead, but I have been using this for 10 years now so I am my own thread. The CCGV was great for discount and coupon, but the real benefit was to be able to tweak it to offer online credit as well as cash back reward in the form of credit.

So here is my Github link: https://github.com/clustersolutions/osCommerce-234-bootstrap. Do contact me for any issues you may find. Let’s make this the best e-commerce engine built for store owners.

 

osCommerce 2.3.3 to 2.3.4 Upgrade Notes

We are working to update our osCommerce platform and as we deploy both the 2.2 and 2.3 based engines; so we are in the process of defining a commercial ready engine that we can migrate them to. The main criteria in this new engine was it must be mobile ready and it must offer a template for quick marketing response.

Since last year we have been incorporating a lot of the bells and whistles such as social login, store credit and coupon code, and ERP integration and etc. into the 2.3.3 engine, and in order to bring this engine to 2.3.4, several updates had been applied. The overall update was successful but not without minor hiccups as listed below:

  1. Ultimate SEO URL 5 from FWR produced errors from the database function update. For now caching can only be via file and not MySQL. Reference error in http://forums.oscommerce.com/topic/394421-admin-login-loop-after-upgrade-2331-to-2332/page-2.
  2. Replace bxGallery and FancyBox with PhotosetGrid and ColorBox not implemented as our current engine uses jqzoom.
  3. New Content Modules implementation for the Account, Checkout Success, & etc. TBD for the reason it conflicts with our social login and simply 2 page checkout mods.

 

 

Free Open Source ERP For Apparel Management

Business Check PrintingYesterday I was asked by a vendor on how we print our checks. So I told him we use SQL-Ledger. The ironic part about the conversation was I had always thought of this company as fairly technology driven, and they actually had an inventory control system that may be 80 to 90% accurate. In fact, just the day before I was having a conversation with a friend, who’s an implementation manager for an airport software company, on how I think most of the fashion industries were so “backward.” I told him a lot of times we found ourselves in the warehouse of a designer helping to look for merchandises as he or she had no inventory control system in place that could tell where things were. Then this was no surprise to me as unless you have plenty of cash flows, my estimate was majority of the small size fashion companies had not the profit margin to invest in I.T. software or people. After all, I knew how “expensive” I could be, and just imagine when the software licensing starting to add up. Continue reading

Getting SQL-Ledger Data Around

SL & OsCommerce Software Stack

SL & OsCommerce Software Stack

SQL-Ledger offers a nice inventory control module (a.k.a. Goods & Services) that provides inventory count, and making its data available to our online store allows real-time inventories and more. For our servers that are at different locations, this could be done by querying the SL server in real time, but a lost of communications could disable our production system in this synchronous setup. So we use Slony-I to replicate data. Continue reading