Tagged: woocommerce
-
AuthorPosts
-
October 20, 2017 at 2:21 am #866533
I’m trying to change the “In Stock” & “Out of Stock” texts in Woocommerce, I applied the below code in function file, it worked but on the product page only and it is also displaying the number of products beside my custom text i.e., “1 Available”.
What i want to do is to remove that number of product and it should only display “Available” or “Sold”, plus; need to stylize these texts in green and red color boxes. Also the same should change on the Wp-Admin as well in Woocommerce products area i.e., instead of “In Stock” & “Out of Stock” it need to be “Available” & ” Sold”.
Below is the code i used in function file.
Thanks & Regards,
Awaiting.
/**
* Change In Stock / Out of Stock Text
*/add_filter( ‘woocommerce_get_availability’, ‘wcs_custom_get_availability’, 1, 2);
function wcs_custom_get_availability( $availability, $_product ) {
global $product;
// Change In Stock Text
if ( $_product->is_in_stock() ) {
$availability[‘availability’] = $product->get_stock_quantity() . __(‘ plekken beschikbaar’, ‘woocommerce’);
}// Change Out of Stock Text
if ( ! $_product->is_in_stock() ) {
$availability[‘availability’] = __(‘VOL! Sorry…’, ‘woocommerce’);
}return $availability;
}October 20, 2017 at 2:29 am #866534Also, every product is unique and one piece only. I just noticed that it adds 1×1 on cart and checkout pages. I want to remove that x1, 2, 3 as well. How to achieve this? Any help will be appreciated. Thanking you
October 20, 2017 at 3:03 am #866535Update: I sorted out the it on product page on front-end, now need your help with the same changes on back-end.
October 20, 2017 at 3:06 am #866536Also, I don’t want the description tab on products page, it should directly show the additional information tab only and that too i want to rename.
October 21, 2017 at 11:45 am #867007Hi mschon1,
Ok, so what are the remaining issues that you need our help with? Can you summarize?
If you need further assistance please let us know.
Best regards,
VictoriaNovember 2, 2017 at 12:17 am #871462Hello Victoria,
Thank you for your reply.
I have 2 more issues;
1. How to display “My Account” instead of “Login / Register” for logged in users in Woocommerce?
2. On single product pages in page title the “Shop” link, i need to change it. Where to make these changes?I hope this screenshot will make things more clear to you; http://www.chinapakhills.com/wp-content/uploads/2017/11/enfold.jpg
Also, Istarted a new thread for this, which can be found here;
Thanks & Regards.
November 5, 2017 at 9:18 pm #872815Hi,
To change the text try a plugin such as: WooCommerce CustomizerBest regards,
Mike -
AuthorPosts
- You must be logged in to reply to this topic.