Copy link to clipboard
Copied
Hello All,
The code below does the following: It finds an item in Spanish (in this case it's GetBasket.options, 2) and adds `SPA` to the SKU code.
<cfif ListContains(GetBasket.options, 2)><option value="2"><cfset basketsku = GetBasket.SKU & "SPA"></option></cfif>
How do I do the following?
Instead of adding SPA at the end I need to replace a third character in the SKU with number 3. For example: the SKU code in English is 902013, but the SKU code for Spanish is 903013. As you can see the 3rd number is being replaced with 3. It will be standard for all items in Spanish. How do I modify the code above to replace the 3rd number with 3?
Thank you all very much in advance!
Copy link to clipboard
Copied
newString = left(oldString, 2) & "3" & right(oldString, len(oldString - 3);
Copy link to clipboard
Copied
Thank you Dan very much. Would it be possible implement what you wrote into existing code that I provided above?
Thanks!