Home › Forums › Basel support forum › The SOLD OUT, SALE labels don't show
The SOLD OUT, SALE labels don't show
- This topic has 12 replies, 2 voices, and was last updated 8 years ago by Artem Temos.
-
AuthorPosts
-
January 7, 2017 at 12:25 pm #8594
coris8ParticipantHi,
I’v just installed your theme/child theme and have an issue with the SOLD OUT and SALE labels as they don’t show at all on my website…
Also you told about the possibility of having the label in rectangular form to fit the length of the translated texts. Would it be possible to prepare rectangular labels for me?
Many thanks in advanceJanuary 7, 2017 at 1:35 pm #8596
Artem TemosKeymasterHello,
Could you please provide us your admin access so we could check why labels are not shown firstly?
Regards
January 7, 2017 at 2:11 pm #8597
coris8ParticipantThank you in advance 🙂
January 7, 2017 at 2:23 pm #8600
Artem TemosKeymasterVery strange, but it is not visible only on the shop page. Could you please disable all additional plugins to check is it a plugin issue or not? We check with default theme and see that it is not Basel related problem.
Regards
January 7, 2017 at 2:41 pm #8602
coris8ParticipantHi,
Many thanks 🙂 the bug came from the plugin: WooCommerce Product Archive Customiser
I still don’t see the label on the product page though.. any idea?
ThanksJanuary 8, 2017 at 10:03 am #8607
Artem TemosKeymasterHello,
We just checked and see that Sale label is displayed on the product page. But “Sold out” is not viewed on single product page in WooCommerce by default.
Regards
January 8, 2017 at 2:09 pm #8619
coris8ParticipantHi,
Actually I would really need the label sold out to display on the product page too. Can you help me doing that?
Also the sold out text is now translated and I think a rectangular label would be a better option for me. Can you help?
thank you!January 8, 2017 at 3:18 pm #8628
Artem TemosKeymasterHi,
If you want to show this badge on the single product page you need to create a file in the child theme /basel-child/woocommerce/single-product/sale-flash.php and put this code inside
<?php if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } global $post, $product; ?> <?php if ( $product->is_on_sale() ) : ?> <?php echo apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . __( 'Sale!', 'woocommerce' ) . '</span>', $post, $product ); ?> <?php endif; ?> <?php if ( ! $product->is_in_stock() ) : ?> <?php echo apply_filters( 'basel_stock_flash', '<span class="out-of-stock-label">' . __( 'Sold out', 'basel' ) . '</span>', $post, $product ); ?> <?php endif; ?>
Regards
January 8, 2017 at 3:21 pm #8629
Artem TemosKeymasterHere is a CSS code to make them rectangular
.onsale, .out-of-stock-label { border-radius:0; width:auto; height: auto; line-height: 1; padding: 10px 10px; }
January 8, 2017 at 8:09 pm #8636
coris8ParticipantHi,
Thank you! the rectangular label looks great!
And thanks for the php code, we are a step closer 😉 but: the label appear on the left and not on the main picture as it should and as it does on sale items. Do you know how to fix it? I’d like to have the SOLD OUT label displaying like the SALE label on product page.
Thanks!Attachments:
You must be logged in to view attached files.January 8, 2017 at 9:57 pm #8639
Artem TemosKeymasterHello,
Great, try this CSS to make SOLD OUT label position to right
.product-images .out-of-stock-label { right:15px; left:auto; }
Regards
January 9, 2017 at 8:49 am #8648
coris8ParticipantWorks perfectly thanks!
January 9, 2017 at 11:05 am #8658
Artem TemosKeymasterYou are welcome!
-
AuthorPosts
Tagged: label sold out sale
The topic ‘The SOLD OUT, SALE labels don't show’ is closed to new replies.
- You must be logged in to create new topics. Login / Register