Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

bobsi18

Pioneers
  • Posts

    436
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by bobsi18

  1. Oh and another thing, I dun have a send voucher link on the right column even after I have send out the coupon in the admin panel. I tried sending the voucher manually thru the send voucher option in account page but it gave an "invalid amount" error.

     

    thks for any help in advance (",)

    Please - what was the solution????

     

    I have 4 gift vouchers set up as $10, $25, $50 and $100. I entered the prices in without tax (10%), so the prices are $9.0909, $22.7272, $45.4545 and $90.0909. When I use the 'send gift voucher' button from my account page (as a customer), I am able to send a $25 voucher, but I can't send any of the others, I get an error saying 'Invalid amount'. I think it's a rounding error, as I tried sending 9.99 (instead of $10) and it worked. So does anyone know how I can get this working?

     

    Thanks :)

    ~bobsi18~

  2. hi everyone... nearly there with my store :)

     

    one thing that i was thinking would be fantastic and make operation better:

     

    I have the New attibute manager installed. whenever I edit a products' attributes, I goto the product, click 'edit attributes' and i'm given a page full of all possible attributes, where I can edit options and prices.

     

    We often have green sold out but not red, or no Size Large left, but Size Small still in stock. So this screen will be used alot when updating stock. What I'm thinking is that it would be great to have an 'out of stock' field that will tack onto the end of the products table. This field will be editable from the attributes page. The results of the field will just be echo'd on the product_info page in the catalog.

     

    I've been fooling around, and can get an 'in stock' field working from the main categories.php page, but not from the new_attributes.php page.

     

    Does anyone have any pointers? I'd be really appreciative!!!

     

    Thanks,

    ~bobsi18~

  3. Hi, I installed last 0.54 version and the "Automatic update of subscribers_table" modification from anorakgirl. almost everything seems to work fine but if I unregister a user in the admin then, create a new mail, when I go back to the "subscribers manager", the unregistered users a registered again. it looks like the synchronisation system overrides the "subscribed newsletter" flag.

     

    I modified the tep_set_newsletter_status function like this to solve my problem. hope it helps :

     

      function tep_set_newsletter_status($subscribers_id, $status) {
    
    	$select_str = "select p.customers_id ";
    	$from_str .= "from " . TABLE_SUBSCRIBERS . " p ";
    	$where = "where p.subscribers_id=" .(int)$subscribers_id;
    	$listing_sql = $select_str . $from_str . $where;
    	$listing = tep_db_query($listing_sql);
    
    	if (tep_db_num_rows($listing)) {
    		$listing_values = tep_db_fetch_array($listing);
    		$customer_id = $listing_values['customers_id'];
    	}
    
    if ($status == '1') {
    		if ($customer_id != 0) {
    				$maj_customer =  tep_db_query("update " . TABLE_CUSTOMERS . " set customers_newsletter = '1' where customers_id = '" . (int)$customer_id . "'");
    		}
      return tep_db_query("update " . TABLE_SUBSCRIBERS . " set customers_newsletter = '1' where subscribers_id = '" . (int)$subscribers_id . "'");
    } elseif ($status == '0') {
    	if ($customer_id != 0) {
    			$maj_customer =  tep_db_query("update " . TABLE_CUSTOMERS . " set customers_newsletter = '0' where customers_id = '" . (int)$customer_id . "'");
    	}
      return tep_db_query("update " . TABLE_SUBSCRIBERS . " set customers_newsletter = '0' where subscribers_id = '" . (int)$subscribers_id . "'");
    } else {
      return -1;
    }
     }

     

    Hi - I'm having a similar problem, if I change the status in admin, then update the table, it goes back to what it was. I found your post, but I don't understand where you've added/modified the code? what file is it?

     

    Thanks!

     

    ~bobsi18~

  4. I had directly installed Felix's "Specials Valid From" Contribution without error or incident.

     

    What kind of problems are you having?

     

    Becasue I ran his SQL query in the install.txt file and uploaded the files as they were and had no issues.

    The main problem I had was when a special is modified, it doesn't save the modification and it enters a new special into the database with products_id = 0. This means that everything in my store changes it's price to this new special's... I wrote about it here (other people were having problems too)-->http://www.oscommerce.com/forums/index.php?sho...45entry865545

     

    ~bobsi18~

  5. Stew,

     

    I cleaned up login.php. I was able to remove about 1/3 of the code to make it simpler. I separated the three boxes (Checkout, New Customer and Login) so they are not all connected together. I reordered the boxes so that Login is first, New Customer is second and PWA Checkout is last since eveyone wants customers to create an account if possible. Lastly, I was able to integrate the Credit Class/Gift Vouchers/Discount Coupons (CCVG v5.13) into my site that has PWA installed. I put in a code snippet that prevents a PWA purchase when a Gift Voucher is in the cart since CCVG requires an account to function. I bolded this code so that it could easily be removed below. I thought that if you like most of these changes, you could incorporate them in your next version if you wish.

    ...

    Thanks :thumbsup: :thumbsup: :thumbsup:

  6. I have downloaded this contribution (Australian Shipping Zones and Country Mod

    http://www.oscommerce.com/community/contributions,696) to enable Australian and Internation shipping rates on my site.

    Instructions were to upload the auspost.php file to catalog/includes/modules/shipping or rather it said to just replace the file. I didn't have an auspost.php file in that folder to start with so I just uploaded it.

    When I go to the modules section of the admin, I get the following warning message:

     

    Warning: main(/var/www/html/catalog/includes/languages/english/modules/shipping/auspost.php): failed to open stream: No such file or directory in /var/www/html/catalog/admin/modules.php on line 128

     

    Warning: main(): Failed opening '/var/www/html/catalog/includes/languages/english/modules/shipping/auspost.php' for inclusion (include_path='.:/php/includes:/usr/share/php') in /var/www/html/catalog/admin/modules.php on line 128

    The module appears on the page but I have not clicked install yet as obviously there is a problem.

     

    Can anyone help?

     

    David

    I'm sorry 2 say that I don't understand the warning messages, but whenever I get warning messages like that after installing a contribution, I check:

    - that the files are actually there - i.e. goto /var/www/html/catalog/includes/languages/english/modules/shipping/auspost.php and check the file exists (doesn't normally happen, but every now and again I just forget to upload one of the files

    - this one happens the most - it often turns out to be the permissions on the files are wrong - if the file is there, check the permissions on it, they should be the same for most of the other files near it

     

    HTH ~bobsi18~

  7. PLease Disregard the previous post, as the updated (and complete version has been uploaded to the contributions section.

     

    http://www.oscommerce.com/community/contributions,4325

     

    PLEASE USE THE V.2.0 DOWNLOAD

    Hi there...

    Great idea - I was just wondering if you made any changes to Felix Shcwarts' "Specials Valid From" contrib, because I recently tried to install it and had a heap of probs... Willing to give it another go if you thik it's working ok, I just couldn't get any response from the forums about whether or not someone had it working on their site.

     

    ~bobsi18~

  8. Please please help me... I've been working on this one for 3 days straight, starting to see things...

     

    I've created an extra manufactureer ('manufacturers2'), by copying all code related to manufacturers (and setting up the required tables etc). And have been relatively successful. The last place that I'm trying to integrate the 2nd manufacturer is on the index.php page - i want

    a) to have a second drop down list for manufacturers2 (just like the one already there for the original manufacturer)

    b ) both manufacturers pages to be filtered by category AND manufacturer/manufacturers2 (whatever isn't currently selected) (osCommerce currently filters by category only)

    c) to be able to filter any particular category by manufacturer AND manufacturer2 (currently oscommerce allows filtering by the on manufacturer)...

     

    All this stuff is done on the index.php page.

     

    What I have working:

    a) I have the second drop down list, this works well

    b ) I have the drop down list for the category/manufacturers filter on the manufacturers page displaying - although only the categories data is filled in, the manufacturers data is not there

    c) I have the drop down lists showing up on the categories pages. They are filled with the right names. The do not, however, do the filter correctly.

     

    PLEASE PLEASE PLEASE help me :) I have been trying for so long (and don't worry, I'll keep trying :)) - I would love some help, particularily if someone's already done something like this.

     

    Thankyou soooooo much

    ~bobsi18~

     

    CODE FROM INDEX.PHP (from about line 162, note that it isn't a vanilla install, there are other contributions in there too :))

    SQL
    <?php

    } elseif ($category_depth == 'products' || isset($HTTP_GET_VARS['manufacturers_id'])) {

    // create column list

    $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,

    'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,

    'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,

    'PRODUCT_LIST_MANUFACTURERS2' => PRODUCT_LIST_MANUFACTURERS2,

    'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,

    'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,

    'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,

    'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,

    //bof column product listing with attributes

    'PRODUCT_LIST_MULTIPLE' => PRODUCT_LIST_MULTIPLE,

    'PRODUCT_LIST_BUY_NOW_MULTIPLE' => PRODUCT_LIST_BUY_NOW_MULTIPLE,

    //eof column product listing with attributes

    'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);

     

    asort($define_list);

     

    $column_list = array();

    reset($define_list);

    while (list($key, $value) = each($define_list)) {

    if ($value > 0) $column_list[] = $key;

    }

     

    // BOF Separate Pricing Per Customer

    if(!tep_session_is_registered('sppc_customer_group_id')) {

    $customer_group_id = '0';

    } else {

    $customer_group_id = $sppc_customer_group_id;

    }

    // this will build the table with specials prices for the retail group or update it if needed

    // this function should have been added to includes/functions/database.php

    if ($customer_group_id == '0') {

    tep_db_check_age_specials_retail_table();

    }

    $status_product_prices_table = false;

    $status_need_to_get_prices = false;

     

    // find out if sorting by price has been requested

    if ( (isset($HTTP_GET_VARS['sort'])) && (ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) && (substr($HTTP_GET_VARS['sort'], 0, 1) <= sizeof($column_list)) && $customer_group_id != '0' ){

    $_sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);

    if ($column_list[$_sort_col-1] == 'PRODUCT_LIST_PRICE') {

    $status_need_to_get_prices = true;

    }

    }

     

    if ($status_need_to_get_prices == true && $customer_group_id != '0') {

    $product_prices_table = TABLE_PRODUCTS_GROUP_PRICES.$customer_group_id;

    // the table with product prices for a particular customer group is re-built only a number of times per hour

    // (setting in /includes/database_tables.php called MAXIMUM_DELAY_UPDATE_PG_PRICES_TABLE, in minutes)

    // to trigger the update the next function is called (new function that should have been

    // added to includes/functions/database.php)

    tep_db_check_age_products_group_prices_cg_table($customer_group_id);

    $status_product_prices_table = true;

     

    } // end if ($status_need_to_get_prices == true && $customer_group_id != '0')

    // EOF Separate Pricing Per Customer

     

    $select_column_list = '';

     

    for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {

    if ( ($column_list[$col] == 'PRODUCT_LIST_BUY_NOW') || ($column_list[$col] == 'PRODUCT_LIST_PRICE') ) {

    continue;

    }

    switch ($column_list[$i]) {

    case 'PRODUCT_LIST_MODEL':

    $select_column_list .= 'p.products_model, ';

    break;

    case 'PRODUCT_LIST_NAME':

    $select_column_list .= 'pd.products_name, ';

    break;

    case 'PRODUCT_LIST_MANUFACTURER':

    $select_column_list .= 'm.manufacturers_name, ';

    break;

    case 'PRODUCT_LIST_MANUFACTURERS2':

    $select_column_list .= 'm2.manufacturers2_name, ';

    break;

    case 'PRODUCT_LIST_QUANTITY':

    $select_column_list .= 'p.products_quantity, ';

    break;

    case 'PRODUCT_LIST_IMAGE':

    $select_column_list .= 'p.products_image, ';

    break;

    case 'PRODUCT_LIST_WEIGHT':

    $select_column_list .= 'p.products_weight, ';

    break;

    }

    }

     

    // show the products of a specified manufacturer

    if (isset($HTTP_GET_VARS['manufacturers_id'])) {

    if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {

    // We are asked to show only a specific category

    // BOF Separate Pricing Per Customer

    if ($status_product_prices_table == true) {

    // DONE ################## Added Enable Disable Categorie #################

    //$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id] . "'";

    $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.manufacturers2_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_MANUFACTURERS . " m, " . TABLE_MANUFACTURERS2 . " m2, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_CATEGORIES . " c on p2c.categories_id = c.categories_id where c.categories_status = '1' and p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id] . "' and p.manufacturers2_id = m2.manufacturers2_id and m2.manufacturers2_id = '" . (int)$HTTP_GET_VARS['manufacturers2_id] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id] . "'";

    } else { // either retail or no need to get correct special prices

    $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.manufacturers2_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_MANUFACTURERS2 . " m2, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id] . "' and p.manufacturers2_id = m2.manufacturers2_id and m2.manufacturers2_id = '" . (int)$HTTP_GET_VARS['manufacturers2_id] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id] . "'";

    } // end else { // either retail...

    // EOF Separate Pricing Per Customer

    } else {

    // We show them all

    // BOF Separate Pricing Per Customer

    if ($status_product_prices_table == true) {

    // DONE ################## Added Enable Disable Categorie #################

    // $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id] . "'";

    $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.manufacturers2_id, tmp_pp.products_price, p.products_price1, p.products_price2, p.products_price3, p.products_price4, p.products_price5, p.products_price6, p.products_price7, p.products_price8, p.products_price1_qty, p.products_price2_qty, p.products_price3_qty, p.products_price4_qty, p.products_price5_qty, p.products_price6_qty, p.products_price7_qty, p.products_price8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_MANUFACTURERS2 . " m2 where p.products_status = '1' and pd.products_id = p.products_id left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c on p.products_id = p2c.products_id left join " . TABLE_CATEGORIES . " c on p2c.categories_id = c.categories_id where c.categories_status = '1' and p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id] . "' and p.manufacturers2_id = m2.manufacturers2_id and m2.manufacturers2_id = '" . (int)$HTTP_GET_VARS['manufacturers2_id] . "'";

    } else { // either retail or no need to get correct special prices

    $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.manufacturers2_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_MANUFACTURERS2 . " m2 left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id] . "' and p.manufacturers2_id = m2.manufacturers2_id and m2.manufacturers2_id = '" . (int)$HTTP_GET_VARS['manufacturers2_id] . "'";

    } // end else { // either retail...

    // EOF Separate Pricing Per Customer

    }

    } else {

    // show the products in a given categorie

    if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['m2filter_id'])) {

    // We are asked to show only specific catgeory;

    // BOF Separate Pricing Per Customer

    if ($status_product_prices_table == true) {

    // DONE ################## Added Enable Disable Categorie #################

    // $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";

    $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.manufacturers2_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_MANUFACTURERS2 . " m2, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_CATEGORIES . " c on c.categories_id = p2c.categories_id where c.categories_status = '1' and p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id] . "' and p.manufacturers2_id = m2.manufacturers2_id and m2.manufacturers2_id = '" . (int)$HTTP_GET_VARS['m2filter_id] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";

    } else { // either retail or no need to get correct special prices

    $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.manufacturers2_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_MANUFACTURERS2 . " m2, " .TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS_RETAIL_PRICES . " s using(products_id) where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id] . "' and p.manufacturers2_id = m2.manufacturers2_id and m2.manufacturers2_id = '" . (int)$HTTP_GET_VARS['m2filter_id] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";

    } // end else { // either retail...

    // EOF Separate Pricing Per Customer

    } else {

    // We show them all

    // BOF Separate Pricing Per Customer

    if ($status_product_prices_table == true) {

    // ################## Added Enable Disable Categorie #################

    //$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";

    $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.manufacturers2_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_MANUFACTURERS2 . " m2 on m2.manufacturers2_id=p.manufacturers2_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_CATEGORIES . " c on c.categories_id = p2c.categories_id where c.categories_status = '1' and p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";

    } else { // either retail or no need to get correct special prices

    $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.manufacturers2_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_MANUFACTURERS2 . " m2 on m2.manufacturers2_id=p.manufacturers2_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";

    } // end else { // either retail...

    // EOF Separate Pricing per Customer

    }

    }

     

    // if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {

    // for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {

    // if ($column_list[$i] == 'PRODUCT_LIST_NAME') {

    // $HTTP_GET_VARS['sort'] = $i+1 . 'a';

    // $listing_sql .= " order by pd.products_name";

    // break;

    // }

    // }

    // } else {

    //CHANGED TO SORT BY MODEL NUMBER

    if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {

    for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {

    if ($column_list[$i] == 'PRODUCT_LIST_NAME') {

    $HTTP_GET_VARS['sort'] = $i+1 . 'a';

    $listing_sql .= " order by p.products_model";

    break;

    }

    }

    } else {

    $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);

    $sort_order = substr($HTTP_GET_VARS['sort'], 1);

    $listing_sql .= ' order by ';

    switch ($column_list[$sort_col-1]) {

    case 'PRODUCT_LIST_MODEL':

    $listing_sql .= "p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";

    break;

    case 'PRODUCT_LIST_NAME':

    $listing_sql .= "pd.products_name " . ($sort_order == 'd' ? 'desc' : '');

    break;

    case 'PRODUCT_LIST_MANUFACTURER':

    $listing_sql .= "m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";

    break;

    case 'PRODUCT_LIST_MANUFACTURERS2':

    $listing_sql .= "m2.manufacturers2_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";

    break;

    case 'PRODUCT_LIST_QUANTITY':

    $listing_sql .= "p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";

    break;

    case 'PRODUCT_LIST_IMAGE':

    $listing_sql .= "pd.products_name";

    break;

    case 'PRODUCT_LIST_WEIGHT':

    $listing_sql .= "p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";

    break;

    case 'PRODUCT_LIST_PRICE':

    $listing_sql .= "final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";

    break;

    }

    }

    $category_query = tep_db_query("select cd.categories_htc_title_tag, cd.categories_htc_description, cd.categories_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");

    $category = tep_db_fetch_array($category_query);

    ?>

    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">

    <tr>

    <td><table border="0" width="100%" cellspacing="0" cellpadding="0">

    <tr>

    <td class="catheading"><?php echo $category['categories_htc_title_tag']; ?></td>

    <?php

    // optional Product List Filter

    if (PRODUCT_LIST_FILTER > 0) {

    if (isset($HTTP_GET_VARS['manufacturers_id'])) {

    $filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id] . "' order by cd.categories_name";

     

    } else {

    $filterlist_sql= "select distinct m.manufacturers_id as id, m.manufacturers_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by m.manufacturers_name";

    }

    $m2filterlist_sql= "select distinct m2.manufacturers2_id as id, m2.manufacturers2_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_MANUFACTURERS2 . " m2 where p.products_status = '1' and p.manufacturers2_id = m2.manufacturers2_id and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by m2.manufacturers2_name";

    $filterlist_query = tep_db_query($filterlist_sql);

    $m2filterlist_query = tep_db_query($m2filterlist_sql);

    if (tep_db_num_rows($filterlist_query) > 1) {

    echo ' <td align="center" class="main">' . tep_draw_form('filter', FILENAME_DEFAULT, 'get') . TEXT_SHOW . '?';

    if (isset($HTTP_GET_VARS['manufacturers_id'])) {

    echo tep_draw_hidden_field('manufacturers_id', $HTTP_GET_VARS['manufacturers_id']);

    $options = array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES));

    } else {

    echo tep_draw_hidden_field('cPath', $cPath);

    $options = array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURERS));

     

    }

    $options2 = array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURERS2));

    echo tep_draw_hidden_field('sort', $HTTP_GET_VARS['sort']);

    while ($filterlist = tep_db_fetch_array($filterlist_query)) {

    $options[] = array('id' => $filterlist['id'], 'text' => $filterlist['name']);

    }

    while ($m2filterlist = tep_db_fetch_array($m2filterlist_query)) {

    $options2[] = array('id' => $m2filterlist['id'], 'text' => $m2filterlist['name']);

    }

    echo tep_draw_pull_down_menu('filter_id', $options, (isset($HTTP_GET_VARS['filter_id']) ? $HTTP_GET_VARS['filter_id'] : ''), 'onchange="this.form.submit()"');

    echo tep_draw_pull_down_menu('m2filter_id', $options2, (isset($HTTP_GET_VARS['m2filter_id']) ? $HTTP_GET_VARS['m2filter_id'] : ''), 'onchange="this.form.submit()"');

    echo '</form></td>' .

  9. Was this the contrib that you installed?

     

    Was it straight forward, or did you have to seek out patches and/or look in the support thread to get it working?

    Yep, it was this contribution - I installed 'Google XML Sitemap Feed v1.3' (the last one by Chemo) - didn't have to look in the support forum, instructions were very clear - but I haven't submitted to google yet (site isn't live yet, will be done in the next couple of weeks) - hopefully that goes ok too.

     

    ~bobsi18~

  10. Also, I would like to create a direct debit payment module using the same info to create a printable page with my clients bank details and the amounts already filled in dynamically, along with a unique identifier (order number would do for this)

    Try this contrib: http://www.oscommerce.com/community/contri...earch,cc+by+fax 'cc by fax' for the print off page - with this contrib, you can print a page during checkout to be faxed, it automatically fills in the appropriate fields (i.e. name, total order amount, etc), and could probably be tweaked for your needs...

     

    ~bobsi18~

  11. Has anyone else successfully added a '2nd manufacturer'??? I really really really need some help, I'm about ready to give up...

     

    I have the 2nd manufacturer installed, it works in every instance (in the advanced search, in the standard manufacturer drop down box etc) BUT NOT IN THE FILTERS. By this, I mean when you look in a particular category (for example dvds) and you filter it by the manufacturer (eg 'warner'). I'm trying to set it up so that you can filter by a 2nd manufacturer (eg 'fox') as well. I'm really really struggling, I know it's on the index.php page that stuff needs to be changed, but I'm just going around in circles. Has anyone every successfully done this? please help me out if you can!!!

     

    ~bobsi18~

    The code I used to get the filter semi-working on the category pages (I'm yet to get it working on the 1st and 2nd manufacturers pages)...

     

    From index.php ('manufacturer2' is my second manufacturer)

     

    // optional Product List Filter
    if (PRODUCT_LIST_FILTER > 0) {
      if (isset($HTTP_GET_VARS['manufacturers_id'])) {
    	$filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' order by cd.categories_name";
    
      } else {
    	$filterlist_sql= "select distinct m.manufacturers_id as id, m.manufacturers_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by m.manufacturers_name";
      }
      $m2filterlist_sql= "select distinct m2.manufacturer2_id as id, m2.manufacturer2_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_MANUFACTURER2 . " m2 where p.products_status = '1' and p.manufacturer2_id = m2.manufacturer2_id and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by m2.manufacturer2_name";
      $filterlist_query = tep_db_query($filterlist_sql);
      $m2filterlist_query = tep_db_query($m2filterlist_sql);
      if (tep_db_num_rows($filterlist_query) > 1) {
    	echo '			<td align="center" class="main">' . tep_draw_form('filter', FILENAME_DEFAULT, 'get') . TEXT_SHOW . ' ';
    	if (isset($HTTP_GET_VARS['manufacturers_id'])) {
    	  echo tep_draw_hidden_field('manufacturers_id', $HTTP_GET_VARS['manufacturers_id']);
    	  $options = array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES));
    	} else {
    	  echo tep_draw_hidden_field('cPath', $cPath);
    	  $options = array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURERS));
    
    	}
    	  $options2 = array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURER2));
    	echo tep_draw_hidden_field('sort', $HTTP_GET_VARS['sort']);
    	while ($filterlist = tep_db_fetch_array($filterlist_query)) {
    	  $options[] = array('id' => $filterlist['id'], 'text' => $filterlist['name']);
    	}
    	while ($m2filterlist = tep_db_fetch_array($m2filterlist_query)) {
    	  $options2[] = array('id' => $m2filterlist['id'], 'text' => $m2filterlist['name']);
    	}
    	echo tep_draw_pull_down_menu('filter_id', $options, (isset($HTTP_GET_VARS['filter_id']) ? $HTTP_GET_VARS['filter_id'] : ''), 'onchange="this.form.submit()"');
    	echo tep_draw_pull_down_menu('m2filter_id', $options2, (isset($HTTP_GET_VARS['m2filter_id']) ? $HTTP_GET_VARS['m2filter_id'] : ''), 'onchange="this.form.submit()"');
    	echo '</form></td>' . "\n";
      }
    }

  12. Here is the request inside index.php :

    // We show them all
       $listing_sql = "select distinct " . $select_column_list . " p.products_id, p.manufacturers_id, p.manufacturers2_id, p.manufacturers3_id, p.manufacturers4_id, p.manufacturers5_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m , " . TABLE_MANUFACTURERS2 . " m2, " . TABLE_MANUFACTURERS3 . " m3, " . TABLE_MANUFACTURERS4 . " m4, " . TABLE_MANUFACTURERS5 . " m5 left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id AND p.manufacturers2_id = m2.manufacturers2_id AND p.manufacturers3_id = m3.manufacturers3_id AND p.manufacturers4_id = m4.manufacturers4_id AND p.manufacturers5_id = m5.manufacturers5_id and (m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' OR m2.manufacturers2_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' OR m3.manufacturers3_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' OR m4.manufacturers4_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' OR m5.manufacturers5_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "')";

     

    and the sql request to be clarified:

    SELECT DISTINCT m.manufacturers_name, p.products_image, pd.products_name, p.products_id, p.manufacturers_id, p.manufacturers2_id, p.products_price, p.products_tax_class_id, 
    IF (
    
    s.status, s.specials_new_products_price, NULL 
    ) AS specials_new_products_price, 
    IF (
    s.status, s.specials_new_products_price, p.products_price
    ) AS final_price
    FROM products p, products_description pd, manufacturers m, manufacturers2 m2, manufacturers3 m3, manufacturers4 m4, manufacturers5 m5
    LEFT JOIN specials s ON p.products_id = s.products_id
    WHERE p.products_status = '1'
    AND pd.products_id = p.products_id
    AND pd.language_id = '2'
    AND p.manufacturers_id = m.manufacturers_id
    AND p.manufacturers2_id = m2.manufacturers2_id
    AND p.manufacturers2_id = m3.manufacturers3_id
    AND p.manufacturers2_id = m4.manufacturers4_id
    AND p.manufacturers2_id = m5.manufacturers5_id
    AND (
    m.manufacturers_id = '22'
    OR m2.manufacturers2_id = '22'
    OR m3.manufacturers3_id = '22'
    OR m4.manufacturers4_id = '22'
    OR m5.manufacturers5_id = '22'
    )
    ORDER BY pd.products_name
    LIMIT 0 , 30

     

    Thanks for debugging

     

    Has anyone else successfully added a '2nd manufacturer'??? I really really really need some help, I'm about ready to give up...

     

    I have the 2nd manufacturer installed, it works in every instance (in the advanced search, in the standard manufacturer drop down box etc) BUT NOT IN THE FILTERS. By this, I mean when you look in a particular category (for example dvds) and you filter it by the manufacturer (eg 'warner'). I'm trying to set it up so that you can filter by a 2nd manufacturer (eg 'fox') as well. I'm really really struggling, I know it's on the index.php page that stuff needs to be changed, but I'm just going around in circles. Has anyone every successfully done this? please help me out if you can!!!

     

    ~bobsi18~

  13. I had to modify the insertion statement in new_attributes_change.php (line 66) to include options_values_weight, but it works now. :) Thanks!

     

    Now I need to figure out why it still doesn't properly interface with UPS...

    oops, soory, forgot to include!

     

    New new_attributes_change.php:

    <?
    
    /*
     $Id: new_attributes_change.php 
    
    New Attribute Manager v4b, Author: Mike G.
    
     Updates for New Attribute Manager v.5.0 and multilanguage support by: Kiril Nedelchev - kikoleppard
     [email protected]
     Modified for Add-Weight-to-Products
    
     osCommerce, Open Source E-Commerce Solutions
     http://www.oscommerce.com
    
     Copyright (c) 2003 osCommerce
    
     Released under the GNU General Public License
    */
    
    // I found the easiest way to do this is just delete the current attributes & start over =)
    MYSQL_QUERY( "DELETE FROM products_attributes WHERE products_id = '$current_product_id'" );
    
    // Simple, yet effective.. loop through the selected Option Values.. find the proper price & prefix.. insert.. yadda yadda yadda.
    for ($i = 0; $i < sizeof($optionValues); $i++) {
    
    $query = "SELECT * FROM products_options_values_to_products_options where products_options_values_id = '$optionValues[$i]'";
    
    $result = mysql_query($query) or die(mysql_error());
    
    $matches = mysql_num_rows($result);
    
       while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
    
    		$optionsID = $line['products_options_id'];
    
       }
    
    
    $value_price =  $HTTP_POST_VARS[$optionValues[$i] . '_price'];
    
    $value_prefix = $HTTP_POST_VARS[$optionValues[$i] . '_prefix'];
    
    if ( $optionTypeInstalled == "1" ) {
    
    	$value_type = $HTTP_POST_VARS[$optionValues[$i] . '_type'];
    	$value_qty = $HTTP_POST_VARS[$optionValues[$i] . '_qty'];
    	$value_order = $HTTP_POST_VARS[$optionValues[$i] . '_order'];
    	$value_linked = $HTTP_POST_VARS[$optionValues[$i] . '_linked'];
    
    	MYSQL_QUERY( "INSERT INTO products_attributes ( products_id, options_id, options_values_id, options_values_price, price_prefix, options_type_id, options_values_qty, attribute_order, collegamento )
    				 VALUES( '$current_product_id', '$optionsID', '$optionValues[$i]', '$value_price', '$value_prefix', '$value_type', '$value_qty', '$value_order', '$value_linked' )" ) or die(mysql_error());
    
    // Linda McGrath's contribution or Forrest Miller's Product Attrib Sort 
    
    } else if ( $optionSortCopyInstalled == "1" ) {
    
    	$value_sort = $HTTP_POST_VARS[$optionValues[$i] . '_sort'];
    	$value_weight = $HTTP_POST_VARS[$optionValues[$i] . '_weight'];
    	$value_weight_prefix = $HTTP_POST_VARS[$optionValues[$i] . '_weight_prefix'];
    
    	MYSQL_QUERY( "INSERT INTO products_attributes ( products_id, options_id, options_values_id, options_values_price, price_prefix, products_options_sort_order, products_attributes_weight, products_attributes_weight_prefix )
    				 VALUES( '$current_product_id', '$optionsID', '$optionValues[$i]', '$value_price', '$value_prefix', '$value_sort', '$value_weight', '$value_weight_prefix' )" ) or die(mysql_error());
    
    	 } else if ( $optionAddWeightInstalled == "1" ) {
    
    	$Option_Add_Weight = $HTTP_POST_VARS[$optionValues[$i] . '_weight'];
    
    	MYSQL_QUERY( "INSERT INTO products_attributes ( products_id, options_id, options_values_id, options_values_price, price_prefix, options_values_weight )
    				 VALUES( '$current_product_id', '$optionsID', '$optionValues[$i]', '$value_price', '$value_prefix', '$Option_Add_Weight' )" ) or die(mysql_error());
    
    } else {
    
    	MYSQL_QUERY( "INSERT INTO products_attributes ( products_id, options_id, options_values_id, options_values_price, price_prefix )
    				 VALUES( '$current_product_id', '$optionsID', '$optionValues[$i]', '$value_price', '$value_prefix' )" ) or die(mysql_error());
    
    }			 
    
    }
    
    // For text input option type feature by chandra
    if ( $optionTypeTextInstalled == "1" && is_array( $HTTP_POST_VARS['optionValuesText'] )) {
    
      for ($i = 0; $i < sizeof($optionValuesText); $i++) {
    
    	$value_price =  $HTTP_POST_VARS[$optionValuesText[$i] . '_price'];
    
    	$value_prefix = $HTTP_POST_VARS[$optionValuesText[$i] . '_prefix'];
    
    	$value_product_id = $HTTP_POST_VARS[$optionValuesText[$i] . '_options_id'];
    
    	MYSQL_QUERY( "INSERT INTO products_attributes ( products_id, options_id, options_values_id, options_values_price, price_prefix )
    	VALUES( '$current_product_id', '$value_product_id', '0', '$value_price', '$value_prefix' )" ) or die(mysql_error());
    
      }
    
    }
    ?>

  14. Ok..so I installed the New Product Attribute editor mod listed in your original post. What code did you end up using to get the Weights to appear in the Attribute Manager section?

     

    Ok... this is assuming you have both the New Attributes Manager and Add-Weight-To-Products installed correclty and they are working fine.

     

    A couple of warnings - I really am just beginning in php, and after looking through the files again, they look like they have some holes in them - the code hasn't been extensively tested, but it is working for me. I'm also not sure that it will still work with Linda McGrath's contribution, as I used some of that code to make it work for me. There is also a small bug that when I edit something, the price prefix changes to '-'. So BACK-UP EVERYTHING before you do the changes, in case it doesn't work for you...

     

    This is my new new_attributes_config.php

    <?
    /*
     $Id: new_attributes_config.php 
    
     New Attribute Manager v4b, Author: Mike G.
    
     Updates for New Attribute Manager v.5.0 and multilanguage support by: Kiril Nedelchev - kikoleppard
     [email protected]
     Modified for Add-Weight-to-Products
    
     osCommerce, Open Source E-Commerce Solutions
     http://www.oscommerce.com
    
     Copyright (c) 2003 osCommerce
    
     Released under the GNU General Public License
    */
    
    // Change to your default language ID if it differs.
     $languageFilter = "1";
    
    // If you have Options Type Feature ver. 2.02.MS1 by countezero installed - make this = "1"
     $optionTypeInstalled = "0";
    
    // If you have "Attributes Sorter & Copier v5.1 with weight" or Forrest Miller's Product Attrib Sort 
    // by Linda McGrath installed - make this = "1"
     $optionSortCopyInstalled = "0";
    
     // If you have "Add Weight to Products Options" installed - make this = "1"
     $optionAddWeightInstalled = "1";
    
    // If you have Option Type Feature v-1.4 by Chandra Roukema installed - make this = "1"
     $optionTypeTextInstalled = "1";
    
    // If you have Option Type Feature v-1.4 by Chandra Roukema installed - set this to your
    // PRODUCTS_OPTIONS_VALUE_TEXT_ID value ( usually "0" )
     $optionTypeTextInstalledID = "0";
    
    ?>

     

    This is the new new_attributes_functions.php

    <?
    
    /*
     $Id: new_attributes_functions.php 
    
    New Attribute Manager v4b, Author: Mike G.
    
     Updates for New Attribute Manager v.5.0 and multilanguage support by: Kiril Nedelchev - kikoleppard
     [email protected]
     Modified for Add-Weight-to-Products
    
     osCommerce, Open Source E-Commerce Solutions
     http://www.oscommerce.com
    
     Copyright (c) 2003 osCommerce
    
     Released under the GNU General Public License
    */
    
    // A simple little function to determine if the current value is already selected for the current product.
    function checkAttribute( $current_value_id, $current_product_id, $current_product_option_id )
    {
    global $attribute_value_price, $attribute_value_prefix, /*KIKOLEPPARD zero prefix add*/$zeroCheck/*KIKOLEPPARD zero prefix add*/, $posCheck, $negCheck;
    
    $query = "SELECT * FROM products_attributes where options_values_id = '$current_value_id' AND products_id = '$current_product_id' AND options_id = '$current_product_option_id'";
    
    $result = mysql_query($query) or die(mysql_error());
    
    $isFound = mysql_num_rows($result);
    
    if ($isFound) {
    
    while($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
    
    	$attribute_value_price = $line['options_values_price'];
    	$attribute_value_prefix = $line['price_prefix'];
    	//KIKOLEPPARD zero prefix start
    	 if ($attribute_value_prefix == " ") { $zeroCheck = "SELECTED";
    										  $posCheck = "";
    										  $negCheck = "";
    										  }
    	elseif ($attribute_value_prefix == "+") { $zeroCheck = "";
    										  $posCheck = " SELECTED";
    										  $negCheck = "";
    
    	} else { $zeroCheck = "";
    			 $posCheck = "";
    			 $negCheck = " SELECTED";
    
    	}
    
      }
    	//KIKOLEPPARD zero prefix end
    return true; 
    
    } else {
    
    $attribute_value_price = ""; 
    $attribute_value_prefix = "";
      //KIKOLEPPARD add
      $zeroCheck = "";
      //KIKOLEPPARD add
      $posCheck = "";
    $negCheck = "";
    
    return false; }
    
    }
    
    function rowClass($i){
    $class1 = "attributes-odd";
    $class2 = "attributes-even";
    
    if ( $i%2 ) {
    	return $class1;
    } else {
    	return $class2;
    } 
    }
    
    // For Options Type Contribution
    function extraValues( $current_value_id, $current_product_id )
    {
    global $attribute_qty, $attribute_order, $attribute_linked, $attribute_prefix, $attribute_type, $isSelected;
    
    if ( $isSelected ) {
    
    	$query = "SELECT * FROM products_attributes where options_values_id = '$current_value_id' AND products_id = '$current_product_id'";
    
    	$result = mysql_query($query) or die(mysql_error());
    
    	while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
    
    			$attribute_qty = $line['options_values_qty'];
    			$attribute_order = $line['attribute_order'];
    			$attribute_linked = $line['collegamento'];
    			$attribute_prefix = $line['price_prefix'];
    			$attribute_type = $line['options_type_id'];
    
    	}
    
    } else {
    
    		$attribute_qty = "1";
    		$attribute_order = "100";
    		$attribute_linked = "0";
    		$attribute_prefix = "";
    		$attribute_type = "";
    }
    
    }
    
    function displayOptionTypes( $attribute_type )
    {
    global $isSelected;
    
    $availableTypes = array( 'Disabled' => '0', 'Select' => '1', 'Checkbox' => '2', 'Radio' => '3', 'Select Multiple' => '4', 'Text' => '5' );
    
    foreach( $availableTypes as $name => $id ){
    
    	if ( $isSelected && $attribute_type == $id ) { $SELECT = " SELECTED"; }
    
    	else { $SELECT = ""; }
    
    	echo "<OPTION VALUE=\"" . $id . "\"" . $SELECT . ">" . $name;
    
    }
    
    }
    
    // Get values for Linda McGrath's contribution
    function getSortCopyValues( $current_value_id, $current_product_id )
    {
    global $attribute_sort, $attribute_weight, $attribute_weight_prefix, $isSelected;
    
    if ( $isSelected ) {
    
    	$query = "SELECT * FROM products_attributes where options_values_id = '$current_value_id' AND products_id = '$current_product_id'";
    
    	$result = mysql_query($query) or die(mysql_error());
    
    	while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
    
    			$attribute_sort = $line['products_options_sort_order'];
    			$attribute_weight = $line['products_attributes_weight'];
    			$attribute_weight_prefix = $line['products_attributes_weight_prefix'];
    
    	}
    
    } else {
    
    		$attribute_sort = "0";
    		$attribute_weight = "";
    		$attribute_weight_prefix = "";
    }
    
    }
    function sortCopyWeightPrefix( $attribute_weight_prefix )
    {
    global $isSelected;
    
    $availablePrefixes = array( /*KIKOLEPPARD add*/' ', /*KIKOLEPPARD add*/'+', /*KIKOLEPPARD add*/'-' );
    
    foreach( $availablePrefixes as $prefix ) {
    
    	if ( $isSelected && $prefix == $attribute_weight_prefix ) {
    
    			$SELECT = " SELECTED";
    
    	} else { $SELECT = ""; }
    
    	echo "<OPTION VALUE=\"" . $prefix . "\"" . $SELECT . ">" . $prefix;
    
    	}
    
    }
    // Get values for Add Weight to Products Options
    function getAddWeightValues( $current_value_id, $current_product_id )
    {
    global $adpa_attribute_weight, $isSelected;
    
    if ( $isSelected ) {
    
    	$query = "SELECT * FROM products_attributes where options_values_id = '$current_value_id' AND products_id = '$current_product_id'";
    
    	$result = mysql_query($query) or die(mysql_error());
    
    	while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
    
    			$adpa_attribute_weight = $line['options_values_weight'];
    
    	}
    
    } else {
    
    		$adpa_attribute_weight = "";
    }
    
    }
    ?>

     

    New new_attributes_include.php code:

    <?php
    
    /*
     $Id: new_attributes_include.php 
    
     New Attribute Manager v4b, Author: Mike G.
    
     Updates for New Attribute Manager v.5.0 and multilanguage support by: Kiril Nedelchev - kikoleppard
     [email protected]
     Modified for Add-Weight-to-Products
    
     osCommerce, Open Source E-Commerce Solutions
     http://www.oscommerce.com
    
     Copyright (c) 2003 osCommerce
    
     Released under the GNU General Public License
    */
    
    ?>
    
    <TR>
    <TD class="pageHeading" colspan="3"><?=$pageTitle?></TD>
    </TR>
    <FORM ACTION="<?=$PHP_SELF?>" METHOD="POST" NAME="SUBMIT_ATTRIBUTES">
    <INPUT TYPE="HIDDEN" NAME="current_product_id" VALUE="<?=$current_product_id?>">
    <INPUT TYPE="HIDDEN" NAME="action" VALUE="change">
    <?
    
    if ( $cPath ) echo "<INPUT TYPE=\"HIDDEN\" NAME=\"cPathID\" VALUE=\"" . $cPath . "\">";
    
    require( 'new_attributes_functions.php');
    
    // Temp id for text input contribution.. I'll put them in a seperate array.
    $tempTextID= "1999043";
    
    // Lets get all of the possible options
    
    $query = "SELECT * FROM products_options where products_options_id LIKE '%' AND language_id = '$languageFilter'";
    
    $result = mysql_query($query) or die(mysql_error());
    
    $matches = mysql_num_rows($result);
    
    if ($matches) {
    
      while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
    
    	$current_product_option_name = $line['products_options_name'];
    	$current_product_option_id = $line['products_options_id'];
    
    // Print the Option Name
    	echo "<TR class=\"dataTableHeadingRow\">";
    	echo "<TD class=\"dataTableHeadingContent\"><B>" . $current_product_option_name . "</B></TD>";
    	echo "<TD class=\"dataTableHeadingContent\"><B>".TABLE_VALUE_PRICE."</B></TD>";
    	echo "<TD class=\"dataTableHeadingContent\"><B>".TABLE_PRICE_PREFIX."</B></TD>";
    
    	if ( $optionTypeInstalled == "1" ) {
    
    			echo "<TD class=\"dataTableHeadingContent\"><B>".TABLE_HEADING_OPTION_TYPE."</B></TD>";
    			echo "<TD class=\"dataTableHeadingContent\"><B>".TABLE_HEADING_QUANTITY."</B></TD>";
    			echo "<TD class=\"dataTableHeadingContent\"><B>".TABLE_HEADING_ORDER."</B></TD>";
    			echo "<TD class=\"dataTableHeadingContent\"><B>".TABLE_HEADING_LINKED_ATTR."</B></TD>";
    			echo "<TD class=\"dataTableHeadingContent\"><B>".TABLE_HEADING_ID."</B></TD>";
    
    	}
    
    	if ( $optionSortCopyInstalled == "1" ) {
    
    			echo "<TD class=\"dataTableHeadingContent\"><B>".TABLE_HEADING_WEIGHT."</B></TD>";
    			echo "<TD class=\"dataTableHeadingContent\"><B>".TABLE_HEADING_WEIGHT_PREFIX."</B></TD>";
    			echo "<TD class=\"dataTableHeadingContent\"><B>".TABLE_HEADING_SORT_ORDER."</B></TD>";
    
    	}
    
    			if ( $optionAddWeightInstalled == "1" ) {
    
    			echo "<TD class=\"dataTableHeadingContent\"><B>".TABLE_HEADING_WEIGHT."</B></TD>";
    }
    
    	echo "</TR>";
    
    // Find all of the Current Option's Available Values
    	$query2 = "SELECT * FROM products_options_values_to_products_options WHERE products_options_id = '$current_product_option_id' ORDER BY products_options_values_id ASC";
    
    	$result2 = mysql_query($query2) or die(mysql_error());
    
    	$matches2 = mysql_num_rows($result2);
    
    	if ($matches2) {
    
    	   $i = "0";
    
    	   while ($line = mysql_fetch_array($result2, MYSQL_ASSOC)) {
    
    			$i++;
    
    			$rowClass = rowClass( $i );
    
    			$current_value_id = $line['products_options_values_id'];
    
    			$isSelected = checkAttribute( $current_value_id, $current_product_id, $current_product_option_id );
    
    			if ($isSelected) { $CHECKED = " CHECKED"; } else { $CHECKED = ""; }
    
    			$query3 = "SELECT * FROM products_options_values WHERE products_options_values_id = '$current_value_id' AND language_id = '$languageFilter'";
    
    			$result3 = mysql_query($query3) or die(mysql_error());
    
    			while($line = mysql_fetch_array($result3, MYSQL_ASSOC)) {
    
    					$current_value_name = $line['products_options_values_name'];
    
    // Print the Current Value Name
    					echo "<TR class=\"" . $rowClass . "\">";
    					echo "<TD class=\"main\">";
    
    // Add Support for multiple text input option types (for Chandra's contribution).. and using ' to begin/end strings.. less of a mess.
    					if ( $optionTypeTextInstalled == "1" && $current_value_id == $optionTypeTextInstalledID ) {
    
    							$current_value_id_old = $current_value_id;
    							$current_value_id = $tempTextID;
    
    							echo '<input type="checkbox" name="optionValuesText[]" value="' . $current_value_id . '"' . $CHECKED . '>  ' . $current_value_name . '  ';
    							echo '<input type="hidden" name="' . $current_value_id . '_options_id" value="' . $current_product_option_id . '">';
    
    					} else {
    
    					echo "<input type=\"checkbox\" name=\"optionValues[]\" value=\"" . $current_value_id . "\"" . $CHECKED . ">  " . $current_value_name . "  ";
    
    					}
    
    					echo "</TD>";
    					echo "<TD class=\"main\" align=\"left\"><input type=\"text\" name=\"" . $current_value_id . "_price\" value=\"" . $attribute_value_price . "\" size=\"10\"></TD>";
    
    					if ( $optionTypeInstalled == "1" ) {
    
    							extraValues( $current_value_id, $current_product_id );
    
    							echo "<TD class=\"main\" align=\"left\"><input type=\"text\" name=\"" . $current_value_id . "_prefix\" value=\"" . $attribute_prefix . "\" size=\"4\"></TD>";
    							echo "<TD class=\"main\" align=\"left\"><SELECT name=\"" . $current_value_id . "_type\">";
    							displayOptionTypes( $attribute_type );
    							echo "</SELECT></TD>";
    							echo "<TD class=\"main\" align=\"left\"><input type=\"text\" name=\"" . $current_value_id . "_qty\" value=\"" . $attribute_qty . "\" size=\"4\"></TD>";
    							echo "<TD class=\"main\" align=\"left\"><input type=\"text\" name=\"" . $current_value_id . "_order\" value=\"" . $attribute_order . "\" size=\"4\"></TD>";
    							echo "<TD class=\"main\" align=\"left\"><input type=\"text\" name=\"" . $current_value_id . "_linked\" value=\"" . $attribute_linked . "\" size=\"4\"></TD>";
    							echo "<TD class=\"main\" align=\"left\">" . $current_value_id . "</TD>";
    
    					} else {
    							//KIKOLEPPARD zero prefix start
    							echo "<TD class=\"main\" align=\"left\"><SELECT name=\"" . $current_value_id . "_prefix\"> <OPTION value=\" \"" . $zeroCheck . "> <OPTION value=\"+\"" . $posCheck . ">+<OPTION value=\"-\"" . $negCheck . ">-</SELECT></TD>";
    							//KIKOLEPPARD zero prefix end
    
    					if ( $optionSortCopyInstalled == "1" ) {
    
    							getSortCopyValues( $current_value_id, $current_product_id );
    
    
    							echo "<TD class=\"main\" align=\"left\"><input type=\"text\" name=\"" . $current_value_id . "_weight\" value=\"" . $attribute_weight . "\" size=\"10\"></TD>";
    							echo "<TD class=\"main\" align=\"left\"><SELECT name=\"" . $current_value_id . "_weight_prefix\">";
    							sortCopyWeightPrefix( $attribute_weight_prefix );
    							echo "</SELECT></TD>";
    
    							echo "<TD class=\"main\" align=\"left\"><input type=\"text\" name=\"" . $current_value_id . "_sort\" value=\"" . $attribute_sort . "\" size=\"4\"></TD>";
    
    					}
    					//BOF Add-Weight-to-Products
    if ( $optionAddWeightInstalled == "1" ) {
    
    							getAddWeightValues( $current_value_id, $current_product_id );
    
    
    							echo "<TD class=\"main\" align=\"left\"><input type=\"text\" name=\"" . $current_value_id . "_weight\" value=\"" . $adpa_attribute_weight . "\" size=\"10\"></TD>";
    
    					}
    
    					}
    
    					echo "</TR>";
    
    					if ( $optionTypeTextInstalled == "1" && $current_value_id_old == $optionTypeTextInstalledID ) {
    
    					   $tempTextID++;
    
    					}
    
    			}
    
    			if( $i == $matches2 ) { $i = "0"; }
    
    	   }
    
    	} else {
    	  echo "<TR>";
    	  echo "<TD class=\"main\"><SMALL>".TABLE_HEADING_NO_VALUES."</SMALL></TD>";
    	  echo "</TR>";
    
    
      }
    
    }
    }
    
    ?>
    <TR>
    <TD colspan="10" class="main"><BR><INPUT TYPE="image" src="<?=$adminImages?>button_save.gif">   <?=$backLink?><img src="<?=$adminImages?>button_cancel.gif" border="0"></A></TD>
    </TR>
    </FORM>

     

    That's it, let me know how you go...

    ~barbara~

  15. The error you are experiencing maybe because you have modified the index.php file (and probably other pages in your shop as well) to include header_tags.php, and now STS includes it again.

    Possible Solution: Remove the include of header_tags.php from each file in your store, or add this condition for it:

    if ($sts->display_template_output==false) { ...

    If you add the above condition, you'll still have Header Tags Controller working when STS is turned off.

     

     

     

    Another thing to look for: In your headertags.php file, look for the following code:

     

     
    
    $sts->start_capture();
    if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {
    require(DIR_WS_FUNCTIONS . 'header_tags.php');
    require(DIR_WS_INCLUDES . 'header_tags.php');
    } 
    $sts->stop_capture('headertags');

    and change it to this:

     

     
    
    $sts->start_capture();
    if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {
    require_once(DIR_WS_FUNCTIONS . 'header_tags.php');
    require(DIR_WS_INCLUDES . 'header_tags.php');
    } 
    $sts->stop_capture('headertags');

    That will cause the file to only be called once and should take care of your error.

     

    Hope this helps,

     

    Bill Kellum

    THANKS!!!

  16. Hi there all... I've just modified the standard zones based shipping module to suit my needs for international shipping options (I had another post about it here: http://www.oscommerce.com/forums/index.php?showtopic=211768). Basically, I set it up only for international options, there will be no domestic price for this option. So I wanted to limit it, so that only international customers get this option, but domestic customers don't. I've tried playing around with the 'shipping zone' section of the flat rate module, but have been unable to make it work. If a shipping zone isn't set, the module works for everyone, no matter where they're from. If a shipping zone is set (for example, 'World Zones'), it doesn't work for anyone...

     

    Does anyone have any pointers? I'd be very grateful!!!

     

    Thanks,

    ~barbara~

  17. Ok... I've found this contribution (Zone Shipping with the support of Insurance Charge) and have modified it to my needs... I've only one small problem, I don't want this shipping method to show for Australian customers, I only want it to show for international customers. So I tried adding a 'shipping zone' (like what is used for the flat rate shipping), but I can't get it to work. The module works fine if there's without the 'shipping zone', it's when I try to integrate it that's I'm having troubles... So I'm wondering if any of you geniuses can take a look for me...

     

    Thanks,

    :) barbara

     

    /includes/modules/shipping/zones1.php...

    <?php
    /*
    
     $Id: zones1.php,v 1.20 2003/06/15 19:48:09 thomasamoulton Exp $
    
     osCommerce, Open Source E-Commerce Solutions
     [url=http://www.oscommerce.com]http://www.oscommerce.com[/url]
    
     Copyright © 2003 osCommerce
    
     Released under the GNU General Public License
    */
    
     class zones1 {
       var $code, $title, $description, $enabled, $num_zones1;
    
    // class constructor
       function zones1() {
    
         $this->code = 'zones1';
         $this->title = MODULE_SHIPPING_ZONES1_TEXT_TITLE;
         $this->description = MODULE_SHIPPING_ZONES1_TEXT_DESCRIPTION;
         $this->sort_order = MODULE_SHIPPING_ZONES1_SORT_ORDER;
         $this->icon = '';
         $this->tax_class = MODULE_SHIPPING_ZONES1_TAX_CLASS;
         $this->enabled = ((MODULE_SHIPPING_ZONES1_STATUS == 'True') ? true : false);
    
    
    
    
    
    
    if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_ZONES1_ZONE > 0) ) {
           $check_flag = false;
           $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_ZONES1_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
           while ($check = tep_db_fetch_array($check_query)) {
             if ($check['zone_id'] < 1) {
               $check_flag = true;
               break;
             } elseif ($check['zone_id'] == $order->delivery['zone_id']) {
               $check_flag = true;
               break;
             }
           }
    
           if ($check_flag == false) {
             $this->enabled = false;
           }
         }
    
       // CUSTOMIZE THIS SETTING FOR THE NUMBER OF ZONES1 NEEDED
         $this->num_zones1 = 4;
         }
    // class methods
       function quote($method = '') {
         global $order, $cart, $shipping_weight, $shipping_num_boxes;
    
         $dest_country = $order->delivery['country']['iso_code_2'];
         $dest_zone = 0;
         $error = false;
    
    // Zone insurance enhancement
         $order_total = $cart->show_total();
    // Zone insurance enhancement 
    
         for ($i=1; $i<=$this->num_zones1; $i++) {
           $countries_table = constant('MODULE_SHIPPING_ZONES1_COUNTRIES_' . $i);
           $country_zones1 = split("[,]", $countries_table);
           if (in_array($dest_country, $country_zones1)) {
             $dest_zone = $i;
             break;
           }
         }
    
         if ($dest_zone == 0) {
           $error = true;
         } else {
           $shipping = -1;
           $insurance = -1;
           $zones1_cost = constant('MODULE_SHIPPING_ZONES1_COST_' . $dest_zone);
    
    // Zone insurance enhancement 
           $zones1_insurance = constant('MODULE_SHIPPING_ZONES1_INSURANCE_' . $dest_zone);
    // Zone insurance enhancement 
    
           $zones1_table = split("[:,]" , $zones1_cost);
           $size = sizeof($zones1_table);
           for ($i=0; $i<$size; $i+=2) {
             if ($shipping_weight <= $zones1_table[$i]) {
               $shipping = $zones1_table[$i+1];
               $shipping_method = MODULE_SHIPPING_ZONES1_TEXT_WAY . ' ' . $dest_country . ' : ' . $shipping_weight . ' ' . MODULE_SHIPPING_ZONES1_TEXT_UNITS;
               break;
             }
           }
    
    // Zone insurance enhancement  
           $zones1_table_insurance = split("[:,]" , $zones1_insurance);
           $size = sizeof($zones1_table_insurance);
           for ($i=0; $i<$size; $i+=2) {
             if ($order_total <= $zones1_table_insurance[$i]) {
               $insurance = $zones1_table_insurance[$i+1];
               break;
             }
           }
    // Zone insurance enhancement 
    
           if ($shipping == -1 or $insurance == -1) {
             $shipping_cost = 0;
             $insurance = 0;
             $shipping_method = MODULE_SHIPPING_ZONES1_UNDEFINED_RATE;
           } else {
             $shipping_cost = ($shipping * $shipping_num_boxes) + $insurance + constant('MODULE_SHIPPING_ZONES1_HANDLING_' . $dest_zone);
           }
         }
    
         $this->quotes = array('id' => $this->code,
                               'module' => MODULE_SHIPPING_ZONES1_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_ZONES1_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_ZONES1_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 ECI', 'MODULE_SHIPPING_ZONES1_STATUS', 'True', 'Do you want to offer Express Courier International?', '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_ZONES1_TAX_CLASS', '0', 'Use the following tax class on the postage 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_ZONES1_SORT_ORDER', '0', 'Sort order of display.', '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 ('Shipping Zone', 'MODULE_SHIPPING_ZONES1_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
         for ($i = 1; $i <= $this->num_zones1; $i++) {
         if ($i == 1) {
         $code = 'A';
         $codedet = 'A (New Zealand)';
         }
         if ($i == 2) {
         $code = 'B';
         $codedet = 'B (Asia/Pacific)';
         }
         if ($i == 3) {
         $code = 'C';
         $codedet = 'C (USA/Canada/Middle East)';
         }
         if ($i == 4) {
         $code = 'D';
         $codedet = 'D (Rest of the World';
         }
           $default_countries = '';
           if ($i == 1) {
             $default_countries = 'NZ';
           }
           if ($i == 2) {
             $default_countries = 'BD,BT,BN,KH,CN,CK,TP,FJ,PF,GU,HK,IN,ID,JP,KI,KR,LA,MO,MY,MV,MH,FM,MM,NR,NP,N
    C,NU,PK,PW,PG,PH,PN,WS,SG,SB,LK,TW,TH,TK,TO,TV,VU,VN,WF';
           }
           if ($i == 3) {
             $default_countries = 'AF,BH,CA,KM,CY,IR,IL,JO,KW,MG,MU,OM,QU,RE,SA,PM,SY,AE,US,YE';
           }
           if ($i == 4) {
             $default_countries = 'AL,DZ,AO,AI,AG,AR,AM,AT,AZ,BS,BB,BY,BE,BZ,BJ,BM,BO,BA,BW,BR,IO,BG,BF,BI,CM,C
    V,KY,CF,TD,CL,CO,CG,CR,CI,HR,CU,CZ,DK,DJ,DM,DO,EC,EG,SV,GQ,ER,EE,ET,FK,FO,FI,FR,G
    F,GA,GM,GE,DE,GH,GI,GR,GL,GD,GP,GT,GN,GW,GY,HT,HN,HU,IS,IE,IT,JM,KZ,KE,KG,LV,LS,L
    R,LY,LI,LT,LU,MK,MW,ML,MT,MO,MR,MD,MC,MN,MS,MA,MZ,NA,NL,AN,NI,NE,NG,NO,PA,PY,PE,P
    L,PT,PR,RO,RU,RW,KN,LC,VC,ST,SN,SC,SL,SK,SI,SO,ZA,ES,SD,SR,SZ,SE,CH,TJ,TZ,TG,TT,T
    N,TR,TM,TC,UG,UA,GB,UY,UZ,VA,VE,VG,VI,ZM,ZW';
           }
           tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone " . $code ." Countries', 'MODULE_SHIPPING_ZONES1_COUNTRIES_" . $i ."', '" . $default_countries . "', 'Comma separated list of two character ISO country codes that are part of Zone " . $codedet . ".', '6', '0', now())");
                   if ($i == 1) {
           tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone A Postage Table', 'MODULE_SHIPPING_ZONES1_COST_" . $i ."', '.475:37.50,.975:42.00,1.975:49.50,2.975:57.00,4.975:72.50,7.475:92.50,9.975:113.
    00,12.475:133.00,14.975:153.00,17.475:173.00,19.975:193.00,200:1000.00,', 'Postage rates to Zone A (New Zealand)', '6', '0', now())");
           }
                           if ($i == 2) {
           tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone " . $code ." Postage Table', 'MODULE_SHIPPING_ZONES1_COST_" . $i ."', '.475:40.00,.975:46.50,1.975:55.50,2.975:67.50,4.975:88.00,7.475:115.50,9.975:143
    .00,12.475:170.50,14.975:198.00,17.475:225.50,19.975:253.00,200:1000.00,', 'Postage rates to Zone B (Asia/Pacific)', '6', '0', now())");
           }
                           if ($i == 3) {
           tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone C Postage Table', 'MODULE_SHIPPING_ZONES1_COST_" . $i ."', '.475:43.50,.975:52.00,1.975:62.50,2.975:79.00,4.975:104.00,7.475:139.00,9.975:17
    4.00,12.475:211.00,14.975:248.50,17.475:286.00,19.975:323.50,200:1000.00,', 'Postage rates to Zone C (USA/Canada/Middle East)', '6', '0', now())");
           }
                           if ($i == 4) {
           tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone D Postage Table', 'MODULE_SHIPPING_ZONES1_COST_" . $i ."', '.475:45.50,.975:55.00,1.975:69.50,2.975:86.50,4.975:120.50,7.475:163.00,9.975:20
    5.50,12.475:248.00,14.975:290.50,17.475:333.00,19.975:375.50,200:1000.00,', 'Postage rates to Zone D (Rest of the World)', '6', '0', now())");
           }
    
    // Zone insurance enhancement 
           tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone " . $code ." Insurance Table', 'MODULE_SHIPPING_ZONES1_INSURANCE_" . $i ."', '100:7.50,200:9.50,300:11.50,400:13.50,500:15.50,600:17.50,700:19.50,800:21.50,90
    0:23.50,10000:10000.00', 'Insurance rates based on the value order ($5.50 plus $2 per $100 ordered)', '6', '0', now())");
    // Zone insurance enhancement 
           tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone " . $code ." Handling Fee', 'MODULE_SHIPPING_ZONES1_HANDLING_" . $i."', '4', 'Handling Fee for this postage zone (cost of packaging, etc.)', '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_ZONES1_STATUS', 'MODULE_SHIPPING_ZONES1_TAX_CLASS', 'MODULE_SHIPPING_ZONES1_SORT_ORDER',
         'MODULE_SHIPPING_ZONES1_ZONE');
    
         for ($i=1; $i<=$this->num_zones1; $i++) {
           $keys[] = 'MODULE_SHIPPING_ZONES1_COUNTRIES_' . $i;
           $keys[] = 'MODULE_SHIPPING_ZONES1_COST_' . $i;
    // Zone insurance enhancement 
           $keys[] = 'MODULE_SHIPPING_ZONES1_INSURANCE_' . $i;
    // Zone insurance enhancement 
           $keys[] = 'MODULE_SHIPPING_ZONES1_HANDLING_' . $i;
         }
    
         return $keys;
       }
     }
    ?>

  18. Hi there everyone...

     

    I'm looking for advice for Australian international shipping options... I'm currently using the AusPost shipping module and it's great, I will continue to use it.

     

    I want all packages sent overseas to be insured. I can set insured costs in admin for the international airmail option of the Australia Post module. However, Australia Post just doesn't offer insurance to some countries. What I'd like to do is offer a different postage service to those countries, specifically Express Courier International (http://www.auspost.com.au/eci/main.html).

     

    ECI fees work on weight and the country zone of the customer receiving the parcel, there are 4 zones with different prices per weight category. There is a surcharge for insurance, which increases with the value of the parcel.

     

    So what I'm wondering is: is anyone using this postage option? How did you integrate is with oscommerce? does anyone know of a similar shipping module that I could modify?

     

    Thanks for any advice.

     

    ~Barbara~

  19. THANKS! I don't have time to try t out right now, but will give it a whirl tonight. Yes, it does use states, but I've actually turned them 'off', so you can't see them - so the customer just enters in their country and zip code (that's all I need for postage :))..

    cheers,

    ~barbara~

    Great, just tried it, works well, thanks again!

    ~barbara~

  20. Use the function tep_get_country_active_list instead of the tep_get_country_list in the shipping_estimator.php So the code will become

     

    from this:

    				  ENTRY_COUNTRY .' '. tep_get_country_list('country_id', $selected_country,'style="width=200"');

     

    to this

     

    				  ENTRY_COUNTRY .' '. tep_get_country_active_list('country_id', $selected_country,'style="width=200"');

     

    at least that's the start but I am not sure about the states. If the contribution uses only the countries box that should be sufficient. If it uses a 2nd box like the states (seems it does that) you need to submit the form on country change so the page will refresh and show the correct list of states related to the selected country.

    THANKS! I don't have time to try t out right now, but will give it a whirl tonight. Yes, it does use states, but I've actually turned them 'off', so you can't see them - so the customer just enters in their country and zip code (that's all I need for postage :))..

    cheers,

    ~barbara~

×
×
  • Create New...