Currency Not Setting
-
I tested this plugin in my local environment and it was working perfectly,in free version which basically set cookies. But when I used this plugin in development environment where my server was on Bluehost, plugin stooped to work. When I checked the plugin code I found a issue that cookie was not creating in browser maybe server was not setting up that. So I done some extra code which basically solved the issue. So anyone having the same issue can do that or even plugin developers can add this code in their next update.
File name : includes/data.php
Line number : 1031
Function Name : set_current_currency()Code to added :
if ( $currency_code !== '') { ?> <script> document.cookie = "wmc_current_currency=<?php echo $currency_code; ?>; path=/"; </script> <?php $this->setcookie( 'wmc_current_currency', $currency_code, time() + 60 * 60 * 24, '/'); } if ( ! $this->get_enable_multi_payment() && $checkout ) { ?> <script> document.cookie = "wmc_current_currency_old=<?php echo $currency_code; ?>; path=/"; </script> <?php $this->setcookie( 'wmc_current_currency_old', $currency_code, time() + 60 * 60 * 24, '/'); }; }
Basically I just added a javascript code in order to create cookies.
And that worked.
- The topic ‘Currency Not Setting’ is closed to new replies.