26 (edited by tom 05/08/2009 05:37:12 pm)

Re: osCommerce

I see the html_entity_decode calls in write() of sales/includes/cart_class.inc

AH HA!

I think I should be doing a $cart->write instead of add_sales_order!

Yes that fixed it!

whew

Re: osCommerce

I think so, write method is the right one to store item_cart content to database smile.
BTW htmlspecialchars_decode is PHP5 only function, so we use html_entity_decode instead to support PHP4. I forgot details why in db_escape()  htmlspecialchars is used and not htmlentities, but this works right.

Janusz

Re: osCommerce

Not bad for a hacker of my vintage...

yes i recall having wrapper functions for the basic stuff to handle the PHP3 to PHP4 transition...
(or maybe it was PHP4 point releases... a lot was in flux then)

Tom

29 (edited by enmityjac 07/23/2009 05:15:14 am)

Re: osCommerce

I get an error when I try to run the import.  In my log says:

[Wed Jul 22 23:05:19 2009] [error] [client XX.XX.XX.123] 0:admin:ui_lists.inc:23: Non-static method reserved_words::get_all() should not be called statically, referer: http://www.XXXXX.com/frontaccount/modules/osc/osCommerce.php?
[Wed Jul 22 23:05:21 2009] [error] [client XX.XX.XX.123] 0:admin:ui_lists.inc:23: Non-static method reserved_words::get_all() should not be called statically, referer: http://www.XXXXX.com/frontaccount/modules/osc/osCommerce.php
[Wed Jul 22 23:05:21 2009] [error] [client XX.XX.XX.123] 0:admin:osCommerce.php:488: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource, referer: http://www.XXXXX.com/frontaccount/modules/osc/osCommerce.php
[Wed Jul 22 23:05:21 2009] [error] [client XX.XX.XX.123] 0:admin:osCommerce.php:491: mysql_free_result(): supplied argument is not a valid MySQL result resource, referer: http://www.XXXXX.com/frontaccount/modules/osc/osCommerce.php
[Wed Jul 22 23:05:21 2009] [error] [client XX.XX.XX.123] 0:admin:osCommerce.php:494: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource, referer: http://www.XXXXX.com/frontaccount/modules/osc/osCommerce.php
[Wed Jul 22 23:05:21 2009] [error] [client XX.XX.XX.123] 0:admin:osCommerce.php:496: mysql_free_result(): supplied argument is not a valid MySQL result resource, referer: http://www.XXXXX.com/frontaccount/modules/osc/osCommerce.php
[Wed Jul 22 23:05:21 2009] [error] [client XX.XX.XX.123] 0:admin:ui_lists.inc:934: Non-static method reserved_words::get_all_numeric() should not be called statically, referer: http://www.XXXXX.com/frontaccount/modules/osc/osCommerce.php
[Wed Jul 22 23:05:21 2009] [error] [client XX.XX.XX.123] 0:admin:date_functions.inc:127: date() [<a href='function.date'>function.date</a>]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Denver' for 'MDT/-6.0/DST' instead, referer: http://www.XXXXX.com/frontaccount/modules/osc/osCommerce.php
[Wed Jul 22 23:05:21 2009] [error] [client XX.XX.XX.123] 0:admin:date_functions.inc:128: date() [<a href='function.date'>function.date</a>]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Denver' for 'MDT/-6.0/DST' instead, referer: http://www.XXXXX.com/frontaccount/modules/osc/osCommerce.php
[Wed Jul 22 23:05:21 2009] [error] [client XX.XX.XX.123] 0:admin:date_functions.inc:129: date() [<a href='function.date'>function.date</a>]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Denver' for 'MDT/-6.0/DST' instead, referer: http://www.XXXXX.com/frontaccount/modules/osc/osCommerce.php
[Wed Jul 22 23:05:21 2009] [error] [client XX.XX.XX.123] 0:admin:date_functions.inc:140: date() [<a href='function.date'>function.date</a>]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Denver' for 'MDT/-6.0/DST' instead, referer: http://www.XXXXX.com/frontaccount/modules/osc/osCommerce.php
[Wed Jul 22 23:05:22 2009] [error] [client XX.XX.XX.123] 0:admin:ui_lists.inc:23: Non-static method reserved_words::get_all() should not be called statically, referer: http://www.XXXXX.com/frontaccount/modules/osc/osCommerce.php?action=cimport
[Wed Jul 22 23:05:22 2009] [error] [client XX.XX.XX.123] 0:admin:osCommerce.php:282: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource, referer: http://www.XXXXX.com/frontaccount/modules/osc/osCommerce.php?action=cimport



Can anyone help?

Re: osCommerce

