The portlet takes it's price from the content item the marker interface is
on, not the item.  So if you want to have the portlet show that price you
will either need to modify the price on the associated buyable (probably not
a good idea since that will change the price for everyone).  Or override the
default portlet so it has new logic and can look up it's price from the cart
if it exists.

Anyway is there a reason memberships have their own associated donation?
Why not create two line items, one for the membership and the other a
VariableDonationAmount line item if the user chooses to also donate.

-Rob

On Sat, May 23, 2009 at 4:24 PM, Tim Knapp <[email protected]> wrote:

>
> 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to