We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29635
    • 361 Posts
    This is an auto-generated support/comment thread for FoxyCart Webuser Paid Subsciptions.

    Use this forum to post any comments about this addition or any questions you have regarding its use.

    Brief Description:
    Paid webuser subscriptions for MODx. Allows you to use FoxyCart subscriptions to manage webuser permissions. Useful for creating a paid members only section, paid blog subscriptions, paid premium content subscription, etc.

    Could be modified to use a non-subscription product as well (one-time payment for unlimited access).

    NOTES:
    This is working on one site so far, but we’re assuming there are going to be issues with it, so please post comments on this thread so we can tighten it up.

    Also worth noting is that Joey (Tilted Symmetry) authored this package.
      Need MODx Ecommerce? Try FoxyCart!
      • 6126
      • 25 Posts
      Great addition! The only issue I am having is that the WebUser needs to log out and back in order for their new group to take effect. Do you know of any way around this?

      I guess modx doesn’t query the webuser’s permissions on each page load...there should be a way to force it though.

      Thanks for the great snippets and plugins!

      John
        • 29635
        • 361 Posts
        Glad you like it, John. We actually just added some functionality that should make it possible to (effectively) share passwords between FoxyCart and MODx, so we could actually streamline the process a bit, since it is a little awkward currently. If you’re interested let me know. If you have enough PHP / MySQL experience to help it’d be even better wink
          Need MODx Ecommerce? Try FoxyCart!
          • 6126
          • 25 Posts
          I am definitely interested in any shared password streamlining. We are handling it a little differently since the site will have two access levels, one for free memberships and one for paid. What I am doing is having a standard link to the signup for the free membership and then if they have the free membership, pushing them to upgrade.

          I am relatively new to the MODx platform and an intermediate (or is that remedial?) PHP/MySQL developer. I basically know enough to be dangerous! wink
            • 6525
            • 15 Posts
            Hi, I just installed this snippet. I am trying to understand the directions. I have been using Modx for a couple months, and have just started using foxy cart.

            I have created TVs for "code" and "webGroup". I’m not sure how they are used by the subscription manager though.
            I uploaded the foxycart_webuser_subscriptions folder to my server.
            I created the snippet - FoxyCart_Subscription_Manager, entered the parameters:
            Datafeed Key Phrase: mydatafeedphrase
            Product ID TV Name: Subscribe895
            Web Group TV Name: Join Ranch Pride
            Log File (optional):
            I created a blank page with the snippet call "[!FoxyCart_Subscription_Manager!]" and made sure my data feed key were identical on the snippet and my foxycart admin.
            I create the chunk for RegistrationLink, and changed the id to my product page’s id.
            I created the chunk for SubscriptionLink, and changed all the variables to my variable, however i dont know what to change "userID=[+userID+]" to.
            I created the snippet "FoxyCart_Subscription_Link".
            I created the plugin - FoxyCart_Subscription_Manager.
            I edited the variables "$tvCode", "$webGroup", "$grace" to my variables in plugin.FoxyCart_Subscription_Manager.php.
            I created a product page and added this call "[!FoxyCart_Subscription_Link? &subLinkTpl=`ChunkName` &regLinkTpl=`RegLinkChunkName` &pageID=`56` &URLproductName=`longtitle`!]", I changed ChunkName to SubscriptionLink, and changed RegLinkChunkName to RegistrationLink, and changed the ’56’ to the product’s pageID. I put "Subscribe895" in the code field, and "Join Ranch Pride" in the webGroup field.

            I still receive this error "error: no post data" on my subscription manager document. Could someone tell me what I do wrong please? Thanks
              • 29635
              • 361 Posts
              If you load that page in your browser, that’s what you should get, since you’re loading it and there isn’t any post data. In other words, if you just load the page, there’s no XML to parse, right? So that’s the correct error response.

              When you set FoxyCart to send the XML to your page, that’s when it’ll function. There should be some instructions in there for how to set up your FoxyCart XML datafeed.

              If you want to test a little easier, use these two scripts. Send the XML (in the FoxyCart admin) to the "write to file" script, so you can get a copy of exactly what’s being sent. Then use the second script to post that XML to your MODx document to make sure things are working as expected. That can be much easier than placing a bunch of orders and waiting to see if it worked. (Though that’ll of course work too.)

              If I’ve totally missed your question, I apologize. This snippet’s a bit tricky to set up, and the documentation’s long, so if you need more help just ask.
                Need MODx Ecommerce? Try FoxyCart!
                • 6525
                • 15 Posts
                Hey thanks for the quick reply. I am also new to XML also laugh. So would I need to process some kind of transaction to see the results of these 2 snippets?

                I just read the datafeed wiki, okay I answered my question. I’ll try this out later tonight. Thanks!
                  • 3707
                  • 241 Posts
                  When you view your product page, do you see either the subscription link or the registration link appearing?

                  If you do, do both these links work?

                  You don’t need to change "userID=[+userID+]" to anything. The placeholder will be replaced by value of the user ID if you are logged in and be used to add the subscription to that user account.
                    • 6525
                    • 15 Posts
                    bob1000, you are correct. I only see the RegistrationLink chunk not the SubscriptionLink chunk.

                    I was confused about the "RegistrationLink" chunk. The directions say:

                    <a href="[~555~]">Register to Subscribe</a>
                    <!-- '555' should be replaced with the ID of the page that contains your subscription form -->


                    Is this subscription form my product page? If so, should my product page call the RegistrationLink which is just the product page?:

                    [!FoxyCart_Subscription_Link? &subLinkTpl=`SubscriptionLink` &regLinkTpl=`RegistrationLink` &pageID=`77` &URLproductName=`longtitle`!]


                    Is the pageID, my product page? Sorry, I am so lost on how all these parts tie into each other, and just trying to understand how exactly this snippet works. Oh and lastly, for the "SubscriptionLink" chunk, I should only leave the userID as a placeholder and replace the other placeholders, correct?

                    <a href="http://yourdomain.foxycart.com/cart?code=[+product_code+]&name=[+URLproductName+]&price=[+product_price+]&sub_frequency=[+product_sub_frequency+]&amp;userID=[+userID+]" class="foxycart">Subscribe</a>


                    And what do those TVs "code" and "webGroup" do in this whole process?

                    Thanks for your help bob1000 and the man can! The good news, is the snippets to read the XML data feed works for me, so I am almost there! laugh
                      • 29635
                      • 361 Posts
                      The code is important and needs to be unique, as that’s how the snippet recognizes the subscription in the XML.

                      The webGroup is the webGroup you want to add your users to when they subscribe. The directions say to make it a TV, but if you only have one group you care about you could just as easily hardcode it into the chunk. (If it’s a TV you could conceivably use the same snippet/chunk combo to have many products like "regular membership" and "premium membership" or etc.

                      The confusion between the registration and subscription bits is totally understandable, and there’s actually a different (arguably better) way to handle the whole process. As is, you can’t add a subscription unless you’re a logged in webuser. So the Subscription_Link snippet checks to see whether or not the user is logged in. If they are, they can buy the subscription. If they’re not, they need to register first, then come back to subscribe.

                      (That could be modified to allow subscription if they’re _not_ logged in, and just have MODx create a webuser automatically with a synched password to what they just entered in FoxyCart. That’d be a better way, I think.)

                      Does that make more sense?
                        Need MODx Ecommerce? Try FoxyCart!