{"action":"closed","issue":{"url":"https://api.github.com/repos/woocommerce/woocommerce/issues/15188","repository_url":"https://api.github.com/repos/woocommerce/woocommerce","labels_url":"https://api.github.com/repos/woocommerce/woocommerce/issues/15188/labels{/name}","comments_url":"https://api.github.com/repos/woocommerce/woocommerce/issues/15188/comments","events_url":"https://api.github.com/repos/woocommerce/woocommerce/issues/15188/events","html_url":"https://github.com/woocommerce/woocommerce/issues/15188","id":230029780,"number":15188,"title":"Polylang cannot display translated Up Sells or Cross Sells as template change required","user":{"login":"damiencarbery","id":5992651,"avatar_url":"https://avatars3.githubusercontent.com/u/5992651?v=3","gravatar_id":"","url":"https://api.github.com/users/damiencarbery","html_url":"https://github.com/damiencarbery","followers_url":"https://api.github.com/users/damiencarbery/followers","following_url":"https://api.github.com/users/damiencarbery/following{/other_user}","gists_url":"https://api.github.com/users/damiencarbery/gists{/gist_id}","starred_url":"https://api.github.com/users/damiencarbery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/damiencarbery/subscriptions","organizations_url":"https://api.github.com/users/damiencarbery/orgs","repos_url":"https://api.github.com/users/damiencarbery/repos","events_url":"https://api.github.com/users/damiencarbery/events{/privacy}","received_events_url":"https://api.github.com/users/damiencarbery/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-05-19T16:46:08Z","updated_at":"2017-05-22T09:04:01Z","closed_at":"2017-05-22T09:04:01Z","body":"Polylang, in conjunction with https://github.com/hyyan/woo-poly-integration, is able to provide a translated shop. Unfortunately it cannot present the translated up-sells or cross-sells as it requires modifying two template files (cart/cross-sells.php and single-product/up-sells.php).\r\n\r\nI have created two PRs to add apply_filters() calls in these two template files that would allow Woo Poly Integration use add_filter() to use the translated cross-sell or up-sell product.\r\nPR #15174 and PR #15175 (I didn't know how to put them into one as I submitted it via the browser).\r\n\r\nHere is the code that Woo Poly Integration could use:\r\n\r\n    add_filter( 'woocommerce_cart_up_sells_post_id', 'dsh_polylang_translate_product_id' );\r\n    add_filter( 'woocommerce_cart_cross_sells_post_id', 'dsh_polylang_translate_product_id' );\r\n\r\n    function dsh_polylang_translate_product_id( $related_product_id ) {\r\n      if ( function_exists( 'pll_get_post' ) ) {\r\n        return pll_get_post( $related_product_id );\r\n      }\r\n      return $related_product_id;\r\n    }\r\n"}}
{"actor":{"display_login":"damiencarbery"}}