Jump to content

Add new database field to order_carrier table


Recommended Posts

Hi,

 

I've added a new field to the PS_ORDER_CARRIER table: "tracking_url"

What i want to do is show the tracking url value in the customer order detail (order_detail.tpl)

but i don't know how to load the new data into $order.shipping

{foreach from=$order.shipping item=line}
<tr>
<td>{$line.shipping_date}</td>
<td>{$line.carrier_name}</td>
<td>{$line.shipping_weight}</td>
<td>{$line.shipping_cost}</td>
<td>{$line.tracking}</td>
<td>{$line.tracking_url}</td>
</tr>
{/foreach}

 

I've put the class with the new field in override/classes/order/orderCarrier.php

/** @var string */
public $tracking_url;
 
/**
* @see ObjectModel::$definition
*/
public static $definition = array(
    'table' => 'order_carrier',
    'primary' => 'id_order_carrier',
    'fields' => array(
         .............
        'tracking_url' => array('type' => self::TYPE_STRING),
    ) ,
);

I'm missing a step for adding the data to the table, right?

Thank you so much.

 

Link to comment
Share on other sites

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