Post by op_sjo » Sat Jul 04, 2009 2:25 pm

And the import script too? (if there is one)

Newbie

Posts

Joined
Thu Jul 02, 2009 6:14 am

Post by JNeuhoff » Sat Jul 04, 2009 6:27 pm

And the import script too? (if there is one)
The file admin/model/tool/export.php does both the Export and Import and is therefore the only only which needs to be updated with the DB_PREFIXes.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by op_sjo » Mon Jul 06, 2009 4:16 pm

I had a glance a the code over the weekend but I really don't have time to do this change. If anyone else fancies doing it i'd be more than happy to donate something into the pot.

Newbie

Posts

Joined
Thu Jul 02, 2009 6:14 am

User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by raju_makwana » Fri Sep 18, 2009 3:46 am

Hello i got the below error at the time of xport.

Unknown: Only variables should be assigned by reference in D:\xampp\htdocs\winehunter\admin\model\tool\export.php on line 1105Unknown: Only variables should be assigned by reference in D:\xampp\htdocs\winehunter\admin\model\tool\export.php on line 1106Unknown: Assigning the return value of new by reference is deprecated in D:\xampp\htdocs\winehunter\admin\Spreadsheet\Excel\Writer\Workbook.php on line 193Unknown: Assigning the return value of new by reference is deprecated in D:\xampp\htdocs\winehunter\admin\Spreadsheet\Excel\Writer\Workbook.php on line 202Warning: Cannot modify header information - headers already sent by (output started at D:\xampp\htdocs\winehunter\admin\index.php:57) in D:\xampp\htdocs\winehunter\admin\Spreadsheet\Excel\Writer.php on line 68Warning: Cannot modify header information - headers already sent by (output started at D:\xampp\htdocs\winehunter\admin\index.php:57) in D:\xampp\htdocs\winehunter\admin\Spreadsheet\Excel\Writer.php on line 69Warning: Cannot modify header information - headers already sent by (output started at D:\xampp\htdocs\winehunter\admin\index.php:57) in D:\xampp\htdocs\winehunter\admin\Spreadsheet\Excel\Writer.php on line 70Warning: Cannot modify header information - headers already sent by (output started at D:\xampp\htdocs\winehunter\admin\index.php:57) in D:\xampp\htdocs\winehunter\admin\Spreadsheet\Excel\Writer.php on line 71Warning: Cannot modify header information - headers already sent by (output started at D:\xampp\htdocs\winehunter\admin\index.php:57) in D:\xampp\htdocs\winehunter\admin\Spreadsheet\Excel\Writer.php on line 72Unknown: Non-static method OLE::Asc2Ucs() should not be called statically, assuming $this from incompatible context in D:\xampp\htdocs\winehunter\admin\Spreadsheet\Excel\Writer\Workbook.php on line 593Unknown: Non-static method OLE::Asc2Ucs() should not be called statically, assuming $this from incompatible context in D:\xampp\htdocs\winehunter\admin\OLE\PPS\Root.php on line 52Unknown: Non-static method OLE::LocalDate2OLE() should not be called statically, assuming $this from incompatible context in D:\xampp\htdocs\winehunter\admin\OLE\PPS.php on line 190Unknown: Non-static method OLE::LocalDate2OLE() should not be called statically, assuming $this from incompatible context in D:\xampp\htdocs\winehunter\admin\OLE\PPS.php on line 191Unknown: Non-static method OLE::LocalDate2OLE() should not be called statically, assuming $this from incompatible context in D:\xampp\htdocs\winehunter\admin\OLE\PPS.php on line 190Unknown: Non-static method OLE::LocalDate2OLE() should not be called statically, assuming $this from incompatible context in D:\xampp\htdocs\winehunter\admin\OLE\PPS.php on line 191ÐÏࡱá����������������;��þÿ �����������������������������

Newbie

Posts

Joined
Fri Sep 18, 2009 3:21 am

Post by JNeuhoff » Fri Sep 18, 2009 4:34 am

What version of OpenCart are you using?
And what version of PHP?

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by hazymat » Mon Jun 21, 2010 2:16 am

Hey Juergen

I love this contrib, it has been really useful.

Quick question: how easy is it to amend the contrib to support other mods? For example, I'd love to use it in conjuction with QPhoria's excellent mod "Options Plus", which adds extra columns to databases for things like size and weight for each option.

If it's reasonably simple (I'm guessing no!) then I'd like to have a go at this myself, with a bit of guidance...

Many thanks

Mat

New member

Posts

Joined
Mon Oct 05, 2009 2:25 am

Post by JNeuhoff » Mon Jun 21, 2010 2:45 am

Hi Mat,

