Jump to content

KJ666

Members
  • Content count

    242
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by KJ666


  1. I have placed the order editter on my site but when i go to edit page i get this:

    Fatal error: Call to undefined function tep_get_categories_name() in /home/kjexotic/public_html/euro/includes/modules/shipping/rmsecondrec.php on line 85

     

    This is my rmsecondrec.php file

     

    <?php
    /*   $Id: Royal Mail Second Class Recorded by Stuart Newton 21 August 2006
     Demo: http://www.almatcomputers.co.uk
     Rates: .1:1.52,.25:1.77,.5:2.07,.75:2.45,1:2.8
     Limits Applied: 3.00Kg orders over this value will not be shown this method.
    */
    
    /*   
      Release date:  29th of May 2009
      Modified contribution by: Alexander Dimelow
      Email: customer.service@web-project.co.uk
      Website: http://oscommerce.web-project.co.uk
    */
    
     class rmsecondrec {
       var $code, $title, $description, $enabled, $num_zones;
    
    // class constructor
       function rmsecondrec() {
    global $order, $total_weight;
         $this->code = 'rmsecondrec';
         $this->title = MODULE_SHIPPING_RMSECONDREC_TEXT_TITLE;
         $this->description = MODULE_SHIPPING_RMSECONDREC_TEXT_DESCRIPTION;
         $this->sort_order = MODULE_SHIPPING_RMSECONDREC_SORT_ORDER;
         $this->icon = DIR_WS_ICONS . ''; // upload icon to catalog/images/icon directory
         $this->tax_class = MODULE_SHIPPING_RMSECONDREC_TAX_CLASS;
         $this->enabled = ((MODULE_SHIPPING_RMSECONDREC_STATUS == 'True') ? true : false);
         $this->num_zones = 1;
    
    
       }
    
    // class methods
       function quote($method = '') {
    global $cart, $order, $shipping_weight, $shipping_num_boxes;
         $dest_country = $order->delivery['country']['iso_code_2'];
         $dest_zone = 0;
         $error = false;
      	if ($order->delivery['country']['iso_code_2'] == 'GB')  {  // Only UK Customers to see shipping method. Hide everbody else.
             for ($i=1; $i<=$this->num_zones; $i++) {
             $countries_table = constant('MODULE_SHIPPING_RMSECONDREC_COUNTRIES_' . $i);
             $country_zones = split("[,]", $countries_table);
             if (in_array($dest_country, $country_zones)) {
               $dest_zone = $i;
               break;
             }
           }
    
         if ($dest_zone == 0) {
           $error = true;
         } else {
           $shipping = -1;
           $zones_cost = constant('MODULE_SHIPPING_RMSECONDREC_COST_' . $dest_zone);
    
           $zones_table = split("[:,]" , $zones_cost);
           $size = sizeof($zones_table);
           for ($i=0; $i<$size; $i+=2) {
             if ($shipping_weight <= $zones_table[$i]) {
               $shipping = $zones_table[$i+1];
    		if(tep_not_null($method) )
    		// Text shown on Checkout_Confirmation
    		$shipping_method = ''; // Leaving this entry blank causes only the shipping title to show i.e Royal Mail 1st Class Rec 	  
    		else
    		// Text shown on Checkout_shipping -  Delivery Weight : 0.7 Kg's (Ships normally within 1 to 3 days)
    		$shipping_method = MODULE_SHIPPING_RMSECONDREC_DELIVERY_TIMES; 
    		break;
             }
           }
    
           if ($shipping == -1) {
             $shipping_cost = 0;
             $shipping_method = MODULE_SHIPPING_RMSECONDREC_UNDEFINED_RATE;
           } else {
             $shipping_cost = ($shipping * $shipping_num_boxes) + constant('MODULE_SHIPPING_RMSECONDREC_HANDLING_' . $dest_zone);
           }
         }
    
    //extra
    
    		$cats_array = explode(',',MODULE_SHIPPING_RMSECONDREC_PER_CATS_CATEGORIES);
    		$cat_names = '';
    
    		for($i=0, $x=sizeof($cats_array); $i<$x; $i++){
    		     $cats_array[$i] = (int)$cats_array[$i];
              $cat_names .= tep_get_categories_name($cats_array[$i]).', ';
    		}
    
    		$cat_names = substr($cat_names, 0,-2);
    
    		 $pID_list = $cart->get_product_id_list();
    
    		 $pID_list = explode(',',$pID_list);
    			for($i=0, $x=sizeof($pID_list); $i<$x; $i++){
    			     $pID_list[$i] = (int)$pID_list[$i];
    			}
    			$pID_list = implode(',',$pID_list);
    
    		 if (MODULE_SHIPPING_RMSECONDREC_PER_CATS_ALL_OR_ONE == 'One'){
    		      $products = $cart->get_products();
    					for($i=0, $x=sizeof($products); $i<$x; $i++){
    									$check_query = tep_db_query('select * from '.TABLE_PRODUCTS_TO_CATEGORIES.' where categories_id in ('.implode(',',$cats_array).') and products_id="'.(int)$products[$i]['id'].'"');
    									if (tep_db_num_rows($check_query))
    									  $enable_rates = 1;
    					}
    		 } elseif (MODULE_SHIPPING_RMSECONDREC_PER_CATS_ALL_OR_ONE == 'All'){
    				 $count = 0;
    				for($i=0, $x=sizeof($cats_array); $i<$x; $i++){
    									$check_query = tep_db_query('select * from '.TABLE_PRODUCTS_TO_CATEGORIES.' where categories_id="'.$cats_array[$i].'" and products_id in ('.$pID_list.')');
    									if (tep_db_num_rows($check_query))
    											$count++;
    				}
    				if ($count == sizeof($cats_array))
    									  $enable_rates = 1;
    		 } else {
    		   $this->enabled = false;
    		   return false;
    		 }
    
    		 if ( MODULE_SHIPPING_RMSECONDREC_PER_CATS_ONLY_OR_ANY == 'Only' ){
    				$check_query = tep_db_query('select * from '.TABLE_PRODUCTS_TO_CATEGORIES.' where categories_id not in ('.MODULE_SHIPPING_RMSECONDREC_PER_CATS_CATEGORIES.') and products_id in ('.$pID_list.')');
    	      if (tep_db_num_rows($check_query))
    									  $enable_rates = 0;
    		 }
    
      //end extra
     if($enable_rates==1){
         $this->quotes = array('id' => $this->code,
                               'module' => MODULE_SHIPPING_RMSECONDREC_TEXT_TITLE,
                               'methods' => array(array('id' => $this->code,
                                                        'title' => $shipping_method,
                                                        'cost' => $shipping_cost)));
    
         if ($this->tax_class > 0) {
           $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
         }
    
         if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);
    
         if ($error == true) $this->quotes['error'] = MODULE_SHIPPING_RMSECONDREC_INVALID_ZONE;
    
         return $this->quotes;
    }
    }}
    
       function check() {
         if (!isset($this->_check)) {
           $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_RMSECONDREC_STATUS'");
           $this->_check = tep_db_num_rows($check_query);
         }
         return $this->_check;
       }
    
       function install() {
         tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Enable RM Second Class Recorded Postage', 'MODULE_SHIPPING_RMSECONDREC_STATUS', 'True', 'Do you want to offer this shipping option?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
    
         tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_RMSECONDREC_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
    
         tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_RMSECONDREC_SORT_ORDER', '4', 'Sort order of display (1 shown first 99 etc shown last to customer)', '6', '0', now())");
       tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Categories List', 'MODULE_SHIPPING_RMSECONDREC_PER_CATS_CATEGORIES', '', 'For what categories do you want to offer shipping?<br />NOTE! not recurcive - select all subcategories if you need it.', '6', '0', 'tep_cfg_show_multicategories', 'tep_cfg_select_multicategories(', now())");
         tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('All or One', 'MODULE_SHIPPING_RMSECONDREC_PER_CATS_ALL_OR_ONE', 'All', 'Do you want to offer a shipping for orders with products from all mentioned categories, or with at least from one of them?', '6', '0', 'tep_cfg_select_option(array(\'All\', \'One\'), ', now())");
         tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Only or Any', 'MODULE_SHIPPING_RMSECONDREC_PER_CATS_ONLY_OR_ANY', 'Only', 'Do you want to offer a shipping for orders with products only from mentioned categories, or with products from any categories (including mentioned)?', '6', '0', 'tep_cfg_select_option(array(\'Only\', \'Any\'), ', now())");
    
         for ($i = 1; $i <= $this->num_zones; $i++) {
           $default_countries = '';
           if ($i == 1) {
             $default_countries = 'GB';
           }
         tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('ISO Country Code', 'MODULE_SHIPPING_RMSECONDREC_COUNTRIES_" . $i ."', '" . $default_countries . "', 'Enter the two digit ISO code for which this shipping method applies too. (Default: GB)', '6', '0', now())");
    
      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('RM FSecond Class Recorded Rates', 'MODULE_SHIPPING_RMSECONDREC_COST_" . $i ."', '.1:1.52,.25:1.77,.5:2.07,.75:2.45,1:2.8', 'Enter values upto 5,2 decimal places. (12345.67) Example: .1:1,.25:1.27 - Weights less than or equal to 0.1Kg would cost £1.52, Weights less than or equal to 0.25g but more than 0.1Kg will cost £1.77. Do not enter KG or £ symbols.', '6', '0', now())");
           tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Packaging / Handling Fee', 'MODULE_SHIPPING_RMSECONDREC_HANDLING_" . $i."', '0', 'If you want to add extra costs to customers for jiffy bags etc, the cost can be entered below (eg enter 1.50 for a value of £1.50)', '6', '0', now())");
         }
       }
    
       function remove() {
         tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
       }
    
       function keys() {
         $keys = array('MODULE_SHIPPING_RMSECONDREC_STATUS', 'MODULE_SHIPPING_RMSECONDREC_TAX_CLASS', 'MODULE_SHIPPING_RMSECONDREC_SORT_ORDER', 'MODULE_SHIPPING_RMSECONDREC_PER_CATS_CATEGORIES', 'MODULE_SHIPPING_RMSECONDREC_PER_CATS_ALL_OR_ONE', 'MODULE_SHIPPING_RMSECONDREC_PER_CATS_ONLY_OR_ANY');
    
         for ($i=1; $i<=$this->num_zones; $i++) {
           $keys[] = 'MODULE_SHIPPING_RMSECONDREC_COUNTRIES_' . $i;
           $keys[] = 'MODULE_SHIPPING_RMSECONDREC_COST_' . $i;
           $keys[] = 'MODULE_SHIPPING_RMSECONDREC_HANDLING_' . $i;
         }
    
         return $keys;
       }
     }
    ?>

     

    The shipping i use is:

    http://addons.oscommerce.com/info/5979

     

     

    THe part of the code on that line is:

             $cat_names .= tep_get_categories_name($cats_array[$i]).', ';
    		}

     

    Any help on this ?


  2. I would like the sub-cats to show on this page:

    http://kjexotics.co.uk/euro/livestock-c-21.html'>http://kjexotics.co.uk/euro/livestock-c-21.html

     

    If you go to the home page:

    http://kjexotics.co.uk/euro

    You can see i have disabled this cat and placed it in the nav bar (but i need the sub-cats to show).

    Any more questions just ask (sorry i just didnt want my pages indexed by search engines) ?

     

    Plus i am trying to get rid of the gap on the left if you know how to do that?

    I have this code so far (i want the left to stay on every other page part from in this cat (21))

    <td class="left-column" width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

    <!-- left_navigation //--><?php

    if ($current_category_id != 21) require(DIR_WS_INCLUDES . 'column_left.php');

    ?>

    <!-- left_navigation_eof //-->

    </table></td>


  3. Having problems when I go back and edit a product:

    Is this just me, or are others having problems?

     

    Works correctly the first time- ie when put in as a new product

    eg: image uploaded from my computer goes to correct location:

    test_category/testcat_one/skin_1.jpg

     

    If I go back and edit that product, say the description, and leave image input box blank

    then preview is fine, but 'update' adds the folder names to its beginning (again)

    test_category/testcat_one/test_category/testcat_one/skin_1.jpg

     

    If I upload the image again from my computer it goes back to correct location

     

    If I write 'none' as the image filename everything updates OK

     

    There is a test for a null field in the update function, but somehow when the field is passed to the update function, it has something in it..

    the test is here:

     case 'updateproduct'
        if (isset($HTTP_POST_VARS['products_image']) && tep_not_null($HTTP_POST_VARS['products_image']) && ($HTTP_POST_VARS['products_image'] != 'none')) 

     

     

    I am also getting this problem along with the other one of not showing the images but was showing in the admin area when previewed but not again ??

    Used the fix still not a thing.


  4. I have the same problem as well admin/index.php is not the same as the one i have :S

     

    it says look for

     

    Look for

     

    $cat = array(array('title' => BOX_HEADING_CONFIGURATION,

     

     

    I dont have that, then it says

     

    Look for

     

    'image' => 'configuration.gif',

    'href' => tep_href_link(FILENAME_CONFIGURATION, 'selected_box=configuration&gID=1'),

    'children' => array(array('title' => BOX_CONFIGURATION_MYSTORE, 'link' => tep_href_link(FILENAME_CONFIGURATION, 'selected_box=configuration&gID=1')),

    array('title' => BOX_CONFIGURATION_LOGGING, 'link' => tep_href_link(FILENAME_CONFIGURATION, 'selected_box=configuration&gID=10')),

    array('title' => BOX_CONFIGURATION_CACHE, 'link' => tep_href_link(FILENAME_CONFIGURATION, 'selected_box=configuration&gID=11')))),

    array('title' => BOX_HEADING_MODULES,

     

    Guess what it not there :S

    Then it says:

    Look for

    'image' => 'modules.gif',

    'href' => tep_href_link(FILENAME_MODULES, 'selected_box=modules&set=payment'),

    'children' => array(array('title' => BOX_MODULES_PAYMENT, 'link' => tep_href_link(FILENAME_MODULES, 'selected_box=modules&set=payment')),

    array('title' => BOX_MODULES_SHIPPING, 'link' => tep_href_link(FILENAME_MODULES, 'selected_box=modules&set=shipping')))),

    array('title' => BOX_HEADING_CATALOG,

     

    Yet its not there ?

     

    I stoped when i got this far (tho i already instilledt the other files needed not on the stock osc, and the mysql file)

    Anybody know what is going on here ??


  5. Im looking for a paypal module i want to use the PayPal Website Payments Standard one.

     

    But my question is i have two shops so i want to use the same paypal account.

    But you have to put a redirect url in paypal so how do i get round this ??

    Anyone have a idea ?

    Kieron

×