Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Dynamic Template System


AdmiralRedBeard

Recommended Posts

Hi,

 

I added the Dynamic Template System on my oscommerce 2.3.4 shop. In the admin portal the module boxes do not include the option to select what pages to display on. There is one update that I do not know where to place the code. The code is from the 2.2 update addon by Gyakutsuki.Can someone help me with this install?

Link to comment
Share on other sites

Here is a correction to my earlier posting:

 

Some module boxes have the page selection capability and some do not. The ones that I have active do not have the functionality. However they do display correctly on each page just as they did prior to the install.

 

Still do not know where to apply the code change for V2.2.

 

Any help would be greatly appreciated.

 

Thank You.

Link to comment
Share on other sites

This is script pb, try this.

 

 

 

// Alias function for module [boxes] configuration value
// template system  
  function tep_cfg_select_pages($key_value, $key = '') {
    $name = ((tep_not_null($key)) ? 'configuration[' . $key . '][]' : 'configuration_value');
    $select_array = tep_list_catalog_files();
    sort($select_array);


    $selected_array = explode(';', $key_value);


    if($key_value === 'all') { 
      $checkall = "CHECKED"; 
    } else { 
      $checkall = "UNCHECKED"; 
    }


      $string = '<fieldset>';    
      $string .= '<input type="radio" class="AllPages"  name="' . $name . '" value="all" ' . $checkall . ' />' . ALL_PAGES . '<br />';
      $string .= '<p><strong>  ' . ONE_BY_ONE . '</strong><br />';
      $string .= '<input type="checkbox" id="CheckAll" class="CheckAll" name="CheckAll" /><label id="CheckAllLabel" for="CheckAll">' . CHECK_ALL . '</label></p>';


      for ($i=0, $n=sizeof($select_array); $i<$n; $i++) {
        $string .= '  <input type="checkbox" id="file_' . $i . '" class="ThisPage" name="' . $name . '" value="' . $select_array[$i] . ';"';
        if ( isset($selected_array) ) {
          foreach($selected_array as $value) {
            if ($select_array[$i] == $value) $string .= ' CHECKED';
          }
        }
        $string .= '><label class="ThisPage" for="file_' . $i . '">' . $select_array[$i] . '</label><br />';
      }
      $string .= '</fieldset>';
      $string .= "<script type=\"text/javascript\">
  jQuery(document).ready(function () {
    $('.AllPages').click(
      function() {
        $('.ThisPage').prop('checked', false);
        $('.CheckAll').prop('checked', false);
        $('#CheckAllLabel').text('" . CHECK_ALL . "');
      }
    );
    $('.CheckAll').click(
      function () {
        $(this).parents('fieldset:eq(0)').find(':checkbox').prop('checked', this.checked);
        $('.AllPages').prop('checked', (!this.checked));
        if (this.checked) {
          $('#CheckAllLabel').text('" . DESELECT_ALL . "');
        } else {
          $('#CheckAllLabel').text('" . CHECK_ALL . "');
        }
      }
    );
    $('.ThisPage').click(
      function() {
        var n = $( \"input.ThisPage:checked\" ).length;
        if (n >0) {
          $('.AllPages').prop('checked', false);
        } else {
          $('.AllPages').prop('checked', true);
        }
      }
    );
  });
</script>";
      return $string;
  }


Regards
-----------------------------------------
Loïc

Contact me by skype for business
Contact me @gyakutsuki for an answer on the forum

 

Link to comment
Share on other sites

  • 5 months later...

hi,

 

there is a mistyping on 20131209 download install.txt

$exclude = array(edirect.php',

 

However when I tried this, i have an fatal error message as below:

Call to undefined function tep_cfg_select_pages() in /modules.php(261) : eval()'d code on line 1

 

module.php line 261 code is as below:

 eval('$keys .= ' . $value['set_function'] . "'" . $value['value'] . "', '" . $key . "');"); 

 

 

then I tried the script you post on this thread

Posted 23 November 2014 - 00:06

 

this time the error message is as below:

Fatal error: Call to undefined function tep_list_catalog_files() in admin/includes/functions/general.php on line 1570

 

general.php line 1570 code as below:

 $select_array = tep_list_catalog_files(); 

 

 

any suggestion?

 

Thanks

 

Lyn

Link to comment
Share on other sites

tep_list_catalog_files() function need to add into general.php. You should find it in the full package or an earlier zip.

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...