[BBcode] 

Hubzilla - Tips & Tricks: Shopping Cart Plugin

(Work in progress ;-))
There is currently no documentation of the cart plugin that I'm aware of. I needed help to set it up for a musician's online shop, so I posted to the forum. This is what I learned. It's by no means complete, but it should be a starting point. Thanks to M. Dent (the developer) and Mario Vavti for getting me started.

One important thing to note is that in order to buy from you, people need to have a Hubzilla or Zap account so that they can remotely authenticate to your site.


    Prerequisites


    This how-to assumes that you already know how to install apps and installed the cart app on your channel.

    It further assumes that you're familiar with the PayPal development tools and that you created an app there for the cart plugin already. If you don't know how to do that, head over to the PayPal documentation first. If you want to test your shop before you go live with it, you need to create both a sandbox and a live app.

    In order to set up the cart to accept PayPal payments (and to test your setup), you need both the client ID and the secret from the REST API app you created in your PayPal Developer account:

    Image/photo

    If you're planning to sell downloadables, you will also need the Privacy Groups app.

    Cart Settings


    As of writing this, the cart app doesn't have a settings button, so you have to manually enter the settings URL:
    /settings/cart

    Image/photo
    • If you just want a quick demo of what a shop can look like, you can enable the test catalog.
    • Set your currency
    • Enable "Manual Cart Module" for items that require manual interaction, e.g. shipping
    • Enable "Hubzilla Services Module" for downloadables
    • I haven't looked into the "Subscription Management Module" yet...
    • Enable the "PayPal Button Module"

    You will be able to configure your PayPal account after you hit submit:

    Image/photo

    Paste the keys (see Prerequisites) into their respective fields and click Submit again.

    Adding items


    Go to your cart home.

    Image/photo

    The "My Shop" menu is your administrative interface, the "Cart" menu is your actual shop.

    Downloadables

    Downlodable items are created using the Add/Remove Service Items link.

    Before you go there, though, a little preparation is required.

    Create a privacy group which will have access to the files you're selling. I will create one called "Vivaldi"; I'm going to create an item called "Vivaldi - The Four Seasons".

    Next, go to your files and create a new folder. Restrict access to this folder to the privacy group you created in the previous step and upload your files to this folder. It is also possible to simply upload the file without creating a dedicated folder and set access control individually, but personally, I prefer the organization in folders. I'm working on a musican's shop, after all, and with folders I can add individual MP3s for each album, and even higher quality files such as flac or wave, and the buyer can download individual files.

    If you want to use a picture for the item you're selling, upload this to a public album.

    This done, go to Add/Remove Service Items.

    First, you need to give your item an internal name. Don't use spaces here:

    Image/photo

    Click the + sign.

    Now you can add a description, price and photo. Keep the description short; it's gonna show as the title in your catalog. Under "Photo URL", paste the link to the picture you uploaded.

    Image/photo

    Before you can make any modifications which will allow the buyer to actually download the file, you have to click submit once. Then click on "Activation Commands":

    Image/photo

    Check "Add buyer to privacy group" and select the group you created earlier. Click "Submit".

    Now, when you click on "Activation Commands" again, you will see "Registered Commands" at the bottom of the green area:

    Image/photo

    If you also want to add the buyer as a connection (which is the only way they will show up in your privacy group), you have to repeat the previous step and select "Add buyer as connection" this time.

    Image/photo

    When you're done, go back to the top of the page and change "Item available for purchase" to yes.

    Image/photo
        
    Now you can go to /cart//catalog, and your item will show there:

    Image/photo