Complete the code to activate the WooCommerce plugin in WordPress.
<?php
function activate_woocommerce() {
activate_plugin('[1]');
}
?>The correct plugin path to activate WooCommerce is woocommerce/woocommerce.php.
Complete the code to add WooCommerce support to your WordPress theme.
<?php
function theme_setup() {
add_theme_support('[1]');
}
add_action('after_setup_theme', 'theme_setup');Adding woocommerce support enables WooCommerce features in your theme.
Fix the error in the code to enqueue WooCommerce styles properly.
<?php
function enqueue_woocommerce_styles() {
if (class_exists('[1]')) {
wp_enqueue_style('woocommerce-general');
}
}
add_action('wp_enqueue_scripts', 'enqueue_woocommerce_styles');The WooCommerce main class is WooCommerce with uppercase W and C.
Fill both blanks to create a shortcode that displays WooCommerce products.
<?php
function display_products_shortcode() {
return do_shortcode('[1]');
}
add_shortcode('[2]', 'display_products_shortcode');The shortcode [products limit="4" columns="2"] displays products, and the shortcode tag is 'show_products'.
Fill all three blanks to register a custom WooCommerce product tab.
<?php function add_custom_product_tab([1]) { [2]['custom_tab'] = array( 'title' => __('Custom Tab', 'text-domain'), 'priority' => 50, 'callback' => '[3]' ); return [1]; } add_filter('woocommerce_product_tabs', 'add_custom_product_tab');
The filter function receives $tabs array, modifies it, and returns it. The callback function name is custom_tab_content.