Jump to content

Add a link to Helper list in BO


fortuner

Recommended Posts

Hello everyone:)

I'm making a small override to display a customer phone (and other datas) in Backoffice Order List. Everything works fine, but I want to add a link to customer phone like that

<a href="tel:+1234567890">+1234567890</a>

Here is the override code:

<?php

class AdminOrdersController extends AdminOrdersControllerCore {
    public function __construct() {
        parent::__construct();
        $this->_join .= 'LEFT JOIN `'._DB_PREFIX_.'address` addr ON (a.`id_address_delivery` = addr.`id_address`)'; //
		//$this->_select .= ', CONCAT(\'<a href = "tel:\', addr.phone_mobile, \'>\', addr.phone_mobile, \'</a>\') AS phone'; // I've tryed CONCAT but it returns text instead of link
		$this->_select .= ', addr.phone_mobile AS phone'; // Select mobile phone
		
		// Phones column
		$this->fields_list['phone'] = array(
            'title' => $this->l('Phone'),
            'align' => 'text-center',
			'class' => 'width-50',
			'prefix' => '<a href="tel:">',
			'suffix' => '</a>'
			//'callback' => 'orderPhone'
        );
}

Place it in the override/controllers/admin/AdminOrderController.php

 

As you can see, I've already tried CONCAT, but it returns plain text instead of link.

I also tried 'prefix' and 'suffix' but link href remains empty.

How do I add this link properly?

 

post-471209-0-50409200-1459150644_thumb.jpg

 

Thanks in advance!

  • Like 1
Link to comment
Share on other sites

  • 8 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...