4 replies [Last post]
freeyland's picture
Offline
Joined: 02/21/2008
Juice: 14
Was this information Helpful?

hook_cart_display is not working when used in my own created module. Is this correct? hook_cart_display is not really a hook. It is invoked from the cart_pane hook? So this means if I want to manipulate the calcullations (for expamle to calculate the toatal an other way) I have to crate an othe cart_pane which I need to enbale in the administartion menu?

thx

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
Re: hook_cart_display not working in my own created module

hook_cart_display() is used by node types to control how they are displayed in the cart block. It's not called for all the modules like most hooks are. It's more like the node hooks hook_view(), hook_load(), etc.

I think there needs to be a way for other modules to affect what goes on in the cart page, especially for things like VAT and product discounts. I just haven't found a good way to go about it yet.

cjboranp's picture
Offline
Joined: 05/21/2009
Juice: 10
Is there a suggested workaround?

Hi Lyle,

I was wondering if you can suggest a way that we can manipulate the display of the cart without having to make changes to the source code.

Do you suppose that it would be best to create a custom shopping cart? I'm hoping we would not have to.

cfab's picture
Offline
Joined: 06/30/2009
Juice: 70
Hi, I'm facing this old

Hi,

I'm facing this old problem too, is there a solution at the present time?

I need to show ending dates to subscription products on the cart, and I can't figure out how to do it cleanly.

I've find a way but don't know if there won't be any side effects :

in my_module_cart_item, I have added $item->module="my_module"; and then I had access to my_module_cart_display for my product type.

Regards,
cfab

cfab's picture
Offline
Joined: 06/30/2009
Juice: 70
Re: Hi, I'm facing this old

For my own goal a better way was to use hook_uc_product_description_alter...