Prijzen in bulk aanpassen (Drupal Commerce)

Uit De Vliegende Brigade
Naar navigatie springen Naar zoeken springen
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Inventaris

Op database-niveau

Waarschijnlijk moet je dan twee tabellen aanpassen + join om de juiste artikelen te identificeren:

  • field_data_commerce_price
  • field_revision_commerce_price

VBO

Mbv. VBO - Gedoe + per pagina moet je akkoord geven [1]

Commerce Feeds

Mbv. Commerce Feeds [2]

Database-niveau

Kijk & huiver:

##########################################
# Update field
##########################################

# Test
###############
#
# select
# 
#     field_data_commerce_price.commerce_price_amount,
#     commerce_product.product_id, 
#     commerce_product.revision_id, 
#     commerce_product.sku, 
#     commerce_product.title
#     
# from field_data_commerce_price
# join commerce_product on field_data_commerce_price.entity_id = commerce_product.product_id
# 
# where type like "product";

# Update
#########
#
update field_data_commerce_price
join commerce_product on field_data_commerce_price.entity_id = commerce_product.product_id

set field_data_commerce_price.commerce_price_amount = 1.1* field_data_commerce_price.commerce_price_amount
	
where type like "product";

##########################################
# Update revision
##########################################

# Test
##############
#
# select
# 
#     field_revision_commerce_price.commerce_price_amount,
#     commerce_product.product_id, 
#     commerce_product.revision_id, 
#     commerce_product.sku, 
#     commerce_product.title
#     
# from field_revision_commerce_price
# join commerce_product on field_revision_commerce_price.entity_id = commerce_product.product_id
# 
# where type like "product";

# Update
########
#
update field_revision_commerce_price
join commerce_product on field_revision_commerce_price.entity_id = commerce_product.product_id

set field_revision_commerce_price.commerce_price_amount = 1.1* field_revision_commerce_price.commerce_price_amount
	
where type like "product";