Jump to content

[SOLVED] Remove "Must Have" Modules from List


Recommended Posts

  • 3 months later...
  • 6 months later...

Hi Vekia this is my code for Prestashop 1.5.6.2 can you tell me which line to edits because I also receive an error

i turned it on and i dont see error,

what error you see? can you show it please?

*}

{if count($modules)}

<table cellspacing="0" cellpadding="0" style="width: 100%; margin-bottom:10px;" class="table" id="">

  <thead>

   <tr class="nodrag nodrop">

    <th class="center">

     <input type="checkbox" rel="false" class="noborder" id="checkme"><br>

    </th>

    <th class="center"></th>

    <th>{l s='Module name'}</th>

    <th></th>

   </tr>  

  <tbody>

  {foreach from=$modules item=module}

   <tr>

    <td>

     {if (isset($module->id) && $module->id > 0) || !isset($module->type) || $module->type != 'addonsMustHave'}

     <input type="checkbox" name="modules" value="{$module->name}"

      {if !isset($module->confirmUninstall) OR empty($module->confirmUninstall)}rel="false"{else}rel="{$module->confirmUninstall|addslashes}"{/if}

      class="noborder">

     {/if}

    </td>

    <td><img class="imgm" alt="" src="{if isset($module->image)}{$module->image}{else}../modules/{$module->name}/{$module->logo}{/if}"></td>

    <td>

     <div class="moduleDesc" id="anchor{$module->name|ucfirst}" title="{$module->name}">

      <h3>{$module->displayName}<span style="display:none">{$module->name}</span>

       {if isset($module->type) && $module->type == 'addonsMustHave'}

        <span class="setup must-have">{l s='Must Have'}</span>

       {else}

        {if isset($module->id) && $module->id gt 0}

         <span class="setup{if isset($module->active) && $module->active eq 0} off{/if}">{l s='Installed'}</span>

        {else}

         <span class="setup non-install">{l s='Not installed'}</span>

        {/if}

       {/if}

      </h3>

      <div class="metadata">

       {if isset($module->author) && !empty($module->author)}

       <dl class="">

        <dt>{l s='Developed by'} :</dt>

        <dd>{$module->author|truncate:20:'...'}</dd>|

       </dl>

       {/if}

       <dl class="">

        <dt>{l s='Version'} :</dt>

        <dd>{$module->version}

         {if isset($module->version_addons)}({l s='Update'} {$module->version_addons} {l s='Available on PrestaShop Addons'}){/if}

        </dd>|

       </dl>

       <dl class="">

        <dt>{l s='Category'} :</dt>

        <dd>{$module->categoryName}</dd>

       </dl>

      </div>

      <p class="desc">{if isset($module->description) && $module->description ne ''}{l s='Description'} : {$module->description}{else} {/if}</p>

      {if isset($module->message) && (empty($module->name) === false) && (!isset($module->type) || ($module->type != 'addonsMustHave' || $module->type !== 'addonsNative'))}<div class="conf">{$module->message}</div>{/if}

      <div class="row-actions-module">

       {if !isset($module->not_on_disk)}

        {$module->optionsHtml}

        {if isset($module->preferences) && $module->preferences['favorite'] == 1}

         <a class="action_module action_unfavorite toggle_favorite" data-module="{$module->name}" data-value="0" href="#">{l s='Remove from Favorites'}</a>

         <a class="action_module action_favorite toggle_favorite" data-module="{$module->name}" data-value="1" href="#" style="display: none;">{l s='Mark as Favorite'}</a>

        {else}

         <a class="action_module action_unfavorite toggle_favorite" data-module="{$module->name}" data-value="0" href="#" style="display: none;">{l s='Remove from Favorites'}</a>

         <a class="action_module action_favorite toggle_favorite" data-module="{$module->name}" data-value="1" href="#">{l s='Mark as Favorite'}</a>

        {/if}

       {else}

         

       {/if}

      </div>

     </div>

    </td>

    <td>

     <ul id="list-action-button">

      {if isset($module->type) && $module->type == 'addonsMustHave'}

       <li>

        <a href="{$module->addons_buy_url}" target="_blank" class="button updated"><span><img src="../img/admin/cart_addons.png">  {if isset($module->id_currency) && isset($module->price)}{displayPrice price=$module->price currency=$module->id_currency}{/if}</span></a>

       </li>

      {else}

       {if isset($module->version_addons) && $module->version_addons}

        <li><a href="{$module->options.update_url}" class="button updated"><span>{l s='Update it!'}</span></a></li>

       {/if}

        <li>

         <a {if isset($module->id) && $module->id gt 0 && !empty($module->options.uninstall_onclick)}onclick="{$module->options.uninstall_onclick}"{/if} href="{if isset($module->id) && $module->id gt 0}{$module->options.uninstall_url}{else}{$module->options.install_url}{/if}" class="button installed">

          <span>{if isset($module->id) && $module->id gt 0}{l s='Uninstall'}{else}{l s='Install'}{/if}</span>

         </a>

        </li>

       {/if}

     </ul>

    </td>

   </tr>

  {/foreach}

  </tbody>

