Skip to content

Instantly share code, notes, and snippets.

@ahmedeshaan
Created May 18, 2021 06:51
Show Gist options
  • Save ahmedeshaan/5e7c6e4271c7c6bd2fa31733e47f3ece to your computer and use it in GitHub Desktop.
Save ahmedeshaan/5e7c6e4271c7c6bd2fa31733e47f3ece to your computer and use it in GitHub Desktop.
function wd_tiny_cart_wpml_page_id($page_id) {
global $sitepress;
if ($sitepress && has_filter('wpml_object_id')) {
$pageId = apply_filters('wpml_object_id', $page_id, 'page', true, $sitepress->get_current_language());
}
return $pageId;
}
add_filter('woocommerce_get_cart_page_id', 'wd_tiny_cart_wpml_page_id');
add_filter('woocommerce_get_checkout_page_id', 'wd_tiny_cart_wpml_page_id');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment