Jump to content

bobsi18

Members
  • Content count

    436
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by bobsi18

  1. bobsi18

    AusPost Shipping Options

    Hey there ppls... I have an Australian based store and am trying to set up my shipping options, at the moment we have 3 different ways of sending our products 1. pre paid sachels (500 gram & 3kg) 2. express post pre paid sachels (500 gram & 3kg) 3. registered post Number 1 & 2 are fine, thanks to the great Auspost module, it's number 3 I'm having trouble with. Has anyone set up registered post for their site? I'm playing around with the standard post module, adding $2.50 for 'insurance' (that's how much it costs to register the package) and $2 'handling' (for the post bag). However the quotes I'm getting back are a fair amount higher than what I'd expect (I did a bit of research and have created a rough table that we're using to quote customers at the moment). Any ideas? Do you think this is the best way to go about including registered post, maybe I just need to play with the variables a bit more? Any suggestions wld be great. Barbara
  2. 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~
  3. bobsi18

    Small issue with shopping cart

    Please help me out here... I'm going round and round in circles... I've narrowed it down to the includes/classes/shopping_cart.php page (i think)...particularily to this bit of code: if(!empty($attribute_price['options_values_weight'])) { // kumar@farmdev.com // add-weight-to-product-attributes mod: if ($attribute_price['options_values_weight'] > '0') { $this->weight += (($qty * $attribute_price['options_values_weight'])-($qty * $products_weight)); } else { $this->weight += ($qty * $products_weight); } } // END if(!empty($attribute_price['options_values_weight Basically, the weight if it's only one of a product in the cart, it's fine. It's when I add two different sizes of the same product that the problem occurs - the weight defaults back to 'default' weight, not the one I set for the attributes. Has anyone heard of this happening? Thanks, ~bobsi18~
  4. :) bit scared to - I'm sure theres a few errors in there :), but if you think there's a call for it, I will. ~bobsi18~
  5. GOT IT!!! For anyone interested in using Express Courier International for international postage from Australia... Download the zones1 contribution from the contribution area and then replace catalog/includes/modules/shipping/zones1.php with this: <?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, $enabled; $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; $this->enabled = false; } 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'] = $order->delivery['country']['iso_code_2']; if ($order->delivery['country']['iso_code_2'] != 'AU') { 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, 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())"); 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; } } ?>
  6. I', still having trouble with this one - I don't want to offer it to my Australian customers, only to international ones. Does aynone know how to go about this??? Please help me out here, one of the last hurdles before I go live... ~bobsi18~
  7. bobsi18

    [CONTRIBUTION] CCGV (trad)

    Got it :) It was a hack, but it worked for me... for anyone else going around in circles... to deal with rounding errors --> 1) Using phpmyadmin, goto the 'coupon_gv_customer' table and edit the 'amount' field. I changed it to 'decimal(15,9)'. 2) Goto the 'products' table and edit the 'products_price' field. I changed it to 'decimal(15,9)'. 3) Go into your admin area to the catalog area, click on your gift voucher product. change the tax inclusive price to 0.00001 above what it should be. For example, I have a $10 gift voucher, and my store has 10% tax, so I set the the tax exclusive price to 9.0910 instead of 9.0909. I then set the shopping cart box so it didn't show gv info if the gv amount was less than 0.01. I also made changes to the 'to be used from gv's' check box doesnt show at checkout if the gv balance is less that 0.01 Hope this helps someone out - i know it's not a very sofisticated hack, but it works (so far) for me... don't forget to backup before you play around! ~bobsi18~
  8. bobsi18

    [CONTRIBUTION] CCGV (trad)

    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~
  9. bobsi18

    New Attribute Manager Released..

    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~
  10. bobsi18

    Newsletter & Subscribtion for MS2

    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~
  11. bobsi18

    [Cntribution] Specials Automation

    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://forums.oscommerce.com/index.php?sho...45entry865545 ~bobsi18~
  12. Thanks :thumbsup: :thumbsup: :thumbsup:
  13. 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~
  14. bobsi18

    [Cntribution] Specials Automation

    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~
  15. So has anyone thought about this? I've started playing around with it, but I think it's past my ability :(
  16. 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~
  17. Thanks, greta contrib :)
  18. bobsi18

    Subscription Module

    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~
  19. bobsi18

    manufacturer copy (how to)

    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"; } }
  20. bobsi18

    manufacturer copy (how to)

    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~
  21. 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 kikoleppard@hotmail.bg 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()); } } ?>
  22. great! good luck! ~bobsi18~
  23. 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 kikoleppard@hotmail.bg 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 kikoleppard@hotmail.bg 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 kikoleppard@hotmail.bg 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~
  24. bobsi18

    JUST RELEASED! Printable Catalog

    Just in case you're still looking... try here: http://forums.oscommerce.com/index.php?sho...=0entry325101
×