Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Hotclutch

Members
  • Posts

    2,621
  • Joined

  • Last visited

  • Days Won

    40

Posts posted by Hotclutch

  1. In the SQL installer, there are 2 php8 errors:

    Warning: Undefined array key "install"

      switch ($_GET['install']) {

    this is the section of code:

      switch ($_GET['install']) {
        case ('new'):
          install_ORP_to_sql();
          tep_redirect(tep_href_link($filename));
          break;
        case ('remove'):
          $group_id = get_group_id($contrib);
          remove_keys($group_id);
          remove_group_id($contrib);
          remove_table();
          tep_redirect(tep_href_link($filename));
          break;
        case ('upgrade'):
          $group_id = get_group_id($contrib);
          remove_keys($group_id);
          install_ORP_to_sql($group_id);
          tep_redirect(tep_href_link($filename));
          break;
      }

    And

    Fatal error: Uncaught TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, bool given in

    if (sizeof($group_id_array <= 1)) {
      function get_group_id($config_title) {
        $group_id_array = tep_db_fetch_array(tep_db_query("SELECT configuration_group_id FROM " . TABLE_CONFIGURATION_GROUP . " WHERE configuration_group_title like '". $config_title . "'"));	
        if (sizeof($group_id_array <= 1)) {
          return $group_id_array['configuration_group_id'];
        }
        remove_group_id($contrib);
        return 0;
      }

     

  2. Products.

        function execute() {
          global $PHP_SELF, $oscTemplate, $languages_id, $product_check;
    
          if (basename($PHP_SELF) == FILENAME_PRODUCT_INFO) {
            if (isset($_GET['products_id'])) {
              if ($product_check['total'] > 0) {
                $product_info_query = tep_db_query("select pd.products_name, pd.products_seo_title, pd.products_seo_description, pd.products_seo_keywords from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$_GET['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
                $product_info = tep_db_fetch_array($product_info_query);
    
    			  if (tep_not_null($product_info['products_seo_title'])) {	
                    $oscTemplate->setTitle($product_info['products_seo_title'] . ', ' . STORE_NAME);
    			  } else {
    				$oscTemplate->setTitle($product_info['products_name'] . ', ' . STORE_NAME);  
    			  }
    
    			  if ( tep_not_null($product_info['products_seo_description']) ) {
    			    $oscTemplate->addBlock('<meta name="description" content="' . tep_output_string($product_info['products_seo_description']) . '" />', $this->group);			    
    			  }
    			  if ( tep_not_null($product_info['products_seo_keywords']) ) {
    			    $oscTemplate->addBlock('<meta name="keywords" content="' . tep_output_string($product_info['products_seo_keywords']) . '" />', $this->group);
    			  }
              }
            }
          }
        }

     

  3. Manufacturers.

        function execute() {
          global $PHP_SELF, $oscTemplate, $languages_id;
    
          if (basename($PHP_SELF) == FILENAME_DEFAULT) {
            if (isset($_GET['manufacturers_id']) && is_numeric($_GET['manufacturers_id'])) {
    
                $manufacturers_query = tep_db_query("select m.manufacturers_name, mi.manufacturers_seo_title, mi.manufacturers_seo_description, mi.manufacturers_seo_keywords from " . TABLE_MANUFACTURERS . " m, " . TABLE_MANUFACTURERS_INFO . " mi where m.manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "' and mi.manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "' and mi.languages_id = '" . (int)$languages_id . "'");
    
                if (tep_db_num_rows($manufacturers_query)) {
                  $manufacturers = tep_db_fetch_array($manufacturers_query);
    
    			  if (tep_not_null($manufacturers['manufacturers_seo_title'])) {	
                    $oscTemplate->setTitle($manufacturers['manufacturers_seo_title'] . ', ' . STORE_NAME);
    			  } else {
    				$oscTemplate->setTitle($manufacturers['manufacturers_name'] . ', ' . STORE_NAME);  
    			  }
    
    			  if ( tep_not_null($manufacturers['manufacturers_seo_description']) ) {
    			    $oscTemplate->addBlock('<meta name="description" content="' . tep_output_string($manufacturers['manufacturers_seo_description']) . '" />', $this->group);			    
    			  }
    			  if ( tep_not_null($manufacturers['manufacturers_seo_keywords']) ) {
    			    $oscTemplate->addBlock('<meta name="keywords" content="' . tep_output_string($manufacturers['manufacturers_seo_keywords']) . '" />', $this->group);
    		      }		  
              }
            }
          }
        }

     

  4. Here is the code for Category SEO. It will add 1 query to every pageload. I will do another one each for manufacturers and products.

        function execute() {
          global $PHP_SELF, $oscTemplate, $current_category_id, $languages_id;
    
          if ( (basename($PHP_SELF) == 'index.php') && ($current_category_id > 0) ){
                $categories_query = tep_db_query("select categories_name, categories_seo_title, categories_seo_description, categories_seo_keywords from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$current_category_id . "' and language_id = '" . (int)$languages_id . "' limit 1");
                if (tep_db_num_rows($categories_query) > 0) {
                  $categories = tep_db_fetch_array($categories_query);
    			  if (tep_not_null($categories['categories_seo_title'])) {	
                    $oscTemplate->setTitle($categories['categories_seo_title'] . ', ' . STORE_NAME);
    			  } else {
    				$oscTemplate->setTitle($categories['categories_name'] . ', ' . STORE_NAME);  
    			  }
    
    			  if ( tep_not_null($categories['categories_seo_description']) ) {
    			    $oscTemplate->addBlock('<meta name="description" content="' . tep_output_string($categories['categories_seo_description']) . '" />', $this->group);			    
    			  }
    			  if ( tep_not_null($categories['categories_seo_keywords']) ) {
    			    $oscTemplate->addBlock('<meta name="keywords" content="' . tep_output_string($categories['categories_seo_keywords']) . '" />', $this->group);
    		  }
            }
          }
        }

     

  5. This contribution still appears to be working well, reporting on even php8 errors.

    However the installation might fail. In that case I found this replacement code to work:

    Follow the instructions in the package and when it comes time to amend functions/database.php, replace with:

      function tep_db_query($query, $link = 'db_link') {
        global $$link;
    
        if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) {
          error_log('QUERY ' . $query . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);
        }
        $start_time = microtime( true );
        $result = mysqli_query($$link, $query) or tep_db_error($query, mysqli_errno($$link), mysqli_error($$link));
        if ( class_exists( 'KissER' ) ) {
          KissER::q( round( ( microtime( true ) - $start_time ), 4 ), $query );
        }
        if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) {
           $result_error = mysqli_error();
           error_log('RESULT ' . $result . ' ' . $result_error . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);
        }
    
        return $result;
      } 

     

  6. https://www.dropbox.com/s/gccwpu7hpgtmm3z/Force Customer Country W3.zip?dl=0

    Force Customer Country

    Contribution Author: Olaf Larsson

    If you only operate in / ship to one country you might find this contribution useful. I have modified the files for:

    1) create_account.php

    2) includes/modules/address_book_details.php

    3) includes/modules/checkout_new_address.php

    Follow the instructions in the package.

    w3-1-min.png.32b636caca4f24b2c77da6e9dd9a889e.pngw3-2-min.png.6fa0113f30bc34d0020b3cbe92b8c9ba.pngw3-3-min.png.4cbac4af1b09b7886efe904bd1367066.pngw3-4-min.png.c048ccd00bef70e547304b3eabd68468.pngw3-5-min.png.f76742262bbb099b1c4dd691a682ae7c.pngw3-6-min.png.3510d66353f5d7a2f8b0acaa51bbc617.png

×
×
  • Create New...