Jump to content

Upgrade Notification - Add Admin Fields


Claudia M

Recommended Posts

My admin is not telling me an upgrade is available on the dashboard or in maintenance.  Nor is it showing recent marketplace extensions.  The only way I knew was by going to this forum and my other store.

 

Also, in looking at this post Additional Field Similar to Cubecart in the Skin and Templating forum I have some questions regarding how I added my additional fields.  If it's not the correct way to do it, now is the time to rectify it as the code has to be modified when I upgrade.  Here is basically what I did, without going into much detail.

 

1.  Created the following in the inventory database - one each for item age, item size, item mfg, item location:

 

Type:  varchar (30)  See Above

collaltion: ut8_unicode_ci

Null:  no

Default:  none

Attributes:  Blank

 

2.  In the file /admin/sources/products.index.inc.php I added the following after 'translations' => $lang['translate']['title_translations'],

 

           'item_age' => "Item Age",

           'item_size' => "Item Size",

           'item_mfg' => "Item Mfg",

           'item_location' => "Item Location",

 

3.  In the file /admin/skins/default/template/products.index.php I added the following after <th nowrap="nowrap">{$THEAD.updated}</th>

<th nowrap="nowrap">{$THEAD.item_location}</th>

 

4.  Since I don't use the translation column, I made the following changes:

<td align="center">

{foreach from=$product.translations item=translation}

  <a href="{$translation.link}"><img src="language/flags/{$translation.language}.png" alt="{$translation.language}" /></a>

{/foreach}

</td>

 

I Changed to:

<td align="center">{$product.item_location}</td>

<td align="center">{$product.product_weight}</td>

 

5. Changed a couple of Colspan to fix code change

6.  Below

<div><label for="product_code">{$LANG.catalogue.product_code}</label><span><input name="product_code" id="product_code" class="textbox" type="text" value="{$PRODUCT.product_code}"></span></div>

         <div><label for="product_code_auto">{$LANG.catalogue.product_code_auto}</label><span><input name="product_code_auto" id="product_code_auto" type="hidden" class="toggle" {$PRODUCT.auto_code_checked}> <input name="product_code_old" id="product_code_old" type="hidden" value=""> </span></div>

 

I added: ( And changed maxlength for some )

<div><label for="item_age">Item Age</label><span><input name="item_age" id="item_age" class="textbox" type="text" value="{$PRODUCT.item_age}" maxlength="30" ></span></div>

<div><label for="item_size">Item Size</label><span><input name="item_size" id="item_size" class="textbox" type="text" value="{$PRODUCT.item_size}" maxlength="50" ></span></div>

<div><label for="item_mfg">Item Mfg</label><span><input name="item_mfg" id="item_mfg" class="textbox" type="text" value="{$PRODUCT.item_mfg}" maxlength="50" ></span></div>

 <div><label for="item_location">Item Location</label><span><input name="item_location" id="item_location" class="textbox" type="text" value="{$PRODUCT.item_location}" maxlength="30" /></span></div>

   <div><label for="product_weight">{$LANG.catalogue.product_weight}</label><span><input name="product_weight" id="product_weight" class="textbox number" type="text" value="{$PRODUCT.product_weight}"></span></div>

 

7.  Finally I moved this no longer used section:

<div>

            <label for="manufacturer">{$LANG.catalogue.title_manufacturer}</label>            <span>

               <select name="manufacturer" id="manufacturer" class="textbox" type="text">

                  <option value="">{$LANG.form.none}</option>

                  {foreach from=$MANUFACTURERS item=manufacturer}

                  <option value="{$manufacturer.id}"{$manufacturer.selected}>{$manufacturer.name}</option>

                  {/foreach}

               </select>

            </span>

         </div>

         <div><label for="condition">{$LANG.catalogue.condition}</label>

            <span>

            <select name="condition" id="condition" class="textbox" type="text">

            <option value="new" {if $PRODUCT.condition == 'new'}selected="selected"{/if}>{$LANG.catalogue.condition_new}</option>

            <option value="used" {if $PRODUCT.condition == 'used'}selected="selected"{/if}>{$LANG.catalogue.condition_used}</option>

            <option value="refurbished" {if $PRODUCT.condition == 'refurbished'}selected="selected"{/if}>{$LANG.catalogue.condition_refurbished}</option>

            </select>

            </span>

         </div>

 

To just above this as all these fields are not used

 <div><label for="upc_code">{$LANG.catalogue.product_upc}</label><span><input name="upc" id="upc" class="textbox" type="text" value="{$PRODUCT.upc}" maxlength="20"></span></div>

 

Is all this okay or should I have done it differently?

Thanks in advance for any and all help

Claudia

Link to comment
Share on other sites

That works fine.

One other consideration is that, to remind your self of what was deleted (or changed from), you can delineate the section in template comments:

{*
The template code that you do not want to appear in the rendered output.
But it is here to remind you what you did and why.
*}

 

Link to comment
Share on other sites

I ALWAYS comment before and after edits with enough info to know why I did it.

So how about not seeing the update message or the new file extension section?

Have you edited the dashboard source and file for any reason?

Do you use any kind of file compare software that would let you see what the difference is in the admin that is working properly and the one that is not?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...