On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • Hi all,

    first many many thanks YAMS, it’s a wonderfull add-on. Respect!

    I encounter a problem associating YAMS and TreasureChest to translate an e-commerce website. It seems that there is a problem of priority between those two components.

    Here’s the content of the basket resource :
    [!TreasureChest? &service=`cart` &cart_item_template=`cart_itemTPL-(yams_id)` &cart_wrap_template=`cart_wrapTPL-(yams_id)` &yams_id=`(yams_id)`!]

    The problem is that the (yams_id) placeholder seems not to be populated with the current language ID before the TC call. One thing that I don’t understand is that the call works for the first installed language but if I change the default language, it doesn’t work.

    I’ve explored the priority management in the backend, but TC is a snippet and YAMS a plugin. So you can’t choose which one need to be run first.

    One thing which could be possible is to get the yams_id placeholder from the TC snippet?

    Any idea.
      Equilibre Webdesign - Conception et r
    • Treasure Chest was abandoned long ago; I doubt if there is anyone supporting it at all any more.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
      • Hi,

        actually, YAMS is a module/snippet/plugin and even a chunk for mm_rules smiley but, you’re right its plugin part has to be executed before all others

        now concerning Treasure Chest (which i haven’t used at all so far) if it is a snippet, you can be sure it is executed after YAMS parsing plugin.
        For some other snippets as wayfinder or ditto, yams comes with its own solution work friendly with them, it’s not the case for treasure Chest

        SO ? smiley well, so, yes, a solution would be to introduce YAMS to Treasure chest. The first solution that comes to my mind is, as you suggest, use Ymas inside treasure chest snippet, quite easy to realise, just add
        $yams   = YAMS::GetInstance();
        $langId = $yams->GetCurrentLangId();

        at the very top of treasure chest snippet and then look for where it puts or parses chunks and add _$langId (or, in your case, apparently -$langId) to the chunks names in the call should do the trick

        Have swing

        edited : oops, Susan was faster than me smiley
          réfléchir avant d'agir
        • Many thanks for the reply. I used TC because Vision Cart wasn’t released and in fact, it works pretty well if you’re not afraid to put hands into the code.

          I’ll try this as soon as possible and will come back with results.

          Thanks again.
            Equilibre Webdesign - Conception et r