Personal tools
You are here: Home Products GetPaid with Plone Documentation How To How do I enable "buyable" options for Folderish content types?
Document Actions

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

This How-to applies to: Any version.
This How-to is intended for: Integrators and site admins, Developers

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"
 />

 

by Christopher Johnson last modified September 20, 2007 - 22:24
Contributors: hazmat

Make an AT-based object buyable

Posted by Edmund Moseley at October 3, 2007 - 16:34
Kapil helped me with my configure.zcml such that my AT-based, folderish custom content type could be made buyable.
Here is my configure.zcml:

<configure xmlns="http://namespaces.zope.org/zope"
xmlns:zcml="http://namespaces.zope.org/zcml"
xmlns:five="http://namespaces.zope.org/five">
<adapter
for="Products.Archetypes.interfaces.IBaseFolder"
provides="getpaid.core.interfaces.IBuyableContent"
factory="Products.PloneGetPaid.content.BuyableContentAdapter"
/>
<five:implements
interface="zope.app.annotation.interfaces.IAttributeAnnotatable"
class="Products.ATMSensors.content.SensorProduct.SensorProduct" />
</configure>

For any issues with the web site functionality, please file a ticket.

Please consult the policy on plone.org content if you want your content published on this site.

Servers and hosting by