Home Forums WoodMart support forum Stock QT is shown in hover for Variable, but not Simple products

Stock QT is shown in hover for Variable, but not Simple products

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #467310

    c-tin.nl
    Participant

    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.
    #467483

    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

    #467497

    c-tin.nl
    Participant

    Yes, stock is set for almost all items. except for DSC items
    please check

    #467508

    Hello,

    Could you kindly provide the product URL with the problem?

    Best Regards

    #467511

    c-tin.nl
    Participant

    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!

    #467689

    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

    #472069

    c-tin.nl
    Participant

    This topic can be closed as the answer fixed the issue !

    #472285

    If you have any questions please feel free to contact us.

    Best Regards

Viewing 8 posts - 1 through 8 (of 8 total)

The topic ‘Stock QT is shown in hover for Variable, but not Simple products’ is closed to new replies.