PDA

View Full Version : Related item is same for all products


gordon_moe
07-05-06, 09:53 PM
Spent a fair amount of time working on a VC CPT layout that will allow a link to the product detail page only when the product has related items.

Thanks to Bruce -Phosphor Media- the conditional works, HOWEVER, all text links point to the same product. See here:

http://www.nordicneedle.com/Merchant2/merchant.mvc?Screen=CTGY&Category_Code=G06-04-00

or

http://snipurl.com/sryb

Rollover and notice that all links go to the product at the end of the list! Frustrating. I'm suspecting a 'token order processing' issue.

Code in "Related Products main template" of CPT is:

%IF(RelatedProducts.d.product_id)%
<a href="/Merchant2/merchant.mvc?Screen=PROD&Store_Code=NN&Product_Code=%prodcode%">
This TEXT LINK to Product only appears if there are related items</a>
%ELSE%
this appears because product does not have Related Products
%IFEND%

Thanks to all in advance.

Gordon

Bruce - PhosphorMedia
07-05-06, 11:18 PM
I notice that the Add to My Wish List link has the same problem...

this test probably needs to be in the Related Products row template...the Main template is for the static heading and is processed only "once" and probably stored (as it should not contain product specific data...

gordon_moe
07-05-06, 11:27 PM
Actually, the Wish List link is working - I do have unique URLs for those links.

I have tried what you mention with mixed results.

I can get the product code to work on each line, and I can get your conditional technique to work too.

I'm just frustrated that I can't marry the two.

If I start to put stuff in the %row% template, then I get that content repeated for EVERY related products. If a product has 6 related items, I get 6 links.

Gordon

Bruce - PhosphorMedia
07-06-06, 12:23 AM
Well, one of those cases where you get what you asked for, not what you want/need<G>...

I think I understand now...

%IF(RelatedProducts.d.product_id AND NOT g.AlreadyDidThat)%
<a href="/Merchant2/merchant.mvc?Screen=PROD&Store_Code=NN&Product_Cod e=%prodcode%">
This TEXT LINK to Product only appears if there are related items</a>
%SET(AlreadyDidThat|1)%
%ELSE%
this appears because product does not have Related Products
%IFEND%
%SET(AlreadyDidThat|0)%