@kglr provided a nice way of calculating it when n is an explicit integer; to enforce that it is explicit, change n to n_Integer:
ClearAll[sum];
sum[n_Integer] := Total[Times @@@ Apply[Abs@*W, Tuples[{0, 1, 2}, {n, 2}], {2}]]
Here's a weird way of getting a symbolic version: integrate over a discrete region!
sum[n_Symbol] :=
Integrate[Product[Abs[W[p[[i]], q[[i]]]], {i, n}],
p \[Element] Point[Tuples[{0, 1, 2}, n]],
q \[Element] Point[Tuples[{0, 1, 2}, n]]]
(I would have liked to make this just one region to integrate over, but the simple way of doing that didn't seem to work. Another way would be to use )
ClearAll[n];
s = sum[n]

s /. n -> 1 (* or equivalently, n = 1; s *)
(* Out: Abs[W[0, 0]] + Abs[W[0, 1]] + Abs[W[0, 2]] +
Abs[W[1, 0]] + Abs[W[1, 1]] + Abs[W[1, 2]] +
Abs[W[2, 0]] + Abs[W[2, 1]] + Abs[W[2, 2]] *)
Here's a far simpler way: just define sum[n_Integer] as @kglr's expression, and don't define a value for sum[n_] or sum[n_Symbol]—that will leave sum[n] with n symbolic unevaluated until it becomes an explicit integer. :) (Maybe I should have led with this...)
You can also then give a value to Format[sum[n_Symbol]] := ..., so that it looks like the sum you wrote down, instead of a weird integral! E.g.
ClearAll[sum];
sum[n_Integer] := Total[Times @@@ Apply[Abs@*W, Tuples[{0, 1, 2}, {n, 2}], {2}]]
Format[sum[n_Symbol]] := HoldForm[Sum[Product[
BracketingBar@W[Subscript[p, i], Subscript[q, i]], {i, 1, n}],
SequenceForm[p, ",", q] \[Element] {0, 1, 2}^n]]
ClearAll[n];
sum[n]

The downside here is that now sum[n] has no computational content until we set n to be an explicit integer. In the former version, we could try simplifications and manipulations, e.g. multiplying by a scalar, and Mathematica would know what we were talking about. Here it's only formatting, nothing more.
ClearAll[sum]; sum[n_] := Total[Times @@@ Apply[Abs@*W, Tuples[{0, 1, 2}, {n, 2}], {2}]]give what you need? $\endgroup$