1 (edited by khkoh 02/09/2014 02:41:37 pm)

Topic: osCommerce Order and Customer Import Module

Hi there,

I have installed FA 2.3.19.   And I have installed/activated Extension "osCommerce Order and Customer Import Module".  Under the Install/activate Extension Tab, I have activated it by selecting the Campany name.    However, I cannot see this extension under Access Setup for me to provide the access permission (I have the Administrator access rights).  When I comb through all the tabs, I also cannot find any navigation items pertaining to this module/extension.

When I go to the www.domain.com/modules/osc_orders/osCommerce.php, it shows me this message:

"The security settings on your account do not permit you to access this function"

I would appreciate if anyone could share or advise how I could get this extension setup.

Thanks!

Re: osCommerce Order and Customer Import Module

Roles permissions must be enabled for the user

Re: osCommerce Order and Customer Import Module

apmuthu wrote:

Roles permissions must be enabled for the user

Thanks apmuthu.  I actually have the role permission of Admin and has checked all the items and I login to admin.  The issue is I did not see an item of OScommerce  for me to check.

Any further advise you could provide?  Thanks again.

Best regards
KH

Re: osCommerce Order and Customer Import Module

Please logout, clear browser cache and also purge the js files in the company folder so that they get re-created and then try again.

5 (edited by geoffreywalton 12/17/2014 09:50:28 pm)

Re: osCommerce Order and Customer Import Module

Hi

I have come over here after supporting oscommerce since 2007 so was interested in the interface between these 2 systems.

I was most upset to see this extension did not work out of the box and found the option to give access to a user was not visible, just as described above.

After further investigation I have found the contents of hooks.php is incorrect. If you change it to

<?php
define ('SS_OSCORDERS', 106<<8);

class hooks_osc_orders extends hooks {
    var $module_name = 'osCommerce Order Import';

    /*
        Install additonal menu options provided by module
    */
    function install_options($app) {
        global $path_to_root;

        switch($app->id) {
            case 'orders':
                $app->add_rapp_function(2, _('osCommerce Import'),
                    $path_to_root.'/modules/osc_orders/osCommerce.php', 'SA_OSCORDERS');
        }
    }

    function install_access()
    {
        $security_sections[SS_OSCORDERS] =    _("osCommerce Order Import");

        $security_areas['SA_OSCORDERS'] = array(SS_OSCORDERS|106, _("osCommerce Order Import"));

        return array($security_areas, $security_sections);
    }
}
?>

And hey-presto, you can now give access rights to users and they will be able to see the option on the Sales tab.

Incidentally why do you have to test for orders when the tab is called sales?

            case 'orders':

Is it just a cunning ploy to make it difficult for new developers?

Unfortnately that is not all you need to do, in osCommerce.php replace all occurrences of

"$table_style2 w

with

TABLESTYLE2, "w

and

start_table($table_style);

with

start_table(TABLESTYLE);

On line 229 change table type to read

ENGINE=MyISAM

That should allow you to start up the application.

Select the configure option and enter your osc db credentials.

Now you can import your customers, check prices and update prices. Make sure you have backups of both DBs before you start playing!!!!

I suspect the order import will fail big time if the osc model/products numbers are not synchronised to the FA Item nos.

The check prices option will show what needs to be done.

I suspect the next stage is to update the stock in OSC from FA.

Anyway this should get you going.

Cheers

G

6 (edited by apmuthu 12/18/2014 04:56:28 pm)

Re: osCommerce Order and Customer Import Module

@geoffreywalton: That is a good catch!

You're right about the orders <==> sales nomenclature - it had me stumped for a while in the early days, but I guess it was to distinguish it from the "sequential order" connotation.

The function start_table() is in the includes/ui/ui_controls.inc file that must have gotten the constants after the original osc_import (and now osc_orders) extension was made.

@joe: You may take the version bumped commit from my GitHub repo.

Post's attachments

osc_orders_v2.3.0-4.zip 7.9 kb, 8 downloads since 2014-12-18 

You don't have the permssions to download the attachments of this post.

Re: osCommerce Order and Customer Import Module

Hi,
I am trying the setup of the module, after installing from the files in this post, I have this error, when I click to create the table:

DATABASE ERROR : Error creating table
error code : 1064
error message : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=MyISAM' at line 1
sql that failed was : CREATE TABLE fa_oscommerce ( `name` char(15) NOT NULL default '', `value` varchar(100) NOT NULL default '', PRIMARY KEY (`name`)) TYPE=MyISAM

Where and which modifications I need to do ?
Thank You

Re: osCommerce Order and Customer Import Module

TYPE keyword is depreciated (since MySQL v5.0) and not supported in MySQLv5.5.

Replace TYPE=MyISAM with ENGINE=MyISAM

@Alan: nice catch

Get the amended file from the commit in my GitHub Repo.

Post's attachments

osc_orders.zip 7.9 kb, 6 downloads since 2015-03-03 

You don't have the permssions to download the attachments of this post.

Re: osCommerce Order and Customer Import Module

The corrections have been ported to the FA v2.4.1's module osc_orders.

Check the commits on this fork as well.