[NSFW] change availability text on functios.php
-
add_filter( 'woocommerce_get_availability', 'filter_woocommerce_get_availability', 10, 2 ); function filter_woocommerce_get_availability( $availability, $product ) { $specific_categories1 = array( 'available', 'Διαθέσιμο', 'διαθέσιμο'); if ( $product->is_in_stock() && has_term( $specific_categories1, 'product_tag', $product->get_id() ) ) { $availability['availability'] = __('ΔιαθέσιμοssTag', 'woocommerce' ); } $specific_categories2 = array( 'Διαθέσιμο από 1 έως 3 ημέρες'); if ( $product->is_in_stock() && has_term( $specific_categories2, 'product_tag', $product->get_id() ) ) { $availability['availability'] = __('Διαθέσιμο από 1 έως 3 ημέρες', 'woocommerce' ); $availability['availability_newText'] = __('Διαθέσιμο από 1 έως 3 ημέρες', 'woocommerce' ); } $specific_categories3 = array( 'Διαθέσιμο από 4 έως 10 ημέρες'); if ( $product->is_in_stock() && has_term( $specific_categories3, 'product_tag', $product->get_id() ) ) { $availability['availability'] = __('Διαθέσιμο από 4 έως 10 ημέρες', 'woocommerce' ); $availability['availability_newText'] = __('Διαθέσιμο από 4 έως 10 ημέρες', 'woocommerce' ); } return $availability; }hey i use the above code on functios.php to change the text on the availability, but on my xml its shows me the old value .. how can I fix it ? can I use other variables to show the value?
The page I need help with: [log in to see the link]
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
The topic ‘[NSFW] change availability text on functios.php’ is closed to new replies.