Prijzen in bulk aanpassen (Drupal Commerce): verschil tussen versies

Uit De Vliegende Brigade
Naar navigatie springen Naar zoeken springen
 
Regel 16: Regel 16:
 
Mbv. Commerce Feeds [https://drupalcommerce.org/discussions/2858/update-multiple-prices]
 
Mbv. Commerce Feeds [https://drupalcommerce.org/discussions/2858/update-multiple-prices]
  
== Database-niveau - Test ==
+
== Database-niveau ==
 +
 
 +
Kijk & huiver:
 +
 
 +
<pre>
 +
##########################################
 +
# 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";
 +
</pre>

Huidige versie van 8 jun 2018 om 14:02

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";