SKU not displayed on variable product page

This topic has 10 replies, 5 voices, and was last updated 8 years, 11 months ago ago by Eva Kemp

  • Avatar: devodrome
    devodrome
    Participant
    March 19, 2015 at 09:14

    Hello,

    I create a variable product having no SKU associated to the “generic” product, since all the SKUs will come with the product variations (different SKU for each variation).

    Entering on the product page, the SKU label is missing (no matter what attributes are selected).

    However, on the standard WooCommerce plug-in (no custom theme), on the variable product page it displays “SKU: N/A”, and the SKU is changed according to the selected attributes.

    Based on our findings, the problems is in the file wp-content/themes/idstore/woocommerce/single-product/price.php (lines 26-28):

    
            <?php if ( $product->is_type( array( 'simple', 'variable' ) ) && $product->get_sku() ) : ?>
                    <span class="product-code"><?php _e('SKU:', ETHEME_DOMAIN); ?> <span class="sku"><?php echo $product->get_sku(); ?></span></span>
            <?php endif; ?>
    

    In the original price.php file from WooCommerce plug-in (wp-content/plugins/woocommerce/templates/single-product/meta.php, line 24-28) the working code is:

    
            <?php if ( wc_product_sku_enabled() && ( $product->get_sku() || $product->is_type( 'variable' ) ) ) : ?>
    
                    <span class="sku_wrapper"><?php _e( 'SKU:', 'woocommerce' ); ?> <span class="sku" itemprop="sku"><?php echo ( $sku = $product->get_sku() ) ? $sku : __( 'N/A', 'woocommerce' ); ?></span>.</span>
    
            <?php endif; ?>
    

    So, in order to fix this issue we modified the price.php file from your theme as following:

    
           <?php if ( wc_product_sku_enabled() && ( $product->get_sku() || $product->is_type( 'variable' ) ) ) : ?>
            <span class="product-code"><?php _e('SKU:', ETHEME_DOMAIN); ?> <span class="sku"><?php echo ( $sku = $product->get_sku() ) ? $sku : _e( 'N/A', ETHEME_DOMAIN ); ?></span></span>
           <?php endif; ?>
    

    Could you check the above patch with your developers?

    Thanks,
    Victor

    9 Answers
    Avatar: Eva
    Eva Kemp
    Support staff
    March 19, 2015 at 19:00

    Hello,

    Thank you for providing us with information.
    We’ll forward it to our developers.

    Regards,
    Eva Kemp.

    Avatar: FaridJa
    FaridJa
    Participant
    July 20, 2015 at 21:24

    Hi guys,

    I would like to add attributes like Color label or size label below quantity dropdown. Your demo version provides that. How to do that. If I add a single product, I can add content of attributes but not a dropdown menu. How to fix that?

    Thanks for reply.

    Best Farid

    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    July 21, 2015 at 07:25

    Hello @FaridJa,

    You need to create a variable product and attributes in WP Dashboard > Products > Attributes.
    Please refer to Woocommerce documentation:
    http://docs.woothemes.com/document/variable-product/
    https://www.youtube.com/watch?v=aen8ieJuB88

    Best regards,
    Jack Richardson.

    Avatar: FaridJa
    FaridJa
    Participant
    November 29, 2015 at 13:34

    Hello,

    sry, I don´t find a way to start a new topic.
    Just a simple question: How can I figure out, how to define/ remove products from sale category?

    Because the products shown in the link below, are no sale products.(no sale offer defined)

    Thanks for reply,

    King regards,
    Farid

    Please, contact administrator
    for this information.
    Avatar: Robert Hall
    Robert Hall
    Support staff
    November 30, 2015 at 18:33

    Hello,

    You can select or unselect products to show in category list in Dashboard->Products->Product Categories. See screenshot: http://prntscr.com/98r90l

    Regards,
    Robert Hall.

    Avatar: FaridJa
    FaridJa
    Participant
    November 30, 2015 at 19:47

    Hello,

    I thought that too, but it is not selected.
    There is no sale category existing. It´s created with [etheme_sale] in order to output sale items.

    How to select products with that?

    regards,
    Farid

    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    November 30, 2015 at 20:53

    Hello @FaridJa,

    You need set sale price in product editor.
    Please try it.

    Best regards,
    Jack Richardson.

    Avatar: FaridJa
    FaridJa
    Participant
    December 2, 2015 at 18:41

    Hello Jack Richardson,

    I know that. The wired thing is, I didn´t set any sale product. Nevertheless I have some producta on sale category. and I cannot figure out why in order to deselect them.

    Thanks for replay,

    regards, Farid

    Avatar: Eva
    Eva Kemp
    Support staff
    December 8, 2015 at 09:19

    Hello,

    We’re sorry for a long delay.
    The issue with sale shortcode has been fixed.
    Now it’s working correctly and to show sale products you need add sale price.

    Regards,
    Eva Kemp.

  • Viewing 10 results - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.Log in/Sign up

8theme customization service
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.