We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10152
    • 156 Posts
    Hello pirates,

    it almost could work with yams, just the "add to cart" not triggering for the second language pages because of the language url prefix and the .js is not loaded.


    Any help for url rewriting or an other trick please ?

    EDIT : a temporary and very unprofessional solution is to create the folders and subfolders with js file inside and it works now !

    What would be cool is to get the possibility of auto translating "add to cart", "view cart" links...

    For those struggling with cart or "view cart" links not displaying : there must be a div like that somewhere in your page :
      <div class="treasure_cart"></div>




    Great extension !

      • 26435
      • 1,193 Posts
      ScottyDelicious Reply #202, 17 years ago
      Hey French Fries.
      What is your URL so I can take a look at it to help diagnose the problem?
        Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
        All of the above... in no specific order.


        I send pointless little messages
        • 22851
        • 805 Posts
        French Fries. I might be able to help from the YAMS point of view.. but I need to know how the URL that the ’add to cart button’ redirects to is generated and embedded in the document. Is it in a template that can be affected by placeholders?
          YAMS: Yet Another Multilingual Solution for MODx
          YAMS Forums | Latest: YAMS 1.1.9 | YAMS Documentation
          Please consider donating if you appreciate the time and effort spent developing and supporting YAMS.
          • 10152
          • 156 Posts
          @Dr. Scotty Delicious : the url is http://wagXXXadam.com/en/resources/magento/magento-products-to-xml-exporter (please remove XXX). The js problem is solved by adding in server config
          RewriteRule ^en/(.*)\.js$ $1.js [L]
          . There is a new bug now, cart adds products twice.

          @PMS : The add-to-cart link is :
          <a href="#" onclick="return false;" class="treasureChest" name="1" rel="id"><img src="/assets/user/charte-graphique/add-to-cart.png" width="" height="" class="addToCart" alt="Add to cart" /></a>

          The text "add-to-cart" is an input field the can be set inTreasureChest module config. In my case I set it to be an <img /> tag
            • 22851
            • 805 Posts
            Quote from: French at Sep 29, 2009, 01:32 AM

            @Dr. Scotty Delicious : the url is http://wagXXXadam.com/en/resources/magento/magento-products-to-xml-exporter (please remove XXX). The js problem is solved by adding in server config
            RewriteRule ^en/(.*)\.js$ $1.js [L]
            . There is a new bug now, cart adds products twice.
            Just had a look at the URL you provided for the site. The reason that the js file was not being found is that you have <base href="http://wagXXXadam.com/en/" /> in your head block. Try using
            <base href="(yams_server)" />
            instead. This will output the address without the root name. Then you wont need the .htaccess rule.
              YAMS: Yet Another Multilingual Solution for MODx
              YAMS Forums | Latest: YAMS 1.1.9 | YAMS Documentation
              Please consider donating if you appreciate the time and effort spent developing and supporting YAMS.
              • 10152
              • 156 Posts
              Thanks for the htaccess trick, i had (yams_site) instead of (yams_server). does anyone have an idea why it adds products twice ? there is no code in double...
                • 15001
                • 697 Posts
                What would be cool is to get the possibility of auto translating "add to cart", "view cart" links...

                @French Fries:
                Look here if you’re looking for a French translation of Treasure Chest:
                http://www.altipoint.ch/index.php?id=139

                Regards.

                  • 10152
                  • 156 Posts
                  @Jul, thanks for the links, but this is just admin translation, i’m looking for something that could handle on-the-fly translation of "view cart", "add to cart", "buy now"...

                  Sorry for asking again,products are added twice when adding to cart.
                  Someone solved this by uncaching product pages but it has no effect for me.
                  http://modxcms.com/forums/index.php/topic,35306.new.html#new

                  EDIT : is there an unpacked treasurechest.js availbale somewhere for trying to debug ?

                  EDIT : Here is a dirty hack for those who may face the same problem :
                                      if ($product['inventory'] != NULL)
                                      {
                                          $this_item = array();
                                          $items = explode(',', $cart);
                                          foreach ($items as $item)
                                          {
                                              if ($item == $id) $this_item[] = $item;
                                          }
                                          if (count($this_item) >= $product['inventory']) return;
                                      }
                                      // Add the three following lines
                                      $_SESSION['dirtyHack']++;
                                      if ($_SESSION['dirtyHack']%2==0){
                                          $cart .= ','.$id;
                                      }
                                  }


                  Just add three lines in treasurechest.class.php at LINE 103.
                  I still have no idea why products are added twice or what i’ve done wrong, but after a very long struggle this solution could be helpful for anyone else.
                    • 29703
                    • 217 Posts
                    Hi all,

                    Is there anyway I can customise what’s generated in:

                    <div class="treasure_cart">[here]</div>


                    I can’t find any reference to what’s generated in the chunks, snippet or javascript.

                    I know you can change the name of the links in the module configuration but that isn’t enough control for my requirements. Any help would be great!

                    Thanks!
                      • 10152
                      • 156 Posts
                      Hi, you can customize cart div.

                      The cart div is in the jquery packed file and you can modify the css. You can enter "<img src="my_basket.png" /> to add image instead of "view cart"