It shouldn't be too hard if you know PHP and MySQL a bit. Just add the additional product option fields needed for your purposes in file

admin/model/tool/export.php

in the import methods:

validateOptions
uploadOptions
storeOptionsIntoDatabase
storeOptionDetailsIntoDatabase
storeOptionNamesIntoDatabase

and for the export in methods

populateOptionsWorksheet

User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by silvermarbles » Wed Jul 21, 2010 4:23 am

Hello all,

I have been reading about this Import/Export module from here and it seems most of the talk has been mostly a year ago. Hopefully i can still salvage some help with an error exporting from this module.

I get this error (which is dumped in the Excel file when i try to export)

My shop has around 1000 products, 20 categories. the import works fine but I cannot export.

Error: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay<br />Error No: 1104<br />SELECT p.product_id, pd.name, GROUP_CONCAT( DISTINCT CAST(pc.category_id AS CHAR(11)) SEPARATOR "," ) AS categories, p.sku, p.location, p.quantity, p.model, m.name AS manufacturer, p.image AS image_name, p.shipping, p.price, p.date_added, p.date_modified, p.date_available, p.weight, wc.unit, p.length, p.width, p.height, p.status, p.tax_class_id, p.viewed, pd.language_id, ua.keyword, pd.description, pd.meta_description, p.stock_status_id, mc.unit AS length_unit, GROUP_CONCAT( DISTINCT CAST(pr.related_id AS CHAR(11)) SEPARATOR "," ) AS related FROM `product` p LEFT JOIN `product_description` pd ON p.product_id=pd.product_id AND pd.language_id=1 LEFT JOIN `product_to_category` pc ON p.product_id=pc.product_id LEFT JOIN `url_alias` ua ON ua.query=CONCAT('product_id=',p.product_id) LEFT JOIN `manufacturer` m ON m.manufacturer_id = p.manufacturer_id LEFT JOIN `weight_class_description` wc ON wc.weight_class_id = p.weight_class_id AND wc.language_id=1 LEFT JOIN `length_class_description` mc ON mc.length_class_id=p.length_class_id AND mc.language_id=1 LEFT JOIN `product_related` pr ON pr.product_id=p.product_id GROUP BY p.product_id ORDER BY p.product_id, pc.category_id;

Any help would be most appreciated.

Thank you ;)

User avatar
New member

Posts

Joined
Thu Jun 17, 2010 4:06 am
Location - Telford, Shropshire

Post by JNeuhoff » Wed Jul 21, 2010 5:17 am

As the error message suggests:

Try and change your MySQL configuration so that:

SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=sufficient high number, e.g. 20

Ask your web host support on how to change these settings, or whether they can do it for you.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by silvermarbles » Wed Jul 21, 2010 5:37 am

Ok great thanks.

My host company says this in there support database:

MySQL will refuse to execute select statements that process a very large number of rows. You should either adjust your select statement to make it more efficient, or set SQL_BIG_SELECTS=1 in the session before executing the large select statement. Use something like this to do that ..

$db->sql_query("SET OPTION SQL_BIG_SELECTS=1");

Where could i use this?

User avatar
New member

Posts

Joined
Thu Jun 17, 2010 4:06 am
Location - Telford, Shropshire

Post by silvermarbles » Wed Jul 21, 2010 4:28 pm

I have fixed the problem, its working fine now! :)

Online 1187 of the admin/model/tool/export.php script

I added

mysql_query("set sql_big_selects=1");

Works great.

User avatar
New member

Posts

Joined
Thu Jun 17, 2010 4:06 am
Location - Telford, Shropshire

Post by cmebd » Thu Jul 22, 2010 8:27 am

JNeuhoff wrote:Hi Mat,

It shouldn't be too hard if you know PHP and MySQL a bit. Just add the additional product option fields needed for your purposes in file

admin/model/tool/export.php

in the import methods:

validateOptions
uploadOptions
storeOptionsIntoDatabase
storeOptionDetailsIntoDatabase
storeOptionNamesIntoDatabase

and for the export in methods

populateOptionsWorksheet
Not being a programmer - I have a need to have readyman's GlobalAttributes module included in the Import/Export of data is there any step by step help on how I could achieve this?

Alternately is there someone who is willing to do this for me? More than happy to contribute.

Cheers

A stupid question is the one you -don't- ask.........(Anon)

)C1.5.0.1 (IN devel)
OC V1.4.9.5
OC V1.4.9.2
OC V1.4.7
OC V1.3.4


User avatar
Active Member

Posts

Joined
Fri Nov 13, 2009 11:17 am
Location - Tasmania, Australia

Post by mixxin » Thu Dec 23, 2010 8:24 am

