Moving a feature field in Admin

Hi all



Could anyone advise on how hard it would be to copy/duplicate a features field (Manufacturer) to the General tab in the Product page in the admin backend?



I just want to make it easier to set this value during product creation and also make it less easy to forget :slight_smile:



So I want to have a drop-down called Manufacturer on the General tab for a product which would be exactly the same drop-down as the one on the Features tab. Ideally it would be in the Information section of the General tab



thanks

For those interested I solved this:



My manufacturers field is called Brand and that’s what I want displayed on the General tab when adding/editing a product.



I created a new .tpl file (product_assign_features_brand.tpl) and saved it to a new folder (admin\views\products\components\custom_components)



This file contains:


{* $Id: product_assign_features_brand.tpl 7043 2009-03-16 08:49:44Z zeke $ *}


{foreach from=$product_features item=feature key="feature_id"}

{if $feature.description == "Brand"}






{assign var="value_selected" value=false}







{/if}
{/foreach}




This is just a very slighted edited copy from product_assign_features.tpl



I then edited the update.tpl in admin\views\products and added this after the Price field (line 49 for me)



{** Product 'Brand' copy from - Product features section **}

{include file="views/products/components/custom_components/product_assign_features_brand.tpl" product_features=$product_data.product_features}
{** Product 'Brand' copy from - Product features section **}





Finally, I stopped the original features field code (in product_assign_features.tpl) from displaying the Brand field because having 2 fields with the same name causes then to overwrite each other on the form post - or rather the last one’s (in terms of position on screen/in form) value is used. I just added a conditional statement to do this (!=“Brand”)







Wilbo.

What was the conditional statement you added?

Hi KG



The conditional was placed in the original product_assign_features.tpl after the != “G” (see below)




{foreach from=$product_features item=feature key="feature_id"}
{if $feature.feature_type != "G"}
{if $feature.description != "Brand"}







and then a {/if} in the right place at the bottom of the code block…



Let me know if you need any more info… by the way, this is obviously changing core CS-Cart template files which will get blatted during an upgrade I assume. So make sure you keep a note of all the files you change like this. Hope that’s not teaching you to suck eggs :slight_smile:



Wilbo