Home › Forums › WoodMart support forum › Changing price to "Out of stock"
Changing price to "Out of stock"
- This topic has 5 replies, 3 voices, and was last updated 4 years, 8 months ago by
Artem Temos.
-
AuthorPosts
-
June 14, 2020 at 10:53 am #203331
hariskayParticipantHello, 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.
June 14, 2020 at 2:46 pm #203358
Elise NoromitMemberHello,
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
June 14, 2020 at 3:21 pm #203360
hariskayParticipantHello, 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.June 14, 2020 at 9:34 pm #203409
Elise NoromitMemberHello,
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
June 14, 2020 at 10:18 pm #203420
hariskayParticipantWhoever 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”><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/<?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.
June 15, 2020 at 6:09 am #203458
Artem TemosKeymasterHello,
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
-
AuthorPosts
- You must be logged in to create new topics. Login / Register