Custom Datetime Column In The Products Table Gets Overwritten

Hi

I created a DATETIME column in the cscart_products table and a corresponding input form in update.tpl.
When I update the products, it works fine the first time. However, if I make a change in other inputs, such as the product name, the value in the DATETIME column I’ve created gets overwritten to 0.

A custom STRING field in the products table does not get overwritten, but only this DATETIME column.
Any idea why this is happening? Thank you in advance.


Below are the codes:

/backend/templates/products/update.tpl

{__("available_until")}:

/controllers/backend/products.php

in ($mode == ‘m_override’)

if (isset($product_data['avail_until'])) {
                $product_data['avail_until'] = $product_data['avail_until'];
            }

under

if (isset($product_data['avail_since'])) {
                $product_data['avail_since'] = fn_parse_date($product_data['avail_since']);
            }

in($mode == ‘m_update’)

'avail_until' => 'products_data',

under

'avail_since' => 'products_data',
 

and


elseif ($field == 'avail_until') {
$desc = 'available_until';
}

under

elseif ($field == 'avail_since') {
            $desc = 'available_since';
        }


What is the type of column in the database?

What is the type of column in the database?

The type of column is DATETIME.

fn_update_product does the fn_parse_date for avail_since in most cases, not sure why its done in m_override at all. You probably need to use the hook update_product_pre to do the same for avail_until. Without that I think only multiple override would work properly for the new field.