Jump to content

(solved)Product must be in the default category


Recommended Posts

Hi all!

I just tried to duplicate a product for moving to another category and noticed that I cant do that anymore nor have one product in two categories. Error message: Product must be in the default category

Dont know if it is related to my update to latest version of PS - which btw worked like a charm:)

Anyone else than me?

Cheers// Stefan

Link to comment
Share on other sites

No, this is a bug fix in PrestaShop v1.3.2. In PrestaShop v1.3.1 and earlier, it was possible for the default category to be a category that the product wasn't actually in. In PrestaShop v1.3.2, the default category must be a category the product is in, otherwise you will get an error message.

Link to comment
Share on other sites

  • 7 months later...
  • 4 months later...

Here is an solution:

check your admin folder / tabs and AdminProducts.php file. Open it and find this code:

 

if (!is_array(Tools::getValue('categoryBox')) OR !in_array(Tools::getValue('id_category_default'), Tools::getValue('categoryBox')))

$this->_errors[] = $this->l('product must be in the default category');

 

 

Just delete it...

And its working yet...

 

If you dont wanna see this message:

Consider changing the default category

 

only find this part of code:

<script type="text/javascript">

$(document).ready(function() {

$(\'div#categoryList input.categoryBox\').click(function (){

if ($(this).is(\':not(:checked)\') && $(\'div#categoryList input.id_category_default\').val() == $(this).val())

alert(\''.utf8_encode(html_entity_decode($this->l('Consider changing the default category.'))).'\');

});

});

</script>

 

 

and just delete it.

 

And thats all..

Link to comment
Share on other sites

  • 3 years later...
  • 4 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...