How do I enable "buyable" options for Folderish content types?

by Christopher Johnson last modified Dec 30, 2008 05:54 PM
By default, Folderish content types cannot be made buyable (or donateable, shippable) because it caused some confusion when the default view for a container was another content object. However it is easy to enable using some zcml.

Purpose

This howto covers making configuration changes so folderish content types (ie default "folder" or "large folder" or your custom folderish object) can be made buyable.

Prerequisities

You will need GetPaid installed, and an editor application to edit some configuration files.

Step by step

To enable it you need to add some lines of zcml to a your product. You can use the lines based on those in
PloneGetPaid/configure.zcml which sets it up for normal content as a model. For example, add:

<!-- Content to Payable Adapters -->
<adapter
   for="Products.CMFCore.interfaces.IFolderish"
   provides="getpaid.core.interfaces.IBuyableContent"
   factory=".content.BuyableContentAdapter"
   />
<adapter
   for="Products.CMFCore.interfaces.IFolderish"
   provides="getpaid.core.interfaces.IShippableContent"
   factory=".content.ShippableContentAdapter"
   />
<adapter
   for="Products.CMFCore.interfaces.IFolderish"
   provides="getpaid.core.interfaces.IPremiumContent"
   factory=".content.PremiumContentAdapter"
   />
<adapter
  for="Products.CMFCore.interfaces.IFolderish"
  provides="getpaid.core.interfaces.IDonationContent"
  factory=".content.DonatableContentAdapter"
 />