.addToCartText" data-wp-class--wc-block-slide-in="state.slideInAnimation" data-wp-class--wc-block-slide-out="state.slideOutAnimation" data-wp-on--animationend="actions.handleAnimationEnd" data-wp-watch="callbacks.startAnimation" data-wp-run="callbacks.syncTempQuantityOnLoad" '; $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', array_filter( array( 'wp-block-button wc-block-components-product-button', esc_attr( $classname . ' ' . $custom_width_classes . ' ' . $custom_align_classes ), ) ) ), ) ); $button_classes = isset( $args['class'] ) ? esc_attr( $args['class'] . ' wc-interactive' ) : 'wc-interactive'; if ( $is_descendant_of_add_to_cart_form ) { $button_classes .= ' single_add_to_cart_button'; $args['attributes']['value'] = $product->get_id(); } $html = strtr( '
<{html_element} class="{button_classes}" style="{button_styles}" {attributes} {button_directives} > {add_to_cart_text} {view_cart_html}
', array( '{wrapper_attributes}' => $wrapper_attributes, '{html_element}' => $html_element, '{button_classes}' => $button_classes, '{context_directives}' => $context_directives, '{button_styles}' => esc_attr( $styles_and_classes['styles'] ), '{attributes}' => isset( $args['attributes'] ) ? wc_implode_html_attributes( $args['attributes'] ) : '', '{add_to_cart_text}' => $is_ajax_button ? '' : $add_to_cart_text, '{div_directives}' => $is_ajax_button ? $div_directives : '', '{button_directives}' => $is_ajax_button ? $button_directives : $anchor_directive, '{span_button_directives}' => $is_ajax_button ? $span_button_directives : '', '{view_cart_html}' => $is_ajax_button && CartCheckoutUtils::has_cart_page() && ! $is_descendant_of_add_to_cart_form ? $this->get_view_cart_html() : '', ) ); if ( ! $is_descendant_of_add_to_cart_form ) { /** * Filters the add to cart button class. * * @since 8.7.0 * * @param string $class The class. */ $html = apply_filters( 'woocommerce_loop_add_to_cart_link', $html, $product, $args ); } $product = $previous_product; return $html; } /** * Get the number of items in the cart for a given product id. * * @param number $product_id The product id. * @return number The number of items in the cart. */ private function get_cart_item_quantities_by_product_id( $product_id ) { if ( ! isset( WC()->cart ) ) { return 0; } $cart = WC()->cart->get_cart_item_quantities(); return isset( $cart[ $product_id ] ) ? $cart[ $product_id ] : 0; } /** * Check if a product is purchasable. * * @param \WC_Product $product The product. * @return boolean The product is purchasable. */ private function is_product_purchasable( $product ) { if ( $product->is_type( ProductType::GROUPED ) ) { $grouped_product_ids = $product->get_children(); foreach ( $grouped_product_ids as $child ) { $child_product = wc_get_product( $child ); if ( ! $child_product instanceof \WC_Product ) { continue; } if ( $child_product->is_purchasable() && $child_product->is_in_stock() ) { return true; } } return false; } return $product->is_purchasable() && $product->is_in_stock(); } /** * Get the inTheCartText text for a given product. * * @param \WC_Product $product The product. * @return string The inTheCartText string. */ private function get_in_the_cart_text( $product ) { if ( $product->is_type( ProductType::GROUPED ) ) { return __( 'Added to cart', 'woocommerce' ); } return sprintf( /* translators: %s: product number. */ __( '%s in cart', 'woocommerce' ), '###' ); } /** * Get the view cart link html. * * @return string The view cart html. */ private function get_view_cart_html() { return sprintf( '', esc_url( wc_get_cart_url() ), esc_attr__( 'View cart', 'woocommerce' ), esc_html__( 'View cart', 'woocommerce' ) ); } }
Fatal error: Uncaught Error: Class "Automattic\WooCommerce\Blocks\BlockTypes\ProductButton" not found in /home/hypothek/public_html/erziehungslehre.de/wp-content/plugins/woocommerce/src/Blocks/BlockTypesController.php:117 Stack trace: #0 /home/hypothek/public_html/erziehungslehre.de/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\Blocks\BlockTypesController->register_blocks('') #1 /home/hypothek/public_html/erziehungslehre.de/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #2 /home/hypothek/public_html/erziehungslehre.de/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #3 /home/hypothek/public_html/erziehungslehre.de/wp-settings.php(727): do_action('init') #4 /home/hypothek/public_html/erziehungslehre.de/wp-config.php(94): require_once('/home/hypothek/...') #5 /home/hypothek/public_html/erziehungslehre.de/wp-load.php(50): require_once('/home/hypothek/...') #6 /home/hypothek/public_html/erziehungslehre.de/wp-blog-header.php(13): require_once('/home/hypothek/...') #7 /home/hypothek/public_html/erziehungslehre.de/index.php(17): require('/home/hypothek/...') #8 {main} thrown in /home/hypothek/public_html/erziehungslehre.de/wp-content/plugins/woocommerce/src/Blocks/BlockTypesController.php on line 117