Bulk edit price in Magento with SQL query

Select Prices

SELECT 
catalog_product_entity_decimal 
WHERE
catalog_product_entity_decimal.attribute_id=75  

Update Prices with Value

UPDATE 
catalog_product_entity_decimal 
SET catalog_product_entity_decimal.value = 35.9500
WHERE
catalog_product_entity_decimal.attribute_id=75  

(catalog_product_entity_decimal.attribute_id=75 = price)

Empty Value

UPDATE 
catalog_product_entity_decimal 
SET catalog_product_entity_decimal.value = NULL
WHERE
catalog_product_entity_decimal.value_id=120

Update Prices with %

UPDATE
catalog_product_entity_decimal
SET
catalog_product_entity_decimal.value = catalog_product_entity_decimal.value*1.19
WHERE
catalog_product_entity_decimal.attribute_id=75
OR
catalog_product_entity_decimal.attribute_id=76;

1.19 is 19% tax
Id=75 is the price
Id = 76 is the special price (see table eav_attribute table for codes)

Update Prices with Rounded Value

UPDATE
catalog_product_entity_decimal
SET
catalog_product_entity_decimal.value= ROUND(catalog_product_entity_decimal.value,0)
WHERE
catalog_product_entity_decimal.attribute_id=75
OR
catalog_product_entity_decimal.attribute_id=76;

Run this if you want all your prices to be also rounded e..g 25.00 instead of 25.01

Now Refresh Cache in Magento


Geplaatst

in

,

door

Tags:

Reacties

Geef een reactie

Het e-mailadres wordt niet gepubliceerd. Vereiste velden zijn gemarkeerd met *