WooCommerce Code Reference

Migration
in package

Takes care of the migrations.

Tags
since
2.5.0

Table of Contents

$db_upgrades  : array<string|int, mixed>
DB updates and callbacks that need to be run per version.
run_migrations()  : mixed
Runs all the necessary migrations.
wc_blocks_update_1030_blockified_product_grid_block()  : mixed
Set a flag to indicate if the blockified Product Grid Block should be rendered by default.
wc_blocks_update_1120_rename_cart_template()  : mixed
Rename `cart` template to `page-cart`.
wc_blocks_update_1120_rename_checkout_template()  : mixed
Rename `checkout` template to `page-checkout`.

Properties

$db_upgrades

DB updates and callbacks that need to be run per version.

private array<string|int, mixed> $db_upgrades = array('10.3.0' => array('wc_blocks_update_1030_blockified_product_grid_block'), '11.2.0' => array('wc_blocks_update_1120_rename_checkout_template', 'wc_blocks_update_1120_rename_cart_template'))

Please note that these functions are invoked when WooCommerce Blocks is updated from a previous version, but NOT when WooCommerce Blocks is newly installed.

Methods

run_migrations()

Runs all the necessary migrations.

public run_migrations() : mixed
Return values
mixed

wc_blocks_update_1030_blockified_product_grid_block()

Set a flag to indicate if the blockified Product Grid Block should be rendered by default.

public static wc_blocks_update_1030_blockified_product_grid_block() : mixed
Return values
mixed

wc_blocks_update_1120_rename_cart_template()

Rename `cart` template to `page-cart`.

public static wc_blocks_update_1120_rename_cart_template() : mixed
Return values
mixed

wc_blocks_update_1120_rename_checkout_template()

Rename `checkout` template to `page-checkout`.

public static wc_blocks_update_1120_rename_checkout_template() : mixed
Return values
mixed