Home Forums WoodMart support forum Changing price to "Out of stock"

Changing price to "Out of stock"

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #203331

    hariskay
    Participant

    Hello, how can I change the price to say “out of stock” (in same color and style as regular price) once all variations are out of stock. Also want to remove the out of stock label. Your support is appreciated.

    #203358

    Hello,

    Your purpose is not clear enough. Please provide the screen and URL where you want to change the color and where you want to remove it.

    Best Regards

    #203360

    hariskay
    Participant

    Hello, thank you for your response.

    Current functionality: When a product stock reaches zero, a label of “out of stock” appears on product.

    Desired functionality: When a product stock reaches zero, the label does not appear but instead product price is replaced by “Out of stock” text.

    The reason I am requesting this is because our product prices fluctuate a lot.

    Attachments:
    You must be logged in to view attached files.
    #203409

    Hello,

    Such functinality cannot be solved by custom CSS, unfortunately. Such modification requires complicated Woocommerce code customization which is not covered by our support. You will have to find a developer who would do it for you.

    Best Regards

    #203420

    hariskay
    Participant

    Whoever hired you as support needs to reconsider their decision, I found the solution on another forum which I did not even pay for:

    <?php
    /**
    * Single Product Price, including microdata for SEO
    *
    * @author WooThemes
    * @package WooCommerce/Templates
    * @version 1.6.4
    */

    if ( ! defined( ‘ABSPATH’ ) ) exit; // Exit if accessed directly

    global $post, $product;
    ?>
    <div itemprop=”offers” itemscope itemtype=”http://schema.org/Offer”&gt;

    <p class=”price”> <?php
    $stockamount = $product->get_stock_quantity();
    $price = $product->get_price_html();
    $pricelabel = “”;
    if($stockamount == 0)
    {
    echo $pricelabel;
    }
    else
    {
    echo $price;
    };
    ?>
    </p>

    <meta itemprop=”price” content=”<?php echo $product->get_price(); ?>” />
    <meta itemprop=”priceCurrency” content=”<?php echo get_woocommerce_currency(); ?>” />
    <link itemprop=”availability” href=”http://schema.org/&lt;?php echo $product->is_in_stock() ? ‘InStock’ : ‘OutOfStock’; ?>” />

    </div>

    A simple php function did the trick but I am convinced your programming knowledge is extremely limited, anyhow I am out of this so called support forum, good luck supporting people with “hao to chenge tital produkt color plis?”

    Cheers.

    #203458

    Artem Temos
    Keymaster

    Hello,

    We are glad that you sorted it out. Sorry, but such additional customizations are out of our theme support. Actually, support policy is determined by Envato and you can read its details here https://themeforest.net/page/item_support_policy
    We are happy to help you with our theme configuration, elements, widgets, settings etc. But any code customizations that require our developers’ work are out of our theme support scope.
    I hope for your understanding.

    Kind Regards

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