Skip to content

Conversation

@amisha25-razor
Copy link
Contributor

Note :- Please follow the below points while attaching test cases document link below:

- If label Tested is 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.

Test Case Document URL
Please paste test case document link here....

$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')) {
Copy link
Contributor

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?

Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor Author

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()];

Copy link
Contributor

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?

Copy link
Contributor Author

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.

$promotion["value"] = round($discountAmount ?? 0);
$response["promotion"] = $promotion;

if(is_plugin_active('woocommerce-currency-switcher/index.php')){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants