Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

which array do OSC use for packing data before insert a new product


xvoyance

Recommended Posts

I am trying to track down how does OSC insert a new products in categories.php

It is confusing for me.

 

It seems sometimes use $sql_data_array sometimes use $pInfo?

 

It first initialize an (almost) empty record by

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

$insert_sql_data = array('products_date_added' => 'now()');

 

$sql_data_array = array_merge($sql_data_array, $insert_sql_data);

 

tep_db_perform(TABLE_PRODUCTS, $sql_data_array);

$products_id = tep_db_insert_id();

 

tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$products_id . "', '" . (int)$current_category_id . "')");

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

and then add other data later?

 

But there is also a $pInfo

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

$parameters = array('products_name' => '',

'products_description' => '',

'products_url' => '',

'products_id' => '',

'products_quantity' => '1',

'products_model' => '',

'products_type' => '',

'products_image' => '',

'products_larger_images' => array(),

'products_price' => '',

'products_weight' => '500',

'products_date_added' => '',

'products_last_modified' => '',

'products_date_available' => '',

'products_status' => '1',

'products_tax_class_id' => '',

'manufacturers_id' => '');

 

// begin Extra Product Fields

foreach ($xfields as $f) {

$parameters = array_merge($parameters, array($f => ''));

}

// end Extra Product Fields

 

$pInfo = new objectInfo($parameters);

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

which looks much like what is going to be inserted?

 

So, what are their relation?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...