, $this->createPurchasedTemplateBody('woocommerce:order:products') ); }, AutomationTemplate::TYPE_DEFAULT ); } private function createPurchasedProductWithTagTemplate(): AutomationTemplate { return new AutomationTemplate( 'purchased-product-with-tag', AutomationTemplate::CATEGORY_WOOCOMMERCE, __('Purchased a product with a tag', 'mailpoet-premium'), __( 'Share care instructions or simply thank the customer for making an order.', 'mailpoet-premium' ), function (): Automation { return $this->builder->createFromSequence( __('Purchased a product with a tag', 'mailpoet-premium'), $this->createPurchasedTemplateBody('woocommerce:order:tags') ); }, AutomationTemplate::TYPE_DEFAULT ); } private function createPurchasedInCategoryTemplate(): AutomationTemplate { return new AutomationTemplate( 'purchased-in-category', AutomationTemplate::CATEGORY_WOOCOMMERCE, __('Purchased in a category', 'mailpoet-premium'), __( 'Share care instructions or simply thank the customer for making an order.', 'mailpoet-premium' ), function (): Automation { return $this->builder->createFromSequence( __('Purchased in a category', 'mailpoet-premium'), $this->createPurchasedTemplateBody('woocommerce:order:categories') ); }, AutomationTemplate::TYPE_DEFAULT ); } private function createPurchasedTemplateBody(string $filterField) { return [ [ 'key' => 'woocommerce:order-status-changed', 'args' => [ 'from' => 'any', 'to' => 'wc-completed', ], 'filters' => [ 'operator' => 'and', 'groups' => [ [ 'operator' => 'and', 'filters' => [ ['field' => $filterField, 'condition' => 'matches-any-of', 'value' => null], ], ], ], ], ], [ 'key' => 'mailpoet:send-email', 'args' => [ 'name' => __('Important information about your order', 'mailpoet-premium'), 'subject' => __('Important information about your order', 'mailpoet-premium'), ], ], ]; } }
Fatal error: Uncaught Error: Class "Automattic\WooCommerce\Blocks\BlockTypes\ProductTag" not found in /htdocs/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/BlockTypesController.php:65 Stack trace: #0 /htdocs/wp-includes/class-wp-hook.php(310): Automattic\WooCommerce\Blocks\BlockTypesController->register_blocks('') #1 /htdocs/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters(NULL, Array) #2 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #3 /htdocs/wp-settings.php(632): do_action('init') #4 /htdocs/wp-config.php(96): require_once('/htdocs/wp-sett...') #5 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #6 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #7 /htdocs/index.php(17): require('/htdocs/wp-blog...') #8 {main} thrown in /htdocs/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/BlockTypesController.php on line 65