0

I'm building a Drupal Commerce store. On cart view I need to display some additional information.

I want to create area handler like Commerce Order: Total. It should do some php logic and display the results.

Can anybody give me some advice how to build such a handler? The documentation didn't gave me much information.

| improve this question | | | | |
2

You need to create a custom module and override default area handler using hook_views_data_alter().

The default implementation of order total handler placed here.

| improve this answer | | | | |
1

You need to:

  1. implement hook_views_data_alter() to declare the area handler, and specify the name of the class that implements the handler.

  2. Implement the handler class, extending views_area_handler, and override the methods you need.

I wrote such an area handler for views_autorefresh some months back, find the code here: http://drupalcode.org/project/views_autorefresh.git/commitdiff/2bafcd7?hp=9108ef808df5165e946eb09cebe5bc6c9112acd2

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.