Advertisement
Guest User

Untitled

a guest
May 4th, 2015
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. #select to view all products without weight in database:
  2. #TAKE CARE that weight attribute id is the right value
  3.  
  4. SELECT p.sku, w.value FROM catalog_product_entity as p
  5. LEFT JOIN catalog_product_entity_decimal as w ON (p.entity_id = w.entity_id AND w.attribute_id = 101)
  6. WHERE w.value IS NOT NULL;
  7.  
  8. #insert weight in catalog_product_entity_decimal for all products without value in that table:
  9. #TAKE CARE to use the right entity_ids (depending on magento version)
  10.  
  11. INSERT INTO catalog_product_entity_decimal (entity_type_id, attribute_id, store_id, entity_id, value)
  12. SELECT 10, 101, 0, p.entity_id, 1.000 FROM catalog_product_entity as p
  13. LEFT JOIN catalog_product_entity_decimal as w ON (p.entity_id = w.entity_id AND w.attribute_id = 101)
  14. WHERE w.value IS NULL;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement