Stock QT is shown in hover for Variable, but not Simple products
-
For simple products it just shows: ”in stock”
But for variable products it also shows how many stock there is ( which i also want for simple products, in stead of just ” in stock ” ) is this possible ?
Attachments:
You must be
logged in to view attached files.
Hello,
Please make sure you have inserted the stock qty into the single product. If you have, insert the site admin access into the Private content below the message area. We will take a closer look at the case.
Best Regards
Yes, stock is set for almost all items. except for DSC items
please check
Hello,
Could you kindly provide the product URL with the problem?
Best Regards
I will try to be more clear, check below link. All simple products,, stock QT is inserted, however it just shows IN STOCK , but not how many stock ( like in product page )
Inspide, at below link , it shows the stock QT, not ” in stock ”
https://cameragroothandel.nl/product-categorie/alarmsystemen/ajax/
( another weird thing is that you have to move your mouse over the hover, then the stock becomes available )
Thnks!
Hello,
Please add this code to functions.php of the child theme:
function woodmart_stock_status_after_title() {
if ( 'after_title' !== woodmart_get_opt( 'stock_status_position' ) ) {
return;
}
global $product;
$wrapper_class = 'stock';
$wrapper_class .= ' wd-style-default';
$stock_status = $product->get_stock_status();
if ( 'instock' === $stock_status ) {
if ( $product->get_stock_quantity() ) {
$stock_status_text = wc_format_stock_for_display( $product );
} else {
$stock_status_text = esc_html__( 'In stock', 'woodmart' );
}
$wrapper_class .= ' in-stock';
} elseif ( 'onbackorder' === $stock_status ) {
$wrapper_class .= ' available-on-backorder';
$stock_status_text = esc_html__( 'Available on backorder', 'woodmart' );
} else {
$wrapper_class .= ' out-of-stock';
$stock_status_text = esc_html__( 'Out of stock', 'woodmart' );
}
woodmart_enqueue_inline_style( 'woo-mod-stock-status' );
?>
<p class="wd-product-stock <?php echo esc_attr( $wrapper_class ); ?>">
<?php echo esc_html( $stock_status_text ); ?>
</p>
<?php
}
If you have any questions please feel free to contact us.
Best Regards
This topic can be closed as the answer fixed the issue !
If you have any questions please feel free to contact us.
Best Regards
The topic ‘Stock QT is shown in hover for Variable, but not Simple products’ is closed to new replies.