Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Impossible to insert new product in caatalog


johanbo

Recommended Posts

First let me wish a very Happy New Year to all memebers of this forum!

 

Now I need help; I am blocked at the insert of new product in catalog.

 

I get following error message;

 

1264 - Out of range value adjusted for column 'manufacturers_id' at row 1

 

insert into products (products_quantity, products_model, products_price, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id, products_image, products_date_added) values ('1', 'str-9', '5.00', null, '100', '1', '1', '', '1-2_resize (3).jpg', now())

 

What's going on ? What's wrong? What shall I do to solve the problem?

 

I will be very very grateful for soonest possible help. Thanks in advance.

 

Johanbo

 

I come from the North of Sweden but live in France since lany years.

Link to comment
Share on other sites

Are you using the updated osCommerce 2.2 MS2 (available by following the "Latest News" link at the top of the forum homepage), or have you applied those updates to an existing MS2? The reason I ask is that the error you are getting is (I believe) a compatibility problem with MySQL 5 - which should clear by applying the update.

 

Vger

Link to comment
Share on other sites

Are you using the updated osCommerce 2.2 MS2 (available by following the "Latest News" link at the top of the forum homepage), or have you applied those updates to an existing MS2? The reason I ask is that the error you are getting is (I believe) a compatibility problem with MySQL 5 - which should clear by applying the update.

 

Vger

Link to comment
Share on other sites

Thanks for your answer.

 

The update of osCommerce is installed, but I have still the same problem. Same error message when I try to insert new product. I find this strange as the preview is OK.

 

What to do?

 

I am very grateful to you to find the solution.

 

Johanssonbo

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 year later...
Thanks for your answer.

 

The update of osCommerce is installed, but I have still the same problem. Same error message when I try to insert new product. I find this strange as the preview is OK.

 

What to do?

 

I am very grateful to you to find the solution.

 

Johanssonbo

 

OK... I've learned. The problem with this error and error 1264 - Out of range... is that those fields MUST have a number in them. So, here is some code that works. On a new product, it will set the defaults at '0' for the products quantity & products weight field. On an update, it will pull in the accurate information. I've also added *Required to those boxes so anyone who uses it knows they have to fill in the blank.

 

Here is the code.

 

 

Open admin/categories page.

 

Find:

$sort_order = tep_db_prepare_input($HTTP_POST_VARS['sort_order']);

 

Add after that:

if ($sort_order==''){$sort_order='0';}

 

Find:

<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_pull_down_menu('manufacturers_id', $manufacturers_array, $pInfo->manufacturers_id); ?></td>

 

Replace with:

 

<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_pull_down_menu('manufacturers_id', $manufacturers_array, $pInfo->manufacturers_id); ?> <font color="red">* Required</font></td>

 

Find:

<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_quantity', $pInfo->products_quantity); ?></td>

 

Replace with:

<td class="main">

<?php if ($pInfo->products_quantity==''){

echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_quantity', "0");

}else{

echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_quantity', $pInfo->products_quantity);

} ?>

<font color="red">* Required</font>

</td>

 

Find:

<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_weight', $pInfo->products_weight); ?></td>

Replace with:

<td class="main">

<?php if ($pInfo->products_weight==''){

echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_weight', "0");

}else{

echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_weight', $pInfo->products_weight);

} ?><font color="red"> * Required</font>

</td>

 

 

I hope this helps everyone out there that is looking for a remedy. Granted, it is not the best, but it works.

Good luck!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...