51 (edited by ckrosco 06/15/2010 02:22:15 am)

Re: osCommerce

I used this module to import customers - worked flawlessly, although I had to change

$one_database = 1; // Use one DB

to

$one_database = 0; // Use one DB

This is for the same database server, but two different data bases.

All customers are accessible via the 'Add and Manage Customers' menu.

But after importing some orders, I don't know what to do with them. I cannot see these orders anywhere.

Reading the above posts, I think the orders have been imported as Sales Orders, so I should be able to use "Delivery Against Sales Orders", but no matter what options I choose for search, "No records" are returned.

What is the next step after importing orders?

-----------------

Looking at the FA database, I see the imported order in the 'sales_order' table, but there is nothing in the 'sales_order_details' table, or anywhere else I can see that has details about each order.

So I guess something is wrong - right?

Re: osCommerce

ckrosco wrote:

So I guess something is wrong - right?

Yes something was wrong. I'm using this for Zen Cart and I had to modify some of the add_to_order fields (around line 495).

So now it works great! Except one thing - I would like the date to reflect the actual date of the order. Right now, you have it coded as:

$cart->document_date = TODAY();
$cart->due_date = TODAY();

I tried to get the date from the Zen Cart database with:

$sql = "SELECT DATE(date_purchased) FROM orders WHERE orders_id = $oID";
$result = mysql_query($sql, $osc);
$date_purchased = mysql_fetch_assoc($result);
mysql_free_result($result);   

And then using:

$cart->document_date = $date_purchased;
$cart->due_date = $date_purchased;

but this doesn't work.

Isn't there an elegant way to get the actual order date?

Re: osCommerce

Once you have finished debugging, do you plan to upload your mod to the community?

Re: osCommerce

Yes I can do that, but I am not a programmer, and there are several shortcomings to this - the biggest being that if your items are priced by attributes, and attributes are weights, your imported orders may not accurately reflect the change in inventory.

If your products are priced by item, this will work great as I have it now. Where do I upload it?

Re: osCommerce

ckrosco - when you are done please send me your file and I will update and post the new file for all to use

Thanks!

56 (edited by rodw 11/21/2010 03:08:33 am)

Re: osCommerce

hi guys

I have used this before in the earlier version.

I am trying to get this working in FA 2.3 RC3 and am running into troubles. It is getting as far as creating the new data table but then it never finds the table again so the Update MySql Button is never displayed.

I have narrowed it down to this bit of code which sets $found = 1 if it appears in the show tables list returned by SHOW TABLES.

$sql = "SHOW TABLES";
$result = db_query($sql, "could not show tables");
$found = 0;
while (($row = db_fetch_row($result))) {
    if ($row[0] == TB_PREF."oscommerce") $found = 1;
}

I have confirmed it is not formatting the table name correctly in a multi company situation as if I ask it to look for a hard coded "0_oscommerce", it works.

So how do you return a string with the company number prepended to the table name?

[b]RodW[/b]
Brisbane, QLD, Australia

Re: osCommerce

I can't imagine that that has changed.

Is it possible that TB_PREF is wrong?

What company number are you working with?
Maybe the module install had TB_PREF set wrong?

tom

Re: osCommerce

Yes, in 2.3RC3 changes were made related to TB_PREF. Now  TB_PREF is set to '&TB_PREF&'   pattern which is superseded by right preffix just in db_query(). This was necessary to enable right upgrade on multi-database installations (where).

Also I'm not sure about the right place for function definitions in extension file. Probably the better one would be below all include() lines.

Janusz

Re: osCommerce

Thanks to Janusz for pointing out my mistake.

I have submitted a new release for posting on the website.

I also added code to automatically detect if you are using the same DB for both.

It pretty much assumes that if the server and db name you give have osc tables in them
then you are using one DB, otherwise they are separate.

You still should use a unique mysql user if you are using different db's on the same server.

I look for the osc table 'order_status_history' actually I look for a table that contains that
string anywhere in the name kajsdfgajs_order_status_history_laksdaklsjd matches

I hope this helps

tom

Re: osCommerce

Tomand I have done a bit more work on this and it is looking good for a 2.3 version with GST/VAT support for tax inclusive pricing.

We need to check out the impact of different customer records in 2.3. Eg Customer/Branch/Contact and neither of us has looked at that yet. Any pointers will be appreciated. The earlier 2.2 version only went Customer/Branch

[b]RodW[/b]
Brisbane, QLD, Australia