Updated on Januar 16, 2010 - 9:15 GMT
Bug of a Ditto call invoking TreasureChest (TC) for a catalogue
(TC placeholders corresponding to first listed product used twice)
Hi,
I’m setting up a TreasureChest demonstration.
The catalog is built as a tree and the each parent node can display a short description of all child products thanks to Ditto.
Screenshot:
http://altipoint.ch/dev/bug_ditto_treasurechest.jpg
Ditto uses a chunk that calls the [*introtext*] field of all descendants, without depth limit.
The [*introtext*] of all child documents itself calls a chunk which invokes the TreasureChest snippet. Here’s this chunk:
<a href="[~[+id+]~] " class="souligne" title="Voir les détails de ce produit.">[+pagetitle+]</a>
[[TreasureChest? &item=`[+pagetitle+]` &selector=`item_name` ]]
<div style="float:right;text-align:right">
<span class="h2" style="display:inline">[+treasure.amount+]</span> <span class="rouge">CHF</span>, H.T.
</div>
(...)
And the Ditto call from the catalogue template:
[!Ditto? &parents=`[*id*]` &depth=`all` &tpl=`ecommerce1_fiche_resu_produit` &sortBy=`menutitle` !]
The screenshot linked above shows that the price of the first item referenced by Ditto is re-used for the second item. The third item displays the price of the second one, a.s.o.
Can other developpers reproduce this bug, or I’m alone with it?
Is there a technique to overcome this?
Thanks.
Notes:
1) Here, the call to Ditto is uncached and the one to TreasureChest is cached, but the bug stays if doing the contrary.
2) Don’t worry about the "Add to cart" buttons on the linked picture as they were removed from the code.
3) Of course, during tests the cache was cleared both on server and client sides.