Add unit tests for backend and refactor few things on frontend

This commit is contained in:
Almira Krdzic
2018-08-14 00:44:51 +02:00
parent 47bc6bdab1
commit bb3fecd811
14 changed files with 1221 additions and 5541 deletions

View File

@@ -84,7 +84,26 @@ function wiaas_db_update_setup_customer_capabilities() {
$customer_role->add_cap('read_private_shop_orders');
$customer_role->add_cap('read_shop_order');
}
function wiaas_db_update_add_customer_read_permission() {
$role = get_role( 'customer' );
$role->add_cap( 'read_private_products' );
}
function wiaas_db_update_enable_orders_access_management() {
$post_types_option = Groups_Options::get_option( Groups_Post_Access::POST_TYPES, array() );
$post_types_option['shop_order'] = array(
'add_meta_box' => true
);
Groups_Options::update_option(Groups_Post_Access::POST_TYPES, $post_types_option);
}
function wiaas_db_update_enable_order_numbers() {
update_option('wcj_order_numbers_enabled', 'yes');
update_option('wcj_order_number_sequential_enabled', 'no');
update_option('wcj_order_number_counter', '0');
update_option('wcj_order_number_counter_reset_enabled', 'no');
update_option('wcj_order_number_prefix', '1000000');
}