enmityjav what version of PHP are you using? If it's 5.3 you might need to downgrade: 5.3 is much stricter on object creation and usage. Your first error sounds like the code is calling a method on a static object which doesn't exist. Also, your timezone error is something that I first saw PHP complain loudly about in 5.3. It's easy to fix, BUT I suspect it is only the very beginning of problems you will have with 5.3.

Re: osCommerce

I have downloaded and Installed the osCommerce integration module. It imports customers and sales orders from osCommerce accurately. Although I have one question. The items created in osCommerce how are they being integrated with FA. Do I create the items in FA or osCommerce, and how do I sync the items on both applications. Thank you.

Re: osCommerce

The osC ProductsID must match the FA ItemID.
If you run the osCommerce 'Price Check' it will point out errors

I have noticed that I do not resolve some Item Codes properly.

ex. osC AL-075M is really FA HA-60 it does not resolve properly.
I will look into that too

Re: osCommerce

Joe,

I am updating the oscommerce module for FA22 and have a question about security areas:

$security_areas['SA_OSCIMPORT'] = array(SS_SALES|100, "osCommerce Customer / Order Import");


I looked at other modules but do not see any hint at rules for the array values.

In the above statement I used 100, but do those have to be unique for all entries?
for the SS_SALES group? etc

tom

Re: osCommerce

There are no fixed rules regarding the asignment of values. Only the core values are starting at 1. So starting a bit up in the sequence seems to be the way of doing it. And checking with other similar modules that they do not share the same values.

/Joe

Re: osCommerce

I wonder if it would be easy to check the values in setup when enabling roles. (Since they are all listed on that page)

Re: osCommerce

Yes, maybe we can extend the global array, $installed_extensions, with access roles variables. I will discuss this with Janusz, when he is back in office.

/Joe

Re: osCommerce

Hello Tom,

You can use sucurity area codes starting from 100 for extension module.They are anyway rewritten during installing extension, and you will never use SA numeric codes directly, only string security areas identifiers like 'SA_OSCIMPORT'.
All this is explained in FrontAccounting access control system basics article. If some info is missing feel free to update the documentation.
Janusz

Re: osCommerce

Got it thanks.

Also the osc import for FA22 has been posted to the downloads section

39 (edited by rodw 03/01/2010 08:25:39 am)

Re: osCommerce

Hi guys,

I had a go at using this today and tried to import the customers and it says customers found, but nothing is imported.

Exact steps i took was to install the Australian Chart of accounts which sets up the tax codes and the I went back into osCommerce and set tax codes and classes to agree with FA. Then I made sure the default tax class was set for the customers.

I have the customer categories add on so I have different prices for retail and wholesalers etc. Would this have an impact?

Rod

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

Re: osCommerce

How do you check to see if any customers were created?

Tom

Re: osCommerce

tom wrote:

How do you check to see if any customers were created?

Tom

I looked in FA but your script says none are added. I just checked the SQL table for 0_debtors_master too!

What table to you store your next numbers to process in?

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

Re: osCommerce

rodw wrote:
tom wrote:

How do you check to see if any customers were created?

Tom

I looked in FA but your script says none are added. I just checked the SQL table for 0_debtors_master too!

What table to you store your next numbers to process in?

I found it. The Id's are both 0.

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

Re: osCommerce

You can set the customerID range by changing:

Starting osC Customer ID:   
Ending osC Customer ID:

before you click [Import osC Customers]

Re: osCommerce

It sounds like you are having trouble accessing the osc database.

on line 123 of /modules/osc_orders/osCommerce.php do you have this?

$one_database = 1; // Use one DB

This was the problem for someone else, maybe I have the default set poorly...
What do you have it set to?

tom

Re: osCommerce

Tom, That is what was in your default file and I have not changed it. Fairly steep learning curve for one day for me. I'll have a good look at once I get my head around FA a bit better.

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

Re: osCommerce

I have been meaning to write a Summary page that gives more debug info.

Maybe it's time for that...

tom

47 (edited by rodw 03/07/2010 11:24:52 am)

Re: osCommerce

OK Tom, I am ready to tackle this now as I have made a commitment to use FA from her on.

I see a green bar that says customers found, 0 customers imported. How can I debug this? Can I get FA to print some messages on the screen about what it finds?

t could be my setup as I have added a module to OsC that allows me to have multiple price breaks whihc are each asociated with a tax type. It is possible your module is not looking deep enough in the OsC data files on my setup due to this.

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

Re: osCommerce

Rod,

I can help. I am sorry it has taken me so long to reply.

Let's talk directly.

tom

Re: osCommerce

tom wrote:

The osC ProductsID must match the FA ItemID.
If you run the osCommerce 'Price Check' it will point out errors

Can you clarify this?

osc:

products_id in products table

should match

FrontAccount:

id in item_codes table

Is that correct?

Re: osCommerce

Yes that sounds right

tom