问题描述:

i need to customize the page that user sees at url: user/%user/orders/%uc_order

i tried to use hook_uc_order_pane

function mymodule_uc_order_pane() {

$panes['ship_to_xx'] = array(

'callback' => 'mymodule_uc_order_pane_ship_to_xx',

'title' => t('Just a Test'),

'desc' => t("Description!!"),

'class' => 'pos-left',

'weight' => 99,

'show' => array('view', 'edit', 'invoice', 'customer'),

);

return $panes;

}

and cleared all cache, but this doesn't work. It doesn't display anything.

Do you have any suggestion?

网友答案:

The code was not wrong. The correct way to do it is:

function mymodule_uc_order_pane() {
    $panes['mm_links'] = array(
    'callback' => 'mymodule_uc_order_pane_links',
    'title' => t('Just a Test'),
    'desc' => t("Description!!"),
    'class' => 'pos-left',
    'weight' => 99,
    'show' => array('customer'),
    );
    return $panes;
}

function mymodule_uc_order_pane_links($op,$order){
    $html='';
    foreach($order->products as $product){
        $node = node_load($product->nid);
        $html.='Date: '.$product->data['attributes']['Tour Date'][0].'<br/>';
        $html.='Parent ID: '.$node->field_tour['und'][0]['nid'].'<br/>';
    }   
    return ($html);
}
相关阅读:
Top