cancel
Showing results for 
Search instead for 
Did you mean: 

Product in Websites database

SOLVED
   Did you know you can see the translated content as per your choice?

Translation is in progress. Please check again after few minutes.

Product in Websites database

How to change the status of Product in Websites from the database instead of magento's admin panel? I use magento 2.2.5 community edition.

 

Thank you in advance

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Product in Websites database

Nope, I think (without testing) that it is located inside catalog_product_website and then assign website_id to product_id

View solution in original post

5 REPLIES 5

Re: Product in Websites database

Hello @socratis_kontopoulos

 

Please follow below steps:

 

# First find the ID of the product status attribute in the EAV table:
SELECT * FROM eav_attribute where entity_type_id = 4 AND attribute_code = 'status'

# Then use that status attribute ID ($id) while querying the product entity table:
UPDATE catalog_product_entity_int SET value = 2 WHERE attribute_id = $id
  • 1 - enabled
  • 2 - disabled

Please reindex and cache flush after these changes.

Manish Mittal
https://www.manishmittal.com/

Re: Product in Websites database

Nope, I think (without testing) that it is located inside catalog_product_website and then assign website_id to product_id

Re: Product in Websites database

Hello @socratis_kontopoulos

 

Can update product status based on website as:

 

UPDATE catalog_product_entity_int cpei, catalog_product_entity cpe
SET value = '2'
WHERE cpe.entity_id = cpei.entity_id
AND attribute_id = "80"
AND cpei.store_id = "store_id"
Manish Mittal
https://www.manishmittal.com/

Re: Product in Websites database

Thank you for instance answer

Re: Product in Websites database

Hello!

I want to find a link between catalog_product_entity_int and catalog_product_entity 

I have a product which I have the sku and entity_id that are in catalog_product_entity but I can not refer to it catalog_product_entity_int 

I have used this way but It does not work 

select * from catalog_product_entity_int where attribute_id='80' and value_id='xyz';

 I have used instead of value_id also value and entity_id ; where xyz in entity_id in catalog_product_entity but there is no link between them

Anyone has an idea; thanks in advance