Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Defaulted Fields


Recommended Posts

I'm trying to get the Date Available (date_avail) and Date Added (date_added) fields to keep the data in the existing table. When I add a product I set the date added and date available in the EP upload file and then upload the file to my catalog. Then when I upload updates to the catalog, the original date added and date available are over-written with the current date. I want EP to ignore the current date and use the dates already in the catalog and only use the current date when I'm adding a new item or when the catalog item doesn't have a date in the date added or date available fields.

 

I've added...

$default_these[] = 'v_date_avail';
$default_these[] = 'v_date_added';

to the Defaulted items code...

// these are the fields that will be defaulted to the current values in 
// the database if they are not found in the incoming file
$default_these = array();
foreach ($languages as $key => $lang){
 $default_these[] = 'v_products_name_' . $lang['id'];
 $default_these[] = 'v_products_description_' . $lang['id'];
 $default_these[] = 'v_products_url_' . $lang['id'];
 if (EP_HTC_SUPPORT == true) {
$default_these[] = 'v_products_head_title_tag_' . $lang['id'];
$default_these[] = 'v_products_head_desc_tag_' . $lang['id'];
$default_these[] = 'v_products_head_keywords_tag_' . $lang['id'];
 }
}
$default_these[] = 'v_products_image';
if (EP_MORE_PICS_6_SUPPORT == true) { 
 $default_these[] = 'v_products_subimage1';
 $default_these[] = 'v_products_subimage2';
 $default_these[] = 'v_products_subimage3';
 $default_these[] = 'v_products_subimage4';
 $default_these[] = 'v_products_subimage5';
 $default_these[] = 'v_products_subimage6';
}
if (EP_UNKNOWN_ADD_IMAGES_SUPPORT == true) { 
 $default_these[] = 'v_products_mimage';
 $default_these[] = 'v_products_bimage';
 $default_these[] = 'v_products_subimage1';
 $default_these[] = 'v_products_bsubimage1';
 $default_these[] = 'v_products_subimage2';
 $default_these[] = 'v_products_bsubimage2';
 $default_these[] = 'v_products_subimage3';
 $default_these[] = 'v_products_bsubimage3';
}
$default_these[] = 'v_categories_id';
$default_these[] = 'v_products_price';
$default_these[] = 'v_products_quantity';
$default_these[] = 'v_products_weight';
$default_these[] = 'v_status_current';
$default_these[] = 'v_date_avail';
$default_these[] = 'v_date_added';
$default_these[] = 'v_tax_class_title';
$default_these[] = 'v_manufacturers_name';
$default_these[] = 'v_manufacturers_id';

// Additional fields
$default_these[] = 'v_products_price_list';
$default_these[] = 'v_vendors_product_price';
$default_these[] = 'v_vendors_id';
$default_these[] = 'v_vendors_prod_comments';
$default_these[] = 'v_vendors_prod_id';
$default_these[] = 'v_products_ship_price';
$default_these[] = 'v_products_discount1';
$default_these[] = 'v_products_discount2';
$default_these[] = 'v_products_discount3';
$default_these[] = 'v_products_discount1_qty';
$default_these[] = 'v_products_discount2_qty';
$default_these[] = 'v_products_discount3_qty';
$default_these[] = 'v_products_discount_percentage';
// End Added fields

 

But this doesn't seem to work. What else do I need to do to get the date_added and date_avail to keep the original values?

 

Thanks,

Rick Knight

Link to comment
Share on other sites

"if they are not found in the incoming file" is the key bit in the snippet above

 

Have you tried dropping those 2 columns?

 

Or you could remove the fields from the update statement.

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

"if they are not found in the incoming file" is the key bit in the snippet above

 

Have you tried dropping those 2 columns?

 

Or you could remove the fields from the update statement.

 

Other fields in the "defaulted fields" list seem to work a little differently. If, for example, I leave the status or quantity fields empty in the incoming file the data that is already in the catalog database will be left untouched. If I leave the date added and date available fields empty in the incoming file, the date added and date available fields are updated with the current date for date available and the date the incoming file was saved for the date added field.

 

I can't delete the date columns or modify the update statement because sometimes the incoming file has both new items and existing items that are being updated.

 

So, is there a way to get the date fields to behave like the other defaulted fields?

 

Thanks again,

Rick Knight

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...