Hello, I’m encountering an issue with yaycurrency where the woocommerce\_currency hook is reverting back to “USD” after setting the currency with the yaycurrency widget. I placed the hook inside of a custom plugin with a function that prints out the currency that the hook gives you access to through it’s parameters. When I refresh the page it first prints the currency that is selected followed by printing “USD”.
[After a refresh the selected currency is first printed followed by USD eventually being printed. ])The selected currency’s total price seems to be displaying correctly on the cart/currency navbar widget (sometimes, it seems to malfunction here and there) and inside the cart on the side navigation. However, the subtotal is not being calculated properly for the cart side nav. I did not initially implement the functionality for this app, but it seems like the previous dev was storing a reference to the selected currency within individual products and using this to calculate total/subtotal for individual products and the total/subtotal for the cart.php cart. using hooks.
[Incorrect price being displayed \(USD should be 29$, SGD should be 39$ ish\)]) [This is the cart.php cart. In this photo the \\”MYR RM\\” prices are calculated using the reference to the currency that is stored in the product’s data to determine the correct price and not the yaycurrency’s currently selected currency. The subtotal and total is being miscalculated \(I plan to calculate them with a hook\) for the cart. ])​
[In this example the currency is set to \\”RM MYR\\” but we are getting incorrect subtotal for the subtotal. The subtotal should be 138.26])Is this the correct approach to take? Is the yaycurrency plugin bugged in regard to currency printing “USD” even when it’s not selected?
[ad_2]