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