Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Importing Product Data For Custom Column Rate Topic   - - - - -

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 12052 posts

Posted 28 January 2021 - 02:24 AM #1

I have some data that I am importing/exporting via CSV.
I have the following scheme in products.post.php
 

$schema['export_fields'][__("ez_wo_adjustments")] = array(
  'db_field'=>'ez_wo_adjustments',
  'process_put' => array ('ez_wo_exim_import_adjustments', '#key', '#row', '#new'),
  'process_get' => array('ez_wo_exim_export_adjustments', '#this'),
  'return_result' => true
);

The ez_wo_exim_import_adjsutments() takes string data, parses it and then returns a serialized array that I expect to be stored in the ez_wo_adjustments field in the products table.
However, it is storing the string value from the import file.

I've verified that fn_import() is correctly seeing the data in this statement (I.e. $result has the proper value)

 $import_data[$k][$lang][$group['return_field']] = $result;

I'm kind of stumped on why it's not storing the serialized array().

Anyone with a clue?


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 21883 posts

Posted 28 January 2021 - 05:24 AM #2

Try to use convert_put instead of process_put


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 12052 posts

Posted 28 January 2021 - 05:44 PM #3

That did it.  Sure wish this stuff was documented somewhere.

So what does 'process_put' do with the return result?  Is it only looking for true/false to indicate an error or not?  Again, be nice if the developer documentation addressed this.

 

Thanks for the quick response.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 21883 posts

Posted 29 January 2021 - 04:30 AM #4

So what does 'process_put' do with the return result?  Is it only looking for true/false to indicate an error or not?  Again, be nice if the developer documentation addressed this.

 

Frankly speaking, I do not remember. But agree, documentation is poor for this


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)