We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15152
    • 360 Posts
    I have a store set-up and working well, except ... All of the pricing is off. It’s pulling the price from the previous item. Product ID is correct. Has anyone seen this before?
    I’m using this chunk -

    <div class="detail">
    [[TreasureChest? &item=`[*productID*]`]] 

    <h2><a href="[~[+id+]~]">[+longtitle+]</a></h2>
    <div class="tcimage"><a class="thickbox" title="[+title+]" href="[*productImage*]"><img src="[*productThumb*]" alt="[+title+]" /></a></div>

    <p>Price $[+treasure.amount+] | Shipping $[+treasure.shipping+] |
 Qty In Stock [+treasure.inventory+]

    Medium: [*medium*] | Size: [*size*]</p>
    <p>[+introtext+]</p>
    <p class="product-add">[+treasure.add+]

    <div class="treasure_cart"> </div>
 </p>
    </div>

    The client enters the ProductID into a TV. They seem to match up.

    If you go here: http://74.52.121.34/~picasso/Drawings-Store you can see what I mean. Poison Kiss is $85, Unleash the Beast is supposed to be $250, Summer Heat is supposed to be $225.

    Thanks
      There are no boring projects. Only boring executions. ~ Etzkorn
      www.impress-design.com
    • Sounds like a bug in the loop coding (starting a count from 1 instead of 0)
        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
        • 15152
        • 360 Posts
        Susan

        I’m lost on these things. Can you explain further?

        Also, it isn’t just pricing, it’s all of the info coming from TC. Everything is being assigned to the item entered before it.
          There are no boring projects. Only boring executions. ~ Etzkorn
          www.impress-design.com
        • Sorry, I’m not at all familiar with TreasureChest. But that error is a common one whenever there is code to loop through a list of things; if you start counting the items 1,2,3,4 ... it will make that error, since PHP (and most programming languages) count 0,1,2,3 ... and as you can see if you match up these items, the first items won’t match; and they’ll all be off by one. For example, item 1 (from the first list) will get price #0 (from the second list), item 2 will get price 1 and so it goes - each item is off by one.

          However, since I don’t know how TreasureChest works, this may have nothing at all to do with your particular problem; it was just a general observation of what the error you’re reporting brought to mind.
            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
            • 15152
            • 360 Posts
            Thanks, Susan. It makes sense. Not that I have any idea how to fix it!
              There are no boring projects. Only boring executions. ~ Etzkorn
              www.impress-design.com
            • I’m sorry, neither do I, but I figured that the thought might give somebody an idea of what the problem is.
                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
                • 3749
                • 24,544 Posts
                Have you tried calling treasure chest uncached?

                [!TreasureChest?  &item=`[*productID*]`!]
                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting
                  • 15152
                  • 360 Posts
                  Bob
                  Yes, calling the TV directly doesn’t pull any of the data in at all - unless I use the placeholder. And it’s definitely uncached. Thanks.
                    There are no boring projects. Only boring executions. ~ Etzkorn
                    www.impress-design.com
                    • 15152
                    • 360 Posts
                    Anyone got any ideas?
                      There are no boring projects. Only boring executions. ~ Etzkorn
                      www.impress-design.com
                      • 7455
                      • 2,204 Posts
                      little bit off topic but I made a small script to create a listbox that automaticly hass all the items and numbers in one list to select from instead of the client typing in the number it can select the name of the product:

                      http://modxcms.com/forums/index.php/topic,20173.msg217011.html#msg217011

                      greets Dimmy
                        follow me on twitter: @dimmy01