I'm sorry I was looking at my code and not the code that exists in the 1.80 release. You need to take the x++; and move it to the bottom instead of being on top. It being on top is what made both of them disappear. If you skip a number in Paypal and you send Item#1 and then Item#3 it will ignore Item#3 and everything that comes after it. The x++; at the top makes it skip numbers.
I originally wrote this code but Andrei changed it a bit and I didn't realize what value x had at that particular point. Make this change and I'm sure you'll see a difference. I'm sure you'll see the tax come back and the shipping should be there too.
Can you try to do another transaction that gets that error and then grab the address that is in the browser once Paypal gives you the error and post it here... it should have all of the stuff that you tried to pass to Paypal in it. We can see what is going on from that info.
When you get that error on the page the address in your browser should read something like this...
http://www.paypal.com/item_1=item&amount_1=$12.00&quantity_1=..... etc.
As you might be able to see from what you posted, the shipping is showing up as 28,00 (that's a comma in there, not a period) and every other item amount is being sent with a period. This is why you're getting that error.
I am not sure as to why it is only the shipping that is showing up this way. It may have to do with the currency you're using... your currency shows up like this: kr 348,00 (NOK) inkl mva and somehow the item prices and the tax gets coverted to a decimal format, but the shipping doesn't.
Give me a few minutes to think about it and try to figure out why this is happening.
In Norway and other Nordic countries, we have swaped comma and period, regarding nubers. Period for thousands and comma for decimals: "Four thousend two hundred kroner and ninty ore" = 4.200,90 here.
builder.AppendFormat("&item_name_" + x + "={0}", "Shipping"); builder.AppendFormat("&amount_" + x + "={0}", order.OrderShippingExclTax); builder.AppendFormat("&quantity_" + x + "={0}", 1); x++;
and change it to:
builder.AppendFormat("&item_name_" + x + "={0}", "Shipping"); builder.AppendFormat("&amount_" + x + "={0}", order.OrderShippingExclTax.ToString("0.00", CultureInfo.InvariantCulture)); builder.AppendFormat("&quantity_" + x + "={0}", 1); x++;
I guess I found out what that culture stuff is used for! It takes whatever the currency looks like and formats it so it can be passed to paypal. When I wrote the code I was only concerned with USD... good thing Andrei put that stuff in there!
This fix SHOULD get you shipping as an item... which makes me wonder why Paypal leaves shipping off when it is sent as shipping. Because nopCommerce IS sending shipping... you can see it in the string you posted, it just wasn't fomatted correctly because of the different currency.
Give this a try and see if it works. If it does then you may just want to leave it sending shipping charges as an item or you can switch it back and try to figure out why Paypal ignores the shipping you're sending. There may be some setting in your Paypal account or some other unknown reason.
In Norway and other Nordic countries, we have swaped comma and period, regarding nubers. Period for thousands and comma for decimals: "Four thousend two hundred kroner and ninty ore" = 4.200,90 here.
It seems very strange because shipping fee is already passed as culture independent builder.AppendFormat("&shipping_1={0}", order.OrderShippingExclTax.ToString("0.00", CultureInfo.InvariantCulture));
Does anybody else experiencing this issue?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.