Is there a way to only update or add new to the database via the spreadsheet without wiping out the whole database?

Mixxin

Newbie

Posts

Joined
Thu Sep 23, 2010 9:03 am

Post by hazymat » Tue Jan 04, 2011 1:32 am

mixxin wrote:Is there a way to only update or add new to the database via the spreadsheet without wiping out the whole database?

Mixxin
Nope - the best way to do this is to do an initial export to spreadsheet, then add new products to this spreadsheet underneath the existing products. It's quite simple and no reason to get confused between old and new products.

New member

Posts

Joined
Mon Oct 05, 2009 2:25 am

Post by hazymat » Tue Jan 04, 2011 1:38 am

If you want to use Export/Import module with QPhoria's excellent Options Plus module, read on.

If not, ignore this!

----
QPhoria's Options Plus module adds additional parameters to Product Options. It's really useful.

First things first, this mod adds weight to the import/export module, because that's the only thing I needed to add. It should be pretty simple to add any of the other extended options.

Secondly, you need to make sure that Import/Export module works correctly with the version off OC you have installed (sorry if this is obvious!)

You only need to update the file: \admin\model\tool\export.php

Here's a list of updates to that file. Please note I re-traced my steps on an older version of Export/Import, but I'm sure not much has changed, and the principle is the same.

Once again, the updates I made are just for weight, but I think there's no reason why you can't make them for any of the additional options.

1/ Search for:

$sql = "INSERT INTO `".DB_PREFIX."product_option_value` (`product_option_value_id`, `product_id`, `product_option_id`, `quantity`, `subtract`, `price`, `prefix`, `sort_order`) VALUES ";

replace with:

$sql = "INSERT INTO `".DB_PREFIX."product_option_value` (`product_option_value_id`, `product_id`, `product_option_id`, `quantity`, `subtract`, `price`, `weight`, `prefix`, `sort_order`) VALUES ";

(add `weight`)

2/ Search for

$price = $option['price'];

add underneath:

$weight = $option['weight'];

3/ Search for

$optionPrice = isset($row[7]) ? $row[7] : "0";

add underneath:

$optionWeight = isset($row[8]) ? $row[8] : "0";

4/ Change the index numbers in the two lines following the above addition. This will make sense when you see it.

5/ Search for

$options[$i]['price'] = $optionPrice;

add underneath:

$options[$i]['weight'] = $optionWeight;

6/ Search for

$worksheet->setColumn($j,$j++,max(strlen('price'),10)+1,$priceFormat);

add underneath:

$worksheet->setColumn($j,$j++,max(strlen('weight'),10)+1,$priceFormat);

7/ Search for

$worksheet->writeString( $i, $j++, 'price', $boxFormat );

add underneath:

$worksheet->writeString( $i, $j++, 'weight', $boxFormat );

8/ Search for

$query .= " pov.price AS option_price, ";

add underneath:

$query .= " pov.weight AS option_weight, ";

9/ Search for

$worksheet->write( $i, $j++, $row['option_price'], $priceFormat );

add underneath:

$worksheet->write( $i, $j++, $row['option_weight'], $priceFormat );


Hope that helps someone in the future! I know it's all pretty obvious, but maybe it helps someone to confirm that it's possible, and if it's not working for them, just to check they added things in the right place.

Let me know if you have any questions. Can't promise to answer them but will do my best.

New member

Posts

Joined
Mon Oct 05, 2009 2:25 am

Post by vinylperfection » Sun Jan 09, 2011 7:35 pm

click export and the file saves, but all that it says is:

<br />
<b>Fatal error</b>: Call to undefined function iconv() in <b>/home/vinylper/public_html/cart/admin/pear/Spreadsheet/Excel/Writer/Worksheet.php</b> on line <b>1566</b><br />

New member

Posts

Joined
Mon Oct 04, 2010 11:55 pm

Post by JNeuhoff » Tue Jan 11, 2011 1:00 am

You haven't got the libiconv installed on your server. Kindly ask your webhost to do it for you.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by successsor » Sat Jan 22, 2011 8:00 pm

i install this function and it works great. But i figured out this error will be appear if i want upload xls more than 1mb.

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 35 bytes) in /home/worldofm/public_html/admin/model/tool/export.php on line 457

XLS below that 900kb, this problem not happen. Hope someone can answer this. Thanks.

Newbie

Posts

Joined
Sun Dec 19, 2010 11:27 pm

Post by successsor » Mon Jan 24, 2011 11:39 pm

no one know about this? maybe creator of this function limit the size of XLS to upload maybe?

Newbie

Posts

Joined
Sun Dec 19, 2010 11:27 pm
Who is online

Users browsing this forum: No registered users and 28 guests