We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26870
    • 10 Posts
    Problem: Adding to cart. Getting the cart to display.

    I want to know how I need to set up the variables to display the cart contents. I think the ’Add to cart’ button may be working but the cart never shows it. I assume that something is missing or there is an incorrect variable somewhere. I wish I had access to the server as it may be an installation error. Is there any way to check the version of PHP, Apache, etc that is currently running on the server without having access to it? Thank you,



    Shadow
      • 4310
      • 2,310 Posts
      To view your server configuration use Reports => System Info inside the Modx Manager.
        • 26870
        • 10 Posts
        Could my problem be related to the versions of PHP and such on the server?

        PHP: 5.2.6
        Apache: 2.2.10



        Shadow
          • 4310
          • 2,310 Posts
          PHP 5.2.6 should be fine.
          I doubt the problem is server related.
          On the product pages do you have something like :
          [[TreasureChest? &item=`(the pages doc id`]]
          {{treasurechunk}}

          A cart page with this :
          [!TreasureChest? &service=`cart`!]

          And in the Module configuration :
          Cart ID = (the doc id of the cart page)
            • 26870
            • 10 Posts
            {{treasurechunk}}
            That seems to be a start. I did have everything else where it was suppose to be. My chunk code is named tcCartItem, I just replaced what you had with that. It seems that was missing from the product page. Now I have to find what else is missing from the rest of the site. I am not really sure where the chuck is suppose to go. I’ll link to it.. http://www.mia-airsoft.com/aeg-electric-airsoft-guns/Classic-Army-Sportline-M15A4-Carbine-Value-Package.html
            I will also post the code that I have for that page.
            [[TreasureChest? &item=`5`]]
            
            
            [+treasure.image+]
            
            [+treasure.item_name+]
            
            Item # [+treasure.item_number+]
            
            Specs: [+treasure.spec+]
            
            $[+treasure.amount+]
            
            Shipping Amount: [+treasure.shipping+]
            
            
            {{tcCartItem}}
            
            [+treasure.add+]
            
            
            


            I also might have something missing form the template, there was a comment in the template that said <--Cart Goes Here. I have no idea what I am suppose to put there. Oh and on the top of the page I put some "debug" info if you will. it has a couple cart variables, so I could see if any of them where working.

            Shadow
              • 26931
              • 2,314 Posts
              Hi there,

              don’t know if it concerns your exact problem, but i think it’s quite usefull nonetheless -> http://www.terrybarthdesign.com/terrys-notes-on-treasure-chest-11_08_08

              cheers, j
                • 26870
                • 10 Posts
                Yeah I have read though that thing about 10 times. It does nothing to help my problem. I believe my page templates that hold the cart values are wrong. I have no idea what I need to put in there to get my cart working. I was hoping that I could see a section of someones code, as it seems no one is willing to share any information. I just need to know what I am doing wrong. Jumping into a partially finished website is kind of a pain in the ass. I do love CMS though, just having problems getting this cart rolling.



                Shadow
                  • 29525
                  • 388 Posts

                  Might this help?

                  Note the following div is required to tell TC where to put the links to view or empty the shopping cart. These links appear when you click on the add to cart link

                  <div class="treasure_cart"> </div>
                    www.terrybarthdesign.com
                    • 26870
                    • 10 Posts
                    I copied the entire html from the Terry’s notes document. So that is in there. I also added the {{tcCartItem}} chunk right under [[treasureChest? &item=`5`]]

                    What code do I need to display the cart, how do I get it to show whats inside of it? There seems to be nothing ever doing anything inside that cart. I dont know if I can dig though the treasureChest.class.php code to find what I need. I guess I will try, I really dont know what I am looking for.



                    Shadow
                      • 29525
                      • 388 Posts
                      just another guess. . .

                      Did you create the cart document? As a quick test, I deleted my cart document and went back to my product page. The Add to card button was there but didn’t do anything. It seems to behaves in a similar fashion as yours.
                        www.terrybarthdesign.com