Questo utente non ha argomenti preferiti.
Argomenti preferiti del forum
Argomenti del forum creati
| Stato |
Argomento
|
Supporter | Voci | Post | Freschezza |
|---|---|---|---|---|---|
|
Yoast is broken in finnish, Brands don't appear etc.
Iniziato da: juhoA
in: English Support
Problem: Solution: add_filter( 'option_rs_message_for_single_product_point_rule', function( $value ) {<br /> if ( $value === 'rs_message_for_single_Tuote_point_rule' || empty( $value ) ) {<br /> return defined( 'ICL_LANGUAGE_CODE' ) && ICL_LANGUAGE_CODE === 'en'<br /> ? 'Buy this product and earn [rewardpoints] points ([equalamount])'<br /> : 'Osta tämä tuote ja ansaitse [rewardpoints] pistettä ([equalamount])';<br /> }<br /> return $value;<br />}, 999 );3. For the brand issue, a one-time script was used to sync brands across translations: add_action( 'admin_init', function() {<br /> if ( ! current_user_can( 'manage_options' ) ) {<br /> return;<br /> }<br /> $products = get_posts( array(<br /> 'post_type' => 'product',<br /> 'posts_per_page' => -1,<br /> 'post_status' => 'any',<br /> 'fields' => 'ids',<br /> ) );<br /> if ( empty( $products ) ) {<br /> return;<br /> }<br /> foreach ( $products as $product_id ) {<br /> $brands = wp_get_object_terms( $product_id, 'product_brand', array(<br /> 'fields' => 'ids',<br /> ) );<br /> if ( empty( $brands ) || is_wp_error( $brands ) ) {<br /> continue;<br /> }<br /> $trid = apply_filters( 'wpml_element_trid', null, $product_id, 'post_product' );<br /> if ( ! $trid ) {<br /> continue;<br /> }<br /> $translations = apply_filters( 'wpml_get_element_translations', null, $trid, 'post_product' );<br /> if ( empty( $translations ) ) {<br /> continue;<br /> }<br /> foreach ( $translations as $translation ) {<br /> if ( (int) $translation->element_id === (int) $product_id ) {<br /> continue;<br /> }<br /> wp_set_object_terms(<br /> $translation->element_id,<br /> $brands,<br /> 'product_brand',<br /> false<br /> );<br /> }<br /> }<br /> update_option( 'rs_brand_sync_done', time() );<br />} );If this solution does not resolve your issue or seems outdated, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the problem persists, please open a new support ticket. |
|
0 | 15 | 3 settimana, 5 giorno fa | |
|
My site is in finnish and I auto translated it to english, now I need to autotranslate some products…
Iniziato da: juhoA in: English Support |
0 | 4 | 2 mese, 2 settimana fa |