</table>

<div style="margin-top: 12px;">

  <input type="button" class="button big" value="{l s='Install the selection'}" onclick="modules_management('install')"/>

  <input type="button" class="button big" value="{l s='Uninstall the selection'}" onclick="modules_management('uninstall')" />

</div>

{else}

<div style="margin-top: 12px;color: #585A69;font-size: 16px;"><p align="center">{l s='No modules available in this section.'}</p></div>

{/if}

Link to comment
Share on other sites

Hi Vekia this is my code for Prestashop 1.5.6.2 can you tell me which line to edits because I also receive an error

*}

{if count($modules)}

<table cellspacing="0" cellpadding="0" style="width: 100%; margin-bottom:10px;" class="table" id="">

  <thead>

   <tr class="nodrag nodrop">

    <th class="center">

     <input type="checkbox" rel="false" class="noborder" id="checkme"><br>

    </th>

    <th class="center"></th>

    <th>{l s='Module name'}</th>

    <th></th>

   </tr>  

  <tbody>

  {foreach from=$modules item=module}

   <tr>

    <td>

     {if (isset($module->id) && $module->id > 0) || !isset($module->type) || $module->type != 'addonsMustHave'}

     <input type="checkbox" name="modules" value="{$module->name}"

      {if !isset($module->confirmUninstall) OR empty($module->confirmUninstall)}rel="false"{else}rel="{$module->confirmUninstall|addslashes}"{/if}

      class="noborder">

     {/if}

    </td>

    <td><img class="imgm" alt="" src="{if isset($module->image)}{$module->image}{else}../modules/{$module->name}/{$module->logo}{/if}"></td>

    <td>

     <div class="moduleDesc" id="anchor{$module->name|ucfirst}" title="{$module->name}">

      <h3>{$module->displayName}<span style="display:none">{$module->name}</span>

       {if isset($module->type) && $module->type == 'addonsMustHave'}

        <span class="setup must-have">{l s='Must Have'}</span>

       {else}

        {if isset($module->id) && $module->id gt 0}

         <span class="setup{if isset($module->active) && $module->active eq 0} off{/if}">{l s='Installed'}</span>

        {else}

         <span class="setup non-install">{l s='Not installed'}</span>

        {/if}

       {/if}

      </h3>

      <div class="metadata">

       {if isset($module->author) && !empty($module->author)}

       <dl class="">

        <dt>{l s='Developed by'} :</dt>

        <dd>{$module->author|truncate:20:'...'}</dd>|

       </dl>

       {/if}

       <dl class="">

        <dt>{l s='Version'} :</dt>

        <dd>{$module->version}

         {if isset($module->version_addons)}({l s='Update'} {$module->version_addons} {l s='Available on PrestaShop Addons'}){/if}

        </dd>|

       </dl>

       <dl class="">

        <dt>{l s='Category'} :</dt>

        <dd>{$module->categoryName}</dd>

       </dl>

      </div>

      <p class="desc">{if isset($module->description) && $module->description ne ''}{l s='Description'} : {$module->description}{else} {/if}</p>

      {if isset($module->message) && (empty($module->name) === false) && (!isset($module->type) || ($module->type != 'addonsMustHave' || $module->type !== 'addonsNative'))}<div class="conf">{$module->message}</div>{/if}

      <div class="row-actions-module">

       {if !isset($module->not_on_disk)}

        {$module->optionsHtml}

        {if isset($module->preferences) && $module->preferences['favorite'] == 1}

         <a class="action_module action_unfavorite toggle_favorite" data-module="{$module->name}" data-value="0" href="#">{l s='Remove from Favorites'}</a>

         <a class="action_module action_favorite toggle_favorite" data-module="{$module->name}" data-value="1" href="#" style="display: none;">{l s='Mark as Favorite'}</a>

        {else}

         <a class="action_module action_unfavorite toggle_favorite" data-module="{$module->name}" data-value="0" href="#" style="display: none;">{l s='Remove from Favorites'}</a>

         <a class="action_module action_favorite toggle_favorite" data-module="{$module->name}" data-value="1" href="#">{l s='Mark as Favorite'}</a>

        {/if}

       {else}

         

       {/if}

      </div>

     </div>

    </td>

    <td>

     <ul id="list-action-button">

      {if isset($module->type) && $module->type == 'addonsMustHave'}

       <li>

        <a href="{$module->addons_buy_url}" target="_blank" class="button updated"><span><img src="../img/admin/cart_addons.png">  {if isset($module->id_currency) && isset($module->price)}{displayPrice price=$module->price currency=$module->id_currency}{/if}</span></a>

       </li>

      {else}

       {if isset($module->version_addons) && $module->version_addons}

        <li><a href="{$module->options.update_url}" class="button updated"><span>{l s='Update it!'}</span></a></li>

       {/if}

        <li>

         <a {if isset($module->id) && $module->id gt 0 && !empty($module->options.uninstall_onclick)}onclick="{$module->options.uninstall_onclick}"{/if} href="{if isset($module->id) && $module->id gt 0}{$module->options.uninstall_url}{else}{$module->options.install_url}{/if}" class="button installed">

          <span>{if isset($module->id) && $module->id gt 0}{l s='Uninstall'}{else}{l s='Install'}{/if}</span>

         </a>

        </li>

       {/if}

     </ul>

    </td>

   </tr>

  {/foreach}

  </tbody>

</table>

<div style="margin-top: 12px;">

  <input type="button" class="button big" value="{l s='Install the selection'}" onclick="modules_management('install')"/>

  <input type="button" class="button big" value="{l s='Uninstall the selection'}" onclick="modules_management('uninstall')" />

</div>

{else}

<div style="margin-top: 12px;color: #585A69;font-size: 16px;"><p align="center">{l s='No modules available in this section.'}</p></div>

{/if}

 

but what error you see? 

Link to comment
Share on other sites

  • 2 months later...

Hello!

 

I'm obtain next error:

Notice on line 68 en archivo /Applications/MAMP/htdocs/cache/smarty/compile/c8/1c/2d/c81c2dc0877b1339045e1bfa486361edfaa92789.file.list.tpl.php
[8] Undefined property: stdClass::$type

On 1.6.0.9 version... ¡¿?!

 

Thanks!

 

This works for me on 1.6.0.9 without the undefined property warning (nearly line 49):

...
{foreach from=$modules item=module} 
  {capture name="moduleStatutClass"}{if isset($module->id) && $module->id gt 0 && $module->active == 1}module_active{else}module_inactive{/if}{/capture}

  {* here the full Smarty condition *}
  {if (isset($module->id) && $module->id > 0) || !isset($module->type) || ($module->type != 'addonsNative' && $module->type != 'addonsPartner' && $module->type != 'addonsMustHave')} 
  <tr>
...
Don't forget the closing {/if}

I can see clearly now...

 

Edited by Pluncker (see edit history)
  • Like 1
Link to comment
Share on other sites

It's just your modification of ADMIN_DIR/themes/default/template/controllers/modules/list.tpl (found in http://mypresta.eu/en/art/developer/hide-must-have-modules-on-addons-list.html), where I replaced

 

{if $module->type != 'addonsMustHave'}

with

{if (isset($module->id) && $module->id > 0) || !isset($module->type) || ($module->type != 'addonsNative' && $module->type != 'addonsPartner' && $module->type != 'addonsMustHave')}

Edited by Pluncker (see edit history)
  • Like 1
Link to comment
Share on other sites

It's just your modification of ADMIN_DIR/themes/default/template/controllers/modules/list.tpl (found in http://mypresta.eu/en/art/developer/hide-must-have-modules-on-addons-list.html), where I replaced

 

{if $module->type != 'addonsMustHave'}

with

{if (isset($module->id) && $module->id > 0) || !isset($module->type) || ($module->type != 'addonsNative' && $module->type != 'addonsPartner' && $module->type != 'addonsMustHave')}

 

¡Yes! ¡Works!

 

Thanks!

 

:)

Link to comment
Share on other sites

  • 1 month later...

Hi Vekia,

I meant paid modules from PS adds sugested on the nodules list.

 

On PS 1.5 I disabled those modules by deleting one of xml files (must_have_modules_list.xml in /config/xml/).

When paid modules from prestashop adds are excluded from modules list, my store BO is 100 times faster. I can make operation on modules quickly.

 

On PS1.6 if I delete this xml file, it gets recreated instantly.

Also any operation on modules list takes AGES (2 minutes just to show modules list on BO Modules tab).

 

So I am looking for the way to disable those paid modules from the list on PS 1.6.0.11.

 

Hint: disconnecting from prestashop adds on BO user settings page doesnt make any difference. Any operation on modules list takes 2-3 minutes to complete....

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

  • 4 months later...
  • 2 weeks later...
  • 1 year later...

Hi Vekia,

 

 I use this coding

    {if count($modules)}
    
        <tbody>
            {foreach from=$modules item=module}

 

                {if $module->type != 'addonsNative'}
                {if $module->type != 'addonsMustHave'}
                {if $module->type != 'addonsPartner'}

                .............................

......................

               
                {/if}
                {/if}
                {/if}
            {/foreach}
        </tbody>

 

 module folder module only show

 

Thanks

Link to comment
Share on other sites

  • 6 months later...

 

This works for me on 1.6.0.9 without the undefined property warning (nearly line 49):

...
{foreach from=$modules item=module} 
  {capture name="moduleStatutClass"}{if isset($module->id) && $module->id gt 0 && $module->active == 1}module_active{else}module_inactive{/if}{/capture}

  {* here the full Smarty condition *}
  {if (isset($module->id) && $module->id > 0) || !isset($module->type) || ($module->type != 'addonsNative' && $module->type != 'addonsPartner' && $module->type != 'addonsMustHave')} 
  <tr>
...
Don't forget the closing {/if}

I can see clearly now...

 

 

Pluncker solution worked for me, in 1.6.1.7  thankyou!

Link to comment
Share on other sites

×
×
  • Create New...