-
Notifications
You must be signed in to change notification settings - Fork 31
Add support for multi currency #622
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
includes/api/cart.php
Outdated
| $data[$i]['image_url'] = $productImage? wp_get_attachment_url( $productImage ) : null; | ||
| $data[$i]['product_url'] = $product->get_permalink(); | ||
| $data[$i]['price'] = (empty($productDetails['price']) === false) ? (int)$productDetails['price'] * 100 / $item['quantity'] : 0; | ||
| if (function_exists('is_plugin_active') && is_plugin_active('woocommerce-currency-switcher/index.php')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you create a helper function for this condition and call that here to check if the plugin is activated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the merchant activates the plugin but disables the feature in the plugin settings? Can this case occur? If yes, then will it break here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you create a helper function for this condition and call that here to check if the plugin is activated?
I’ve created a helper function with a razorpay_ prefix so it doesn’t conflict with other plugins
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the merchant activates the plugin but disables the feature in the plugin settings? Can this case occur? If yes, then will it break here?
Yes, that case can occur. That’s why I added the razorpay_is_woocs_multiple_allowed_enabled() helper which not only checks if the plugin is active but also validates whether the multiple allowed setting is enabled. If it’s disabled, the logic falls back gracefully, so it won’t break.
|
|
||
| $response += ['redirect' => true, 'one_click_checkout' => true, 'mandatory_login' => false, 'key' => get_option('woocommerce_razorpay_settings')['key_id'], 'name' => html_entity_decode(get_bloginfo('name'), ENT_QUOTES), 'currency' => 'INR']; | ||
| $response += ['redirect' => true, 'one_click_checkout' => true, 'mandatory_login' => false, 'key' => get_option('woocommerce_razorpay_settings')['key_id'], 'name' => html_entity_decode(get_bloginfo('name'), ENT_QUOTES), 'currency' => get_woocommerce_currency()]; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have we tested this on the dev store? Can FE handle currencies other than INR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have we tested this on the dev store? Can FE handle currencies other than INR?
Tested on dev store with non-INR; FE shows the correct symbol and formatting.
includes/api/coupon-apply.php
Outdated
| $promotion["value"] = round($discountAmount ?? 0); | ||
| $response["promotion"] = $promotion; | ||
|
|
||
| if(is_plugin_active('woocommerce-currency-switcher/index.php')){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note :- Please follow the below points while attaching test cases document link below:
- If label
Testedis added then test cases document URL is mandatory.- Link added should be a valid URL and accessible throughout the org.
- If the branch name contains hotfix / revert by default the BVT workflow check will pass.