@@ -188,6 +188,33 @@ private void SetShipmentDetails(RateRequest request, decimal orderSubTotal, stri
188188 request . RequestedShipment . RateRequestTypes [ 1 ] = RateRequestType . LIST ;
189189 //request.RequestedShipment.PackageDetail = RequestedPackageDetailType.INDIVIDUAL_PACKAGES;
190190 //request.RequestedShipment.PackageDetailSpecified = true;
191+
192+ //for India domestic shipping add additional details
193+ if ( request . RequestedShipment . Shipper . Address . CountryCode . Equals ( "IN" , StringComparison . InvariantCultureIgnoreCase ) &&
194+ request . RequestedShipment . Recipient . Address . CountryCode . Equals ( "IN" , StringComparison . InvariantCultureIgnoreCase ) )
195+ {
196+ var commodity = new Commodity
197+ {
198+ Name = "1" ,
199+ NumberOfPieces = "1" ,
200+ CustomsValue = new Money
201+ {
202+ Amount = orderSubTotal ,
203+ AmountSpecified = true ,
204+ Currency = currencyCode
205+ }
206+ } ;
207+
208+ request . RequestedShipment . CustomsClearanceDetail = new CustomsClearanceDetail
209+ {
210+ CommercialInvoice = new CommercialInvoice
211+ {
212+ Purpose = PurposeOfShipmentType . SOLD ,
213+ PurposeSpecified = true
214+ } ,
215+ Commodities = new [ ] { commodity }
216+ } ;
217+ }
191218 }
192219
193220 private void SetPayment ( RateRequest request )
@@ -720,13 +747,15 @@ private Currency GetRequestedShipmentCurrency(string originCountryCode, string d
720747 var primaryStoreCurrency = _currencyService . GetCurrencyById ( _currencySettings . PrimaryStoreCurrencyId ) ;
721748
722749 //The solution coded here might be considered a bit of a hack
723- //it only supports the scenario for US / Canada shipping
750+ //it only supports the scenario for US / Canada / India shipping
724751 //because nopCommerce does not have a concept of a designated currency for a Country.
725752 string originCurrencyCode ;
726753 if ( originCountryCode == "US" )
727754 originCurrencyCode = "USD" ;
728755 else if ( originCountryCode == "CA" )
729756 originCurrencyCode = "CAD" ;
757+ else if ( originCountryCode == "IN" )
758+ originCurrencyCode = "INR" ;
730759 else
731760 originCurrencyCode = primaryStoreCurrency . CurrencyCode ;
732761
@@ -735,6 +764,8 @@ private Currency GetRequestedShipmentCurrency(string originCountryCode, string d
735764 destinCurrencyCode = "USD" ;
736765 else if ( destinCountryCode == "CA" )
737766 destinCurrencyCode = "CAD" ;
767+ else if ( destinCountryCode == "IN" )
768+ destinCurrencyCode = "INR" ;
738769 else
739770 destinCurrencyCode = primaryStoreCurrency . CurrencyCode ;
740771
0 commit comments