[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)
- You must be logged in to reply to this topic.