{"id":14090,"date":"2023-07-23T22:06:24","date_gmt":"2023-07-23T16:06:24","guid":{"rendered":"https:\/\/shra.ru\/?p=14090"},"modified":"2023-07-23T22:06:50","modified_gmt":"2023-07-23T16:06:50","slug":"poluchit-spisok-tipov-tovarov-v-drupal-commerce","status":"publish","type":"post","link":"https:\/\/shra.ru\/2023\/07\/poluchit-spisok-tipov-tovarov-v-drupal-commerce\/","title":{"rendered":"\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0442\u0438\u043f\u043e\u0432 \u0442\u043e\u0432\u0430\u0440\u043e\u0432 \u0432 Drupal Commerce"},"content":{"rendered":"\n
\u0412 \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u043b\u043e\u0433\u0438\u0438 Drupal, \u0442\u0438\u043f\u044b \u0442\u043e\u0432\u0430\u0440\u043e\u0432 \u044d\u0442\u043e — \u0431\u0430\u043d\u0434\u043b\u044b (bundle<\/em>) \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 commerce_product<\/em>.<\/p>\n\n\n\n\n\n\n\n \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0445 \u0441\u043f\u0438\u0441\u043e\u043a \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n\n\n\n \u041a\u0430\u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u0432 $product_types<\/em> \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u043c\u0430\u0441\u0441\u0438\u0432 \u0442\u0438\u043f\u043e\u0432 \u0442\u043e\u0432\u0430\u0440\u043e\u0432, \u0433\u0434\u0435 \u043a\u043b\u044e\u0447\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0435 \u0438\u043c\u044f, \u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c — \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u0430.<\/p>\n","protected":false},"excerpt":{"rendered":" \u0412 \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u043b\u043e\u0433\u0438\u0438 Drupal, \u0442\u0438\u043f\u044b \u0442\u043e\u0432\u0430\u0440\u043e\u0432 \u044d\u0442\u043e — \u0431\u0430\u043d\u0434\u043b\u044b (bundle) \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 commerce_product.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[135,163],"acf":[],"yoast_head":"\n$product_bundles = \\Drupal::service('entity_type.bundle.info')\n->getBundleInfo('commerce_product');\n\n$product_types = []; \nforeach ($product_bundles as $bundle_key => $bundle_data) {\n $product_types[$bundle_key] = $bundle_data['label'];\n}<\/code><\/pre>\n\n\n\n