multi_currency = $multi_currency; } /** * Initializes this class' WP hooks. * * @return void */ public function init_hooks() { // Only show currency selector if more than one currency is enabled. if ( 1 < count( $this->multi_currency->get_enabled_currencies() ) ) { add_action( 'woocommerce_edit_account_form', [ $this, 'add_presentment_currency_switch' ] ); add_action( 'woocommerce_save_account_details', [ $this, 'save_presentment_currency' ] ); } } /** * Add a select to allow user choose default currency in `my account > account details`. * * @return void */ public function add_presentment_currency_switch() { ?>
multi_currency->update_selected_currency( $currency_code ); } } }