Custom WooCommerce display product not working

  1. 3 months ago

    I am creating a custom WooCommerce display product page but after implementing all the steps going through the tutorial customize woocommerce product page , I have seen that the actual output is not according to this and it's giving an error. I am trying to figure out but still, the error isn't identified. It's a code for displaying WooCommerce category

    <?php
    if ( ! defined( 'ABSPATH' ) ) {
    exit;
    }
    global $product;
    ?>
    <div class="product_meta">
    <?php do_action( 'woocommerce_product_meta_start' ); ?>
    <?php if ( wc_product_sku_enabled() && ( $product->get_sku() || $product->is_type( 'variable' ) ) ) : ?>
    <span class="sku_wrapper"><?php esc_html_e( 'SKU:', 'woocommerce' ); ?> <span class="sku"><?php echo ( $sku = $product->get_sku() ) ? $sku : esc_html__( 'N/A', 'woocommerce' ); ?></span></span>
    <?php endif; ?>
    <?php echo wc_get_product_category_list( $product->get_id(), ', ', '<span class="posted_in">' . _n( 'Category:', 'Categories:', count( $product->get_category_ids() ), 'woocommerce' ) . ' ', '</span>' ); ?>
    <?php echo wc_get_product_tag_list( $product->get_id(), ', ', '<span class="tagged_as">' . _n( 'Tags:', count( $product->get_tag_ids() ), 'woocommerce' ) . ' ', '</span>' ); ?>
    <?php do_action( 'woocommerce_product_meta_end' ); ?>
    </div>

or Sign Up to reply!