Jump to content

 

ameerme90

Member Since 26 Jun 2018
Offline Last Active Dec 12 2018 10:26 PM
-----

#305293 Hide Some Fields From Vendors

Posted by ameerme90 on 14 August 2018 - 10:16 AM

Hello!

 

First try to edit the design/backend/templates/views/products/update.tpl file itself. If it is not changed after clearing cache, then look for the add-ons that can override this file.

 

For example, availability section looks like this (I do not now your version but it should be similar):

{include file="common/subheader.tpl" title=__("availability") target="#acc_availability"}
<div id="acc_availability" class="collapse in">
    {if !"ULTIMATE:FREE"|fn_allowed_for}
        <div class="control-group">
            <label class="control-label">{__("usergroups")}:</label>
            <div class="controls">
                {include file="common/select_usergroups.tpl" id="ug_id" name="product_data[usergroup_ids]" usergroups=["type"=>"C", "status"=>["A", "H"]]|fn_get_usergroups:$smarty.const.DESCR_SL usergroup_ids=$product_data.usergroup_ids input_extra="" list_mode=false}
            </div>
        </div>
    {/if}

    <div class="control-group">
        <label class="control-label" for="elm_date_holder">{__("creation_date")}:</label>
        <div class="controls">
            {include file="common/calendar.tpl" date_id="elm_date_holder" date_name="product_data[timestamp]" date_val=$product_data.timestamp|default:$smarty.const.TIME start_year=$settings.Company.company_start_year}
        </div>
    </div>

    <div class="control-group">
        <label class="control-label" for="elm_date_avail_holder">{__("available_since")}:</label>
        <div class="controls">
            {include file="common/calendar.tpl" date_id="elm_date_avail_holder" date_name="product_data[avail_since]" date_val=$product_data.avail_since|default:"" start_year=$settings.Company.company_start_year}
        </div>
    </div>

    <div class="control-group">
        <label class="control-label" for="elm_out_of_stock_actions">{__("out_of_stock_actions")}:</label>
        <div class="controls">
            <select class="span3" name="product_data[out_of_stock_actions]" id="elm_out_of_stock_actions">
                <option value="N" {if $product_data.out_of_stock_actions == "N"}selected="selected"{/if}>{__("none")}</option>
                <option value="B" {if $product_data.out_of_stock_actions == "B"}selected="selected"{/if}>{__("buy_in_advance")}</option>
                <option value="S" {if $product_data.out_of_stock_actions == "S"}selected="selected"{/if}>{__("sign_up_for_notification")}</option>
            </select>
        </div>
    </div>
</div>

And you need to change it by adding condition like this:

{if $smarty.const.ACCOUNT_TYPE != 'vendor'}
    {include file="common/subheader.tpl" title=__("availability") target="#acc_availability"}
    <div id="acc_availability" class="collapse in">
        {if !"ULTIMATE:FREE"|fn_allowed_for}
            <div class="control-group">
                <label class="control-label">{__("usergroups")}:</label>
                <div class="controls">
                    {include file="common/select_usergroups.tpl" id="ug_id" name="product_data[usergroup_ids]" usergroups=["type"=>"C", "status"=>["A", "H"]]|fn_get_usergroups:$smarty.const.DESCR_SL usergroup_ids=$product_data.usergroup_ids input_extra="" list_mode=false}
                </div>
            </div>
        {/if}

        <div class="control-group">
            <label class="control-label" for="elm_date_holder">{__("creation_date")}:</label>
            <div class="controls">
                {include file="common/calendar.tpl" date_id="elm_date_holder" date_name="product_data[timestamp]" date_val=$product_data.timestamp|default:$smarty.const.TIME start_year=$settings.Company.company_start_year}
            </div>
        </div>

        <div class="control-group">
            <label class="control-label" for="elm_date_avail_holder">{__("available_since")}:</label>
            <div class="controls">
                {include file="common/calendar.tpl" date_id="elm_date_avail_holder" date_name="product_data[avail_since]" date_val=$product_data.avail_since|default:"" start_year=$settings.Company.company_start_year}
            </div>
        </div>

        <div class="control-group">
            <label class="control-label" for="elm_out_of_stock_actions">{__("out_of_stock_actions")}:</label>
            <div class="controls">
                <select class="span3" name="product_data[out_of_stock_actions]" id="elm_out_of_stock_actions">
                    <option value="N" {if $product_data.out_of_stock_actions == "N"}selected="selected"{/if}>{__("none")}</option>
                    <option value="B" {if $product_data.out_of_stock_actions == "B"}selected="selected"{/if}>{__("buy_in_advance")}</option>
                    <option value="S" {if $product_data.out_of_stock_actions == "S"}selected="selected"{/if}>{__("sign_up_for_notification")}</option>
                </select>
            </div>
        </div>
    </div>
{/if}

And modify all necessary fields this way.

Its work thank you.

i dont now how to thank you but i will wish from god to make your life great.

thanks