Hi,
As part of my pay-for-subscription package I've just added an option to
specify an optional donation amount on subscription. In order to
implement this I modify the item.cost post the creation of the line
item. To help visualise things a bit better, the relevant code is as
follows:
<code>
cart_util = getUtility(IShoppingCartUtility)
cart = cart_util.get(self.context, create=True)
itemfactory = getMultiAdapter((cart, buyablemember),
ILineItemFactory)
if itemfactory:
item = itemfactory.create()
# Override the item name as
# its currently the members name
item.name = buyablemember.subscription_level()
# Add the optional donation amount
if buyablemember.getDonationAmount() != 0.0:
item.cost = item.cost +
buyablemember.getDonationAmount()
cart.__delitem__(item.item_id)
cart[item.item_id] = item
</code>
Now this works as far as the item.cost gets incremented and the
generated PayPal button displays the correct price but the PloneGetPaid
portlet is still displaying the old price (prior to incrementing it). Do
I need to reindex a catalog or something?
Thanks,
Tim
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"getpaid-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/getpaid-dev?hl=en
-~----------~----~----~----~------~----~------~--~---