BV Commerce Forum
»
BV Commerce Support
»
General Support
»
Need just a quick Help to render Google and FeedPerfect Analytics
Rank: Member
Joined: 9/21/2004(UTC) Posts: 97
|
Greetings:
This is a no brainer for most of the guys here but I need a little help on a VB code we are modifying based on the google analytics code so we can track Jellyfish Marketing Channel performance.
The code below is just a portion of the code but as you can see the loop will always append a pipe symbol to the end of string regardless of the line items. What we need is for the pipe to act as a delimiter to separate line items and as such should not be present at the end. We cannot move the sb.append("|") before the sb.Append(GoogleSafeString(li.ProductSku)) as it will put a pipe symbol before Item designator (I:) and the first item.
sb.Append("I:") For Each li As BVSoftware.Bvc5.Core.Orders.LineItem In o.Items sb.Append(GoogleSafeString(li.ProductSku)) sb.Append("|") Next
The good output rendered will be:
i:item1|item2|item3
Thanks in advance.
Nolax
|
|
|
|
Rank: Member
Joined: 11/5/2003(UTC) Posts: 1,786
|
Instead of a for each loop you could do it like this: Code:
sb.Append("I:")
For i as integer = 0 to o.Items.Count -1 sb.Append(GoogleSafeString(o.Items(i).ProductSku)) if i < o.items.count -1 sb.Append("|") end if End For
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.