• Resolved fouadabuhattab

    (@fouadabuhattab)


    Hello everyone,
    I have a problem with woocommerce specifically with the variable products specifically with the price of the product when I manage the stock for each variation I add the quantity for each one without activating the check in the inventory tab, the problem occurs when these variations soldout and the stock quantity for each variation become Zero, the product price disappeared from the product page and just shows out of stock without the price, these caused a schema error with google and Rankmath plugin when setup the woo-commerce product schema, the product must be in the product page and source code.

    Can I display the price at all times for in-stock and out-of-stock variable products?
    This link has images to explain the problem

    https://drive.google.com/drive/folders/1qabJz1cwJOt8QyarLyyw8s8GIR68tF_5?usp=sharing

    I think you need to work on this point and add improvements to solve this issue and prevent the price hiding from products

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 16 total)
  • Hi @fouadabuhattab

    Thanks for reaching out!

    I understand that the price of out-of-stock products on your site is not displaying on the products page.

    I replicated this on my test site using the product Sweatshirt – V wherein I managed the stock at variation level. This variation is the only out-of-stock.

    Image Link: https://snipboard.io/3DhXWv.jpg

    On the Products page, I can see the price of the product even though this is out-of-stock:

    Image Link: https://snipboard.io/QbEMPy.jpg

    This kind of problem is usually caused by a conflict with your theme or with another plugin present on your site. Can you please try to perform a full conflict test and see if that works?

    https://woocommerce.com/document/how-to-test-for-conflicts/

    If this was caused by a third-party plugin present on your site, it would be best to reach out to the developers for further assistance here.

    Thread Starter fouadabuhattab

    (@fouadabuhattab)

    Thanks for your response,

    After rechecking my website, I think the cause of the problem is enabling Hide out-of-stock items from the catalog from the settings in the inventory tab, when I disabled it the price displayed on the product page.

    https://drive.google.com/drive/folders/1qabJz1cwJOt8QyarLyyw8s8GIR68tF_5?usp=sharing

    Can you check that on your test site?

    Hi @fouadabuhattab

    I’m glad you were able to find the culprit of this issue.

    Checking my settings, the Hide out of stock items from the catalog is disabled on my site.

    Image Link: https://snipboard.io/LD34nT.jpg

    Thread Starter fouadabuhattab

    (@fouadabuhattab)

    Thanks for your efforts, enable this option causes the problem, Now I hide the out-of-stock product from the shop page, categories pages, and related products using a PHP code, in the same time these products are accessible from search engines and search forms in my website, But exit add to cart button in the out of stock product pages is not good,
    For that, I think you need to recheck the whole process when enabling Hide out-of-stock items from the catalog to be more suitable for stores.

    Saif

    (@babylon1999)

    Hello @fouadabuhattab,

    Glad to hear you’ve found a code snippet to help you with this.

    WooCommerce is continuously updating and adding new features. You can contribute to these features by submitting a request on GitHub.

    Requests are viewed in chronological order, severity and other criteria so it might take some time till the team gets to your request.

    I will go ahead and mark this as solved. If you have a few minutes, we’d love it if you could leave us a review: https://www.ads-software.com/support/plugin/woocommerce/reviews/

    Cheers!

    Thread Starter fouadabuhattab

    (@fouadabuhattab)

    Hi, The isuue of the disappearance of the price of some of variable products when they are out of stock still exting in my website, when i editing any products the price exist in the all variation in the woocommerce tab but to appear this price in the front end i need to enter the price and update the product, Until now i updates all plugins, themes and woocommerce templates in my theme in the production site.

    Also Creating a staging site, deactivated all plugins and current theme then activated the default wordpress theme 2023 and woocommerce plugin only to confirm if there is any conflict with any plugin or theme but the isuue still existing I’m ready to send the support report from my live and staging site, all of the following images in the link from my staging site for the issue explanation and system status in production and staging websites

    Drive Link to images and system status for staging and production websites

    Saif

    (@babylon1999)

    Hello @fouadabuhattab,

    If I understand you correctly, the price is not rendering for out-of-stock variable products.

    This is normal behaviour as you have the following option enabled. in WooCommerce > Settings > Product > Inventory.


    Link to image.

    To fix this, just disable it and the price should start rendering again.

    Hope this helps!

    Thread Starter fouadabuhattab

    (@fouadabuhattab)

    Hello, I disabled this option in my staging website with the default WordPress Theme, But the problem in rendering the price for out-of-stock variable products still exists in the website.

    how we can solve these problem without causing any issues?

    Hi,

    Now I hide the out-of-stock product from the shop page, categories pages, and related products using a PHP code

    Can you provide the code snippet that the site is using for this part? That way we can take a look better, thanks.

    Thread Starter fouadabuhattab

    (@fouadabuhattab)

    Hi, I’m using this code snippet to hide out of stock products

    
    /*
      Hide out of Stock Products in WooCommerce 
    */
    
    add_filter( 'pre_option_woocommerce_hide_out_of_stock_items', 'misha_hide_out_of_stock' );
    
    function misha_hide_out_of_stock( $option ) {
    
    	if( is_admin() ) { // do nothing in WordPress admin
    		return $option;
    	}
    	
    	$option = 'yes';
    	return $option;
    }
    

    Hi,

    I was checking on my site as well, and even that both product variations are out of stock, the prices are visible.

    My setting on WooCommerce > products > inventory > Out of stock visibility Hide out of stock items from the catalog is disabled, I am replicating the same settings on my site, and the price for variable products is visible.

    Can you please clear the site cache? And go to WooCommerce > status > tools, and clear the transients?

    Does that make a difference?

    Thread Starter fouadabuhattab

    (@fouadabuhattab)

    Hi, I cleared WooCommerce transients and Expired transients but that’ does not show any effects on my products page or in the front end for each product

    Hello,

    I cleared WooCommerce transients and Expired transients but that’ does not show any effects

    I’m sorry to hear that.

    May I ask, can you navigate under WooCommerce > System Status > Logs? (if there are errors visible, let us know). That will help to get a better idea of what is happening.

    Thread Starter fouadabuhattab

    (@fouadabuhattab)

    this is the system log

    2022-11-28T14:17:28+00:00 CRITICAL Uncaught TypeError: Return value of Tamara\Wp\Plugin\Dependencies\Tamara\Response\Order\GetOrderByReferenceIdResponse::getOrderId() must be of the type string, null returned in /home/smartbody/public_html/wp-content/plugins/tamara-checkout/src/Dependencies/Tamara/Response/Order/GetOrderByReferenceIdResponse.php:148 Stack trace: #0 /home/smartbody/public_html/wp-content/plugins/tamara-checkout/src/Services/WCTamaraGateway.php(2541): Tamara\Wp\Plugin\Dependencies\Tamara\Response\Order\GetOrderByReferenceIdResponse->getOrderId() #1 /home/smartbody/public_html/wp-content/plugins/tamara-checkout/src/Services/WCTamaraGateway.php(1392): Tamara\Wp\Plugin\Services\WCTamaraGateway->getTamaraOrderId(20210) #2 /home/smartbody/public_html/wp-includes/class-wp-hook.php(308): Tamara\Wp\Plugin\Services\WCTamaraGateway->tamaraCancelOrder(20210, ‘pending’, ‘cancelled’, Object(Automattic\WooCommerce\Admin\Overrides\Order)) #3 /home/smartbody/public_html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array) #4 ?? /home/smartbody/public_html/wp-content/plugins/tamara-checkout/src/Dependencies/Tamara/Response/Order/GetOrderByReferenceIdResponse.php ?? ????? 148

    Thread Starter fouadabuhattab

    (@fouadabuhattab)

    I summited a bug in GitHub about error #36097, the bug was confirmed now I waiting for determines its priority.

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Why the product price not displayed in the product page when it is out of stock’ is closed to new replies.