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?
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 FaridSite URL: hidden Theme version: IDstore WooCommerce version: 2.3.13
You need to create a variable product and attributes in WP Dashboard > Products > Attributes.
Please refer to Woocommerce documentation:
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,
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,
You must be logged in to reply to this topic.Log in/Sign up
One standard license is valid only for 1 project. Running multiple projects on a single license is a copyright violation.
The message was successfully sent
Your shopping cart is empty