Changeset 3446121
- Timestamp:
- 01/24/2026 12:42:20 PM (7 weeks ago)
- Location:
- woo-razorpay/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
woo-razorpay.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
woo-razorpay/trunk/readme.txt
r3436262 r3446121 4 4 Requires at least: 3.9.2 5 5 Tested up to: 6.9 6 Stable tag: 4. 7.96 Stable tag: 4.8.0 7 7 Requires PHP: 7.0 8 8 License: GPLv2 or later … … 69 69 70 70 == Changelog == 71 72 = 4.8.0 = 73 * Store location–specific title and description configuration. 71 74 72 75 = 4.7.9 = -
woo-razorpay/trunk/woo-razorpay.php
r3436262 r3446121 4 4 * Plugin URI: https://razorpay.com 5 5 * Description: Razorpay Payment Gateway Integration for WooCommerce.Razorpay Welcome Back Offer: New to Razorpay? Sign up to enjoy FREE payments* of INR 2 lakh till March 31st! Transact before January 10th to grab the offer. 6 * Version: 4. 7.97 * Stable tag: 4. 7.96 * Version: 4.8.0 7 * Stable tag: 4.8.0 8 8 * Author: Team Razorpay 9 9 * WC tested up to: 10.3.4 … … 217 217 const WC_ORDER_NUMBER = 'woocommerce_order_number'; 218 218 219 const DEFAULT_LABEL = ' Credit Card/Debit Card/NetBanking';220 const DEFAULT_DESCRIPTION = 'Pay securely by Credit or Debit cardor Internet Banking through Razorpay.';219 const DEFAULT_LABEL = 'UPI, Cards, NetBanking'; 220 const DEFAULT_DESCRIPTION = 'Pay securely via UPI, Credit/Debit Card, or Internet Banking through Razorpay.'; 221 221 const DEFAULT_SUCCESS_MESSAGE = 'Thank you for shopping with us. Your account has been charged and your transaction is successful. We will be processing your order soon.'; 222 222 … … 453 453 add_filter( 'woocommerce_thankyou_order_received_text', array($this, 'getCustomOrdercreationMessage'), 20, 2 ); 454 454 } 455 456 private function getGeoBasedTitleAndDescription($key) 457 { 458 $dbValue = ($key === 'label') 459 ? $this->getSetting('title') 460 : (($key === 'description') ? $this->getSetting('description') : ''); 461 462 if (empty($dbValue) === false) 463 { 464 return $dbValue; 465 } 466 467 $locBasedTitleDes = [ 468 'US' => ['label' => 'Cards', 'description' => 'Pay securely via Razorpay.'], 469 'MY' => ['label' => 'Cards, FPX, Wallets', 'description' => 'Pay securely via Razorpay.'], 470 'SG' => ['label' => 'Cards, ApplePay, PayNow, Wallets', 'description' => 'Pay securely via Razorpay.'] 471 ]; 472 473 if (function_exists('wc_get_base_location')) 474 { 475 $baseLocation = wc_get_base_location(); 476 $country = isset($baseLocation['country']) ? strtoupper($baseLocation['country']) : ''; 477 if (isset($locBasedTitleDes[$country][$key])) 478 { 479 return $locBasedTitleDes[$country][$key]; 480 } 481 } 482 483 // Fallback to class defaults 484 if ($key === 'label') 485 { 486 return static::DEFAULT_LABEL; 487 } 488 return static::DEFAULT_DESCRIPTION; 489 } 455 490 456 491 public function init_form_fields() … … 469 504 'type'=> 'text', 470 505 'description' => __('This controls the title which the user sees during checkout.', $this->id), 471 'default' => __( static::DEFAULT_LABEL, $this->id)506 'default' => __($this->getGeoBasedTitleAndDescription('label'), $this->id) 472 507 ), 473 508 'description' => array( … … 475 510 'type' => 'textarea', 476 511 'description' => __('This controls the description which the user sees during checkout.', $this->id), 477 'default' => __( static::DEFAULT_DESCRIPTION, $this->id)512 'default' => __($this->getGeoBasedTitleAndDescription('description'), $this->id) 478 513 ), 479 514 'key_id' => array(
Note: See TracChangeset
for help on using the changeset viewer.