This commit is contained in:
Almira Krdzic
2018-10-19 20:50:55 +02:00
parent 84f7974050
commit c3b665cd51

View File

@@ -178,21 +178,21 @@ class Wiaas_Shop {
private static function _maybe_create_shop($owner_id) {
$shop_name = 'wiaas_shop_' . $owner_id;
$attribute_id = wc_attribute_taxonomy_id_by_name($shop_name);
if ($attribute_id === 0) {
// create shop attribute
wc_create_attribute(array( 'slug' => $shop_name, 'name' => 'Shop' ));
$taxonomy_name = wc_attribute_taxonomy_name($shop_name);
// since attribute taxonomies are registered once on load
// we will register new attribute taxonomy here so default catalogue can be added
register_taxonomy($taxonomy_name, array('product'));
// add default catalogue option to shop
wp_insert_term( 'Default Catalogue', $taxonomy_name);
}
// $attribute_id = wc_attribute_taxonomy_id_by_name($shop_name);
//
// if ($attribute_id === 0) {
// // create shop attribute
// wc_create_attribute(array( 'slug' => $shop_name, 'name' => 'Shop' ));
//
// $taxonomy_name = wc_attribute_taxonomy_name($shop_name);
//
// // since attribute taxonomies are registered once on load
// // we will register new attribute taxonomy here so default catalogue can be added
// register_taxonomy($taxonomy_name, array('product'));
//
// // add default catalogue option to shop
// wp_insert_term( 'Default Catalogue', $taxonomy_name);
// }
}
/**