Jump to content

How to Add Product Features to Order Detail in BO


Recommended Posts

When going into BO - Orders and then selecting an order, where it lists all the products on the order, I want to add a few product features for each line item.  For example, weight.   

 

I found that I could add the headings for the features in the admin/themes/default/template/controllers/orders/helpers/view/view.tpl file.  It seems that I also need to edit the admin/themes/default/template/controllers/orders/_product_line.tpl file to populate the features for each product on the order.  

 

With that said, I cannot figure out how to call the features so that they are displayed.  Any help is greatly appreciated.

 

version 1.6.1.6

Edited by csimmons222 (see edit history)
Link to comment
Share on other sites

Try adding the following in _product_line.tpl before the </a> at about line 49:

            {assign var='features' value=Product::getFeaturesStatic((int)$product['product_id'])}
            {foreach from=$features item='feature'}
                {if $feature.id_feature == 1 || $feature.id_feature == 2}
                    {assign var='feature_lang' value=Feature::getFeature($current_id_lang, $feature.id_feature)}
                    {assign var='feature_value_lang' value=FeatureValue::getFeatureValueLang($feature.id_feature_value)}
                    {$feature_lang.name}: {FeatureValue::selectLang($feature_value_lang, $current_id_lang)}<br />
                {/if}
            {/foreach}

Change 1 and 2 to the IDs of the feature you want displayed. You can add more feature IDs there if needed.

Link to comment
Share on other sites

  • 2 weeks later...

Try adding the following in _product_line.tpl before the </a> at about line 49:

 

Change 1 and 2 to the IDs of the feature you want displayed. You can add more feature IDs there if needed.

 

Rocky, thank you!  This seems to work but it places the features underneath the Product Description / Reference number link within BO order details.  I was hoping to be able to add each of the feature I need as an individual <td> within the Product Details grid. 

Link to comment
Share on other sites

In that case, you'll have to insert the following code at about line 48 (after the </td>):

    {assign var='features' value=Product::getFeaturesStatic((int)$product['product_id'])}
    {foreach from=$features item='feature'}
        {if $feature.id_feature == 1 || $feature.id_feature == 2}
    <td>
            {assign var='feature_lang' value=Feature::getFeature($current_id_lang, $feature.id_feature)}
            {assign var='feature_value_lang' value=FeatureValue::getFeatureValueLang($feature.id_feature_value)}
            {$feature_lang.name}: {FeatureValue::selectLang($feature_value_lang, $current_id_lang)}<br />
    </td>
        {/if}
    {/foreach}

You'll also need to add a column header in admin/themes/default/template/controllers/orders/form.tpl at about line 1255:

							<th><span class="title_box">{l s='Feature'}</span></th>

Change 'Feature' to the name of the feature that is displayed in that column. This will only work if you're displaying an exact number of features for every product though. If some products don't have features or have different numbers of features you want displayed, you're better off using my previous solution.

Link to comment
Share on other sites

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