Importing oscommerce into WooCommerce

oscommerce is a very good platform that is very flexible and allows any kind of possible customization. However, as far as design layout and user interface go, those are not oscommerce’s forte.

That said, I have a few clients who have requested that they be upgraded to a new ecommerce platform. Having looked at Magento, Open Cart, I have finally decided on WooCommerce. For those of you that are not as familiar with WooCommerce, it is a full-scale ecommerce plugin that allows your WordPress-based website to become a fully featured ecommerce shop.

A logical step for migrating to a new ecommerce platform involves importing the data from the old platform (oscommerce in this case) into WooCommerce. I understand WooCommerce offers an importer through Tools->Importers->Wordpress. I ran their dummy_data.xml file through that importer.

However, I was specifically looking for an importer that would extract the information (Categories, Products, Orders and Customers) from oscommerce. Enter “WooCommerce  oscommerce Import” to the rescue. While it worked smoothly for the most port, easily importing all products, categories, orders and customers, I ran into one small glitch.

The Categories imported from osCommerce appeared twice in both the Admin Dashboard and the Front end of the site. I have documented a support post for this issue. While I was not able to completely root cause the issue, the workaround that worked for me (quite nicely, I might add), was to comment out one of the function calls inside the woocommerce_osc_run_cats function.

//add_woocommerce_term_meta($term[‘term_id’], ‘order’,$category[‘sort_order’]);

It seems like there is another piece of code somewhere else (outside of this plugin) that adds an ‘order’ entry to the wp_wocommerce_termmeta table for each category. So when I commented out the call from the plugin, there was only 1 entry for ‘order’.

If someone has run into this issue or have some other feedback, please respond in the Comments below.

Same Page HTML Anchor Not Working? Here is why

I have often encountered this issue where same page anchors do not work. When you click on a link that is supposed to take you to the designated position in the same page (as marked by the anchor), instead you land on the homepage with the name of the anchor appended to the home page URL.

For example, there is a Back To Top link that should return the user to the top of the same page. After tinkering a bit with it, I found out that the “base href” HTML tag plays a role in determining how these anchors work.

If your “base href” is set like this (click on View Source from the right click menu):

<base href=”http://www.example.com”>

Turns out that this tag controls the relative path of all same page anchors. Not really sure what this is used for, so I was able to remove it.

Without this, the same page anchors started working nicely. I am guessing that if this tag is correctly populated with the full path of the URL (not just the domain name), same page anchors should work equally well.