Jump to content

maxxxie

Members
  • Content count

    136
  • Joined

  • Last visited

Everything posted by maxxxie

  1. Hi all, I currently use EasyPopulate (2.76c-MS2) to export and import product information to a CSV file. I'd like to automate the export process so that it runs once a day, and drops a file called "products.csv" into a publicly-accessible directory (ie httpdocs/somefolder/products.csv). It seems that cron is probably the way to do this, but I have two questions: 1. EP lives in the httpdocs/admin folder, which is protected by .htaccess. How do I get around the admin password, short of moving EP to a folder under the httpdocs root (with associated path changes etc); and 2. How do I tell EP to dump the file into a different location than the normal ep-temp folder? My guess on number 2 is to simply use a modified easypopulate.php file, with different paths/folder names to output, but I have no idea about question 1. I know this has been asked before, but I can't find a definitive answer. Can anyone assist please? Cheers, Max
  2. maxxxie

    Problems with lay-by module

    Hi everyone, I'd like to have a payment module that works along the lines of a lay-by system. The customer is presented with a total, then presented with a value of 10% which is the deposit they must pay for the order to be acted upon. It is a requirement that the customer receive a receipt stating the terms and conditions of the layby arrangement. My intention is to use email to do this. To this end, I've butchered the Monthly Installments module and combined it with another payment module (Australian bank deposits) to suit my needs. At checkout, the customer is presented with the terms and conditions and the 10% deposit value they must put down. No worries. But I can't seem to get the deposit value to go into the order confirmation email. The best I can do is to derive 10% of the cart total excluding shipping. But I want to show 10% of the total, not the subtotal. Here's the code I've played with so far (complete with inept failed attempts at fixing the email problem): <?php /* $Id: LAYBY.php,v 1.10 2003/01/29 19:57:14 hpdl Exp $ amended by Edwin Martinez osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ class layby { var $code, $title, $description, $enabled; // class constructor function layby() { global $HTTP_POST_VARS, $order, $currencies, $cart; $this->code = 'layby'; $this->title = MODULE_PAYMENT_LAYBY_TEXT_TITLE; $this->description = MODULE_PAYMENT_LAYBY_TEXT_DESCRIPTION; $this->sort_order = MODULE_PAYMENT_LAYBY_SORT_ORDER; // $this->enabled = ((MODULE_PAYMENT_LAYBY_STATUS == 'True') ? true : false); if(MODULE_PAYMENT_LAYBY_STATUS == 'True'){ if($_SESSION['cart']->total>=100){ $this->enabled = true; } else { $this->enabled = false; } } else { $this->enabled = false; } if ((int)MODULE_PAYMENT_LAYBY_ORDER_STATUS_ID > 0) { $this->order_status = MODULE_PAYMENT_LAYBY_ORDER_STATUS_ID; } // $this->email_footer = MODULE_PAYMENT_LAYBY_TEXT_EMAIL_FOOTER; //echo ($_SESSION['order']->total); //$down_payment = ($_SESSION['order']->total) * 0.10; // $orderinfototal = $order->info['total']; // $orderinfototal = $_SESSION['order']->total; // $orderfinalprice = $order->products['final_price']; //$orderinfoshipping = $_SESSION['order']->info['shipping_cost']; //$ordertotal = $orderinfototal + $orderinfoshipping; $down_payment = $_SESSION['cart']->total / 10; // $down_payment2 = $currencies->price() * 0.10; $EMAIL_LAYBY12 = "Please note: \nYour initial payment (deposit) is: " . number_format($down_payment, 2) . "\n"; $this->email_footer = MODULE_PAYMENT_LAYBY_TEXT_EMAIL_T_AND_C . $EMAIL_LAYBY12 . MODULE_PAYMENT_LAYBY_TEXT_EMAIL_FOOTER; // $this->email_footer = "orderinfototal: " . $orderinfototal . ", orderfinalprice: " . $orderfinalprice; //. " , orderinfoshipping" . $orderinfoshipping . ", ordertotal" . $ordertotal; if (is_object($order)) $this->update_status(); } // class methods function update_status() { global $order; if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_LAYBY_ZONE > 0) ) { $check_flag = false; $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_LAYBY_ZONE . "' and zone_country_id = '" . $order->billing['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->billing['zone_id']) { $check_flag = true; break; } } if ($check_flag == false) { $this->enabled = false; } } } function javascript_validation() { return false; } function selection() { return array('id' => $this->code, 'module' => $this->title); } function pre_confirmation_check() { return false; } function confirmation() { global $HTTP_POST_VARS, $order, $currencies; define('TOTAL_PAYMENT_INT12', microtime()); $down_payment= $currencies->price() * 0.10; //$monthly_payment= ($currencies->price() - $down_payment) * 0.10573; //$salary = ($monthly_payment / 0.2); // $LAYBY12= 'Please note: <br><b> Down Payment: <font color="red"> ' . number_format($down_payment, 2). '</font color><br> 12 Payments of: <font color="red">' . number_format($monthly_payment, 2). ' </b></font color>'. '<br> To apply for this credit line you must have minimum monthly earnings of: <b>' . number_format($salary, 2) . '</b> <br>'; $LAYBY12= 'Please note: <br><b>Your initial payment (deposit) is: <font color="red"> ' . number_format($down_payment, 2) . '</b></font color> <br>'; return array('title' => MODULE_PAYMENT_LAYBY_TEXT_T_AND_C . $LAYBY12 . MODULE_PAYMENT_LAYBY_TEXT_DESCRIPTION); } function process_button() { global $HTTP_POST_VARS, $order, $currencies; $process_button_string = tep_draw_hidden_field('payment', $currencies->price()); return $process_button_string; } function before_process() { return false; } function after_process() { return false; } function get_error() { return false; } function check() { if (!isset($this->_check)) { $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_LAYBY_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 Lay-by Module', 'MODULE_PAYMENT_LAYBY_STATUS', 'True', 'Do you want to accept Lay-by payments?', '6', '1', '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, date_added) values ('Make Payable to:', 'MODULE_PAYMENT_LAYBY_PAYTO', '', 'Who should payments be made payable to?', '6', '1', 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 of display.', 'MODULE_PAYMENT_LAYBY_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '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 ('Payment Zone', 'MODULE_PAYMENT_LAYBY_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', '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, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_LAYBY_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())"); } function remove() { tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } function keys() { return array('MODULE_PAYMENT_LAYBY_STATUS', 'MODULE_PAYMENT_LAYBY_ZONE', 'MODULE_PAYMENT_LAYBY_ORDER_STATUS_ID', 'MODULE_PAYMENT_LAYBY_SORT_ORDER', 'MODULE_PAYMENT_LAYBY_PAYTO'); } } ?> I'm struggling with the code at around line 59 (trying to define $EMAIL_LAYBY12). My guess is that I'm just interrogating the wrong variable, but I've no idea which one I should touch. I'm pretty sure I'm grasping at straws with the $_SESSION variable. I'd appreciate any help! Cheers, Max
  3. Your RewriteBase is wrong. It should be / There is a very large thread dedicated to support for this contribution: http://forums.oscommerce.com/index.php?sho...=154166&hl= and your question has been answered many times. You can find all sorts of useful info in that thread. :) Max
  4. Have a look at the Multi Vendor Shipping mod. In this case, you have two "vendors". Your normal products are sold by "you", and your jam jar product is sold by "you (jam jars)". Put the jam jar product under the "you (jam jars)" vendor, enable flat rate shipping for that vendor. Put all other products into the "you" vendor, and enable whichever shipping methods you want for that vendor. Hope this helps, Max
  5. Is this contribution installed online somewhere, so I can see it in action? Cheers, Max
  6. maxxxie

    Manual shipping module

    How about the individual shipping mod? http://addons.oscommerce.com/info/1333 Cheers, Max
  7. maxxxie

    Official PayPal IPN Support Thread

    It does. Scroll down to the bottom of the page, and you'll find a small box in the bottom left where the words "Enter keywords" appear. Type whatever you like here and it will search the thread. Cheers, Max
  8. maxxxie

    Fixed shipping for each item

    Try the Individual Shipping contribution (search the addons/contributions section for it). Cheers, Max
  9. maxxxie

    live help/support/desk any suggestions?

    No worries, happy to help another queenslander :) Max
  10. maxxxie

    Conditionally include shipping module?

    I believe the Multi Vendor Shipping (MVS) mod will do what you need. Have a hunt in the contributions section. Cheers, Max
  11. maxxxie

    Drop shipping

    Best bet is to head over to the MVS support thread: MVS support thread. The authors of this contribution are active participants in the thread, so you'll be sure to find help there. Max
  12. maxxxie

    live help/support/desk any suggestions?

    I use Crafty Syntax Live Help (CSLH). It's free and does the job. :)
  13. maxxxie

    Menu - PLEASEEEE HELP!

    You might also try this one: http://www.oscommerce.com/community/contributions,4228 :) Max
  14. maxxxie

    Menu - PLEASEEEE HELP!

    I use the one located here: http://addons.oscommerce.com/info/956 Cheers, Max :)
  15. maxxxie

    Please help me!

    Looks to me like in your edits you deleted or missed adding a <?php opening tag. I don't know anything about HTC, but my guess is that at some point in the instructions, you needed to add the code above - locate the relevant file, and find the code. Just before it, try adding an opening tag so that it reads: <?php if (isset($HTTP_GET_VARS['manufacturers_id'])) $db_query = tep_db_query("select manufacturers_htc_title_tag as htc_title, manufacturers_htc_description as htc_description from " . TABLE_MANUFACTURERS_INFO . " where languages_id = '" . (int)$languages_id . "' and manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'"); else $db_query = tep_db_query("select categories_htc_title_tag as htc_title, categories_htc_description as htc_description from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$current_category_id . "' and language_id = '" . (int)$languages_id . "'"); $htc = tep_db_fetch_array($db_query); ?> Be sure to back up the files first, so you can revert if it all goes screwy. Cheers, Max
  16. GAH! Livebot BEGONE! I'm having hassles with livebot (livebot-65-55-165-14.search.live.com and others) impersonating real customers by using this useragent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET CLR 1.1.4322). This bot annoys me because it creates sessions (thereby putting osc session IDs in its index), adds things to the cart (making me excited that someone's about to buy something, then disappointing me when I realise what's going on) and doesn't play nice with spiders.txt. Any idea how I can prevent this bot from creating sessions? Cheers, Max
  17. maxxxie

    Live chat

    I use Crafty Syntax Live Help - http://www.craftysyntax.com/ :) Max
  18. Is it possible to use this contribution to produce per-category feeds? Eg a feed for PC games, a feed for Playstation games etc? Cheers, Max
  19. maxxxie

    Multi_Vendor_Shipping new thread

    Here's a little christmas something for Australian users of MVS. A modification of the excellent Australian Shipping module for Aussie Post: includes/modules/vendors_shipping/auspost.php: <?php /* Modified by Max Lian 02/12/2007 for use with MVS All work is that of the original authors. This modification is based on the original work of others - all credit where credit is due! The Aussie Post shipping module was originally downloaded from http://addons.oscommerce.com/info/648 and is version 2.0.2. To do: Fix up tax! This is currently quasi-hard coded. All MVS mods have been commented with //MVS or //MVS start, //MVS end. */ /* $Id: auspost.php,v 2.0.2 2003/10/15 Based on the above contribution but Auspost Insurance added and will recognise if address if for Aus or OS and not dispaly for OS. Also will not display for packages that exceed maximum weight osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ class auspost { var $code, $title, $description, $icon, $enabled; // class constructor function auspost() { global $order; $this->code = 'auspost'; $this->title = MODULE_SHIPPING_AUSPOST_TEXT_TITLE; $this->description = MODULE_SHIPPING_AUSPOST_TEXT_DESCRIPTION; $this->icon = DIR_WS_ICONS . 'auspost.gif'; /* MVS start $this->sort_order = MODULE_SHIPPING_AUSPOST_SORT_ORDER; $this->tax_class = MODULE_SHIPPING_AUSPOST_TAX_CLASS; $this->enabled = ((MODULE_SHIPPING_AUSPOST_STATUS == 'True') ? true : false); if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_AUSPOST_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_AUSPOST_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; } } MVS end */ } // MVS start function sort_order($vendors_id='1') { if (defined (@constant ('MODULE_SHIPPING_AUSPOST_SORT_ORDER_' . $vendors_id))) { $this->sort_order = @constant('MODULE_SHIPPING_AUSPOST_SORT_ORDER_' . $vendors_id); } else { $this->sort_order = '0'; } return $this->sort_order; } function tax_class($vendors_id='1') { $this->tax_class = constant('MODULE_SHIPPING_AUSPOST_TAX_CLASS_' . $vendors_id); return $this->tax_class; } function enabled($vendors_id='1') { $this->enabled = false; $status = @constant('MODULE_SHIPPING_AUSPOST_STATUS_' . $vendors_id); if (isset ($status) && $status != '') { $this->enabled = (($status == 'True') ? true : false); } return $this->enabled; } function zones($vendors_id='1') { if ( ($this->enabled == true) && ((int)constant('MODULE_SHIPPING_AUSPOST_ZONE_' . $vendors_id) > 0) ) { $check_flag = false; $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . (int)constant('MODULE_SHIPPING_AUSPOST_ZONE_' . $vendors_id) . "' 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 } //while if ($check_flag == false) { $this->enabled = false; }//if }//if return $this->enabled; }//function // MVS end // class methods // MVS // function quote($method = '') { function quote($method = '', $module = '', $vendors_id = '1') { global $order, $cart, $shipping_weight, $shipping_num_boxes, $total_weight; // AUS ONLY Other countries HIDE if ($order->delivery['country']['iso_code_2'] == 'AU') { // ONLY SHOWN IF LESS OR EQUAL TO MAX WEIGHT if ($shipping_weight <= constant('MODULE_SHIPPING_AUSPOST_MAX_WEIGHT_' . $vendors_id)) { $frompcode = constant('MODULE_SHIPPING_AUSPOST_SPCODE_' . $vendors_id); $topcode = $order->delivery['postcode']; $sweight = $shipping_weight*1000; $swidth = constant('MODULE_SHIPPING_AUSPOST_SWIDTH_' . $vendors_id); $sheight = constant('MODULE_SHIPPING_AUSPOST_SHEIGHT_' . $vendors_id); $slength = constant('MODULE_SHIPPING_AUSPOST_SDEPTH_' . $vendors_id); $error = false; // If Insurance option selected - calculate insurance cost if (constant('MODULE_SHIPPING_AUSPOST_INS_STATUS_' . $vendors_id) == 'True') { // Start with Base Cost $insurance = constant('MODULE_SHIPPING_AUSPOST_INS_BASE_' . $vendors_id); if ($order->info['subtotal'] > constant('MODULE_SHIPPING_AUSPOST_INS_UNIT_' . $vendors_id)) { $how_often = ceil((($order->info['subtotal'] - constant('MODULE_SHIPPING_AUSPOST_INS_UNIT_' . $vendors_id))/constant('MODULE_SHIPPING_AUSPOST_INS_UNIT_' . $vendors_id))); $insurance =+ constant('MODULE_SHIPPING_AUSPOST_INS_BASE_' . $vendors_id) + ($how_often * constant('MODULE_SHIPPING_AUSPOST_INS_ADD_' . $vendors_id)); } } // End calculating Insurance $url = "http://drc.edeliver.com.au/ratecalc.asp?Pickup_Postcode=$frompcode&Destination_Postcode=$topcode&Country=AU&Weight=$sweight&Service_Type=STANDARD&Height=$sheight&Width=$swidth&Length=$slength&Quantity=$shipping_num_boxes"; $myfile = file($url); $i=0; foreach($myfile as $vals) { $bits = split("=", $vals); $$bits[0] = $bits[1]; } if ($charge <= 0) { $error = true; } else { $handling = constant('MODULE_SHIPPING_AUSPOST_HANDLING_' . $vendors_id); if ($handling >0) { $handling_details = " $" . constant('MODULE_SHIPPING_AUSPOST_HANDLING_' . $vendors_id) . " " .MODULE_SHIPPING_AUSPOST_TEXT_HANDLING; } else { $handling_details = ""; } if ($insurance >0) { $insurance_details = " $" .$insurance . " " .MODULE_SHIPPING_AUSPOST_TEXT_INSURANCE; } else { $insurance_details = ""; } if ($insurance == 0 && $handling == 0) { $auspost_addons = ""; } else { $auspost_addons = " (" . MODULE_SHIPPING_AUSPOST_TEXT_INCLUDE . $handling_details . $insurance_details . ") "; } $shipping_auspost_method = MODULE_SHIPPING_AUSPOST_TEXT_WAY. " <b>" . $topcode . "</b> - " . $days . " " . MODULE_SHIPPING_AUSPOST_TEXT_SHIPPINGDAYS . ", " .$shipping_num_boxes . MODULE_SHIPPING_AUSPOST_TEXT_BOXES . " " . $total_weight . MODULE_SHIPPING_AUSPOST_TEXT_UNITS . $auspost_addons; // MVS fudged this for tax - this might not be the best fix - $shipping_auspost_cost = (($charge/1.1)* $shipping_num_boxes); $shipping_auspost_cost = ($charge * $shipping_num_boxes); } // MVS start $vendors_data_query = tep_db_query("select handling_charge, handling_per_box, vendor_country from " . TABLE_VENDORS . " where vendors_id = '" . (int)$vendors_id . "'" ); $vendors_data = tep_db_fetch_array($vendors_data_query); $country_name = tep_get_countries($vendors_data['vendor_country'], true); $handling_charge = $vendors_data['handling_charge']; $handling_per_box = $vendors_data['handling_per_box']; if ($handling_charge > $handling_per_box*$shipping_num_boxes) { $handling = $handling_charge; } else { $handling = $handling_per_box*$shipping_num_boxes; } // MVS end $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_AUSPOST_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => $shipping_auspost_method, // MVS start // 'cost' => ($shipping_auspost_cost + MODULE_SHIPPING_AUSPOST_HANDLING) + $insurance))); 'cost' => $shipping_auspost_cost + $handling))); // MVS end if ($this->tax_class($vendors_id)> 0) { $this->quotes['tax'] = tep_get_tax_rate($this->tax_class($vendors_id), $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_AUSPOST_TEXT_ERROR . " " . $total_weight . " " . $shipping_weight; return $this->quotes; } } } // MVS start // MVS function check() { function check($vendors_id='1') { if (!isset($this->_check)) { // $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_AUSPOST_STATUS'"); $check_query = tep_db_query("select configuration_value from " . TABLE_VENDOR_CONFIGURATION . " where vendors_id = '". $vendors_id ."' and configuration_key = 'MODULE_SHIPPING_AUSPOST_STATUS_" . $vendors_id . "'"); // MVS end $this->_check = tep_db_num_rows($check_query); } return $this->_check; } // MVS start // function install() { function install($vendors_id='1') { tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . "(configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added, vendors_id) VALUES ('Enable auspost', 'MODULE_SHIPPING_AUSPOST_STATUS_" . $vendors_id . "','True', 'Do you want to offer auspost?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now(),'" . $vendors_id . "')"); tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) VALUES ('Dispatch Postcode', 'MODULE_SHIPPING_AUSPOST_SPCODE_" . $vendors_id . "', '2000', 'Dispatch Postcode?', '6', '0', now(), '" . $vendors_id . "')"); tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added, vendors_id) VALUES ('Enable Insurance', 'MODULE_SHIPPING_AUSPOST_INS_STATUS_" . $vendors_id . "', 'True', 'Do you want to include insurance?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now(), '" . $vendors_id . "')"); tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('Insurance Base Cost', 'MODULE_SHIPPING_AUSPOST_INS_BASE_" . $vendors_id . "', '4.35', 'Cost for the first unit of insurance. Needs to be sent <b>Registered Mail</b> for Insurance.', '6', '0', now(), '" . $vendors_id . "')"); tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('Insurance Addition Cost', 'MODULE_SHIPPING_AUSPOST_INS_ADD_" . $vendors_id . "', '1.15', 'Cost for each addition unit of insurance over Base Cost.', '6', '0', now(), '" . $vendors_id . "')"); tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('Insurance Unit Size', 'MODULE_SHIPPING_AUSPOST_INS_UNIT_" . $vendors_id . "', '100', 'Insurance units are based on these increments - (size in Dollars).', '6', '0', now(), '" . $vendors_id . "')"); tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('Handling Fee', 'MODULE_SHIPPING_AUSPOST_HANDLING_" . $vendors_id . "', '5.00', 'Handling Fee for this shipping method', '6', '0', now(), '" . $vendors_id . "')"); tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('Maximum Weight (kg)', 'MODULE_SHIPPING_AUSPOST_MAX_WEIGHT_" . $vendors_id . "', '20', 'Maximum weight allowed by AustPost (in kg). A packaging allowance of <b>3 kg</b> is allowed. EG. 20 - 3 = 17. 17 becomes cutoff point for use.', '6', '0', now(), '" . $vendors_id . "')"); tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) VALUES ('Parcel Height (mm)', 'MODULE_SHIPPING_AUSPOST_SHEIGHT_" . $vendors_id . "', '100', 'Parcel Height (in mm)', '6', '0', now(), '" . $vendors_id . "')"); tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) VALUES ('Parcel Width (mm)', 'MODULE_SHIPPING_AUSPOST_SWIDTH_" . $vendors_id . "', '100', 'Parcel Width (in mm)', '6', '0', now(), '" . $vendors_id . "')"); tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) VALUES ('Parcel Depth (mm)', 'MODULE_SHIPPING_AUSPOST_SDEPTH_" . $vendors_id . "', '100', 'Parcel Depth (in mm)', '6', '0', now(), '" . $vendors_id . "')"); tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added, vendors_id) values ('Shipping Zone', 'MODULE_SHIPPING_AUSPOST_ZONE_" . $vendors_id . "', '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(), '" . $vendors_id . "')"); tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added, vendors_id) values ('Tax Class', 'MODULE_SHIPPING_AUSPOST_TAX_CLASS_" . $vendors_id . "', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now(), '" . $vendors_id . "')"); tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('Sort order of display.', 'MODULE_SHIPPING_AUSPOST_SORT_ORDER_" . $vendors_id . "', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now(), '" . $vendors_id . "')"); } /* MVS start function remove() { tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } MVS end */ function remove($vendors_id) { tep_db_query("delete from " . TABLE_VENDOR_CONFIGURATION . " where vendors_id = '". $vendors_id ."' and configuration_key in ('" . implode("', '", $this->keys($vendors_id)) . "')"); } function keys($vendors_id) { return array('MODULE_SHIPPING_AUSPOST_STATUS_' . $vendors_id, 'MODULE_SHIPPING_AUSPOST_SPCODE_' . $vendors_id,'MODULE_SHIPPING_AUSPOST_INS_STATUS_' . $vendors_id, 'MODULE_SHIPPING_AUSPOST_INS_BASE_' . $vendors_id, 'MODULE_SHIPPING_AUSPOST_INS_ADD_' . $vendors_id, 'MODULE_SHIPPING_AUSPOST_INS_UNIT_' . $vendors_id, 'MODULE_SHIPPING_AUSPOST_MAX_WEIGHT_' . $vendors_id, 'MODULE_SHIPPING_AUSPOST_HANDLING_' . $vendors_id, 'MODULE_SHIPPING_AUSPOST_SHEIGHT_' . $vendors_id, 'MODULE_SHIPPING_AUSPOST_SWIDTH_' . $vendors_id, 'MODULE_SHIPPING_AUSPOST_SDEPTH_' . $vendors_id, 'MODULE_SHIPPING_AUSPOST_ZONE_' . $vendors_id, 'MODULE_SHIPPING_AUSPOST_TAX_CLASS_' . $vendors_id, 'MODULE_SHIPPING_AUSPOST_SORT_ORDER_' . $vendors_id, ); } } ?> From memory, there are no other files to modify. I'm working on modifying the express module, but until then.. enjoy! Max
  20. maxxxie

    [CONTRIBUTION] CCGV (trad)

    To those who are seeking support here, Vger posted a while back that she will provide support for this contribution only via her web site at osc answers dot com. Give that site a go. Cheers, Max
  21. You're looking for a "cross sell" contribution. Search the contributions section for "cross sell" and "x-sell" and you should get a few hits. Cheers, Max
  22. maxxxie

    NEW! Complete Order Editing Tool!

    Hi Kes, Have a look at this post: http://forums.oscommerce.com/index.php?sho...32&st=2420#. It contains the fix (as, I believe, do newer versions of Order Editor). Essentially, the fix is to replace all the "require" statements with "include" statements. DJmonkey is a little quiet at the moment, but to whoever said "I love it when someone writes a mod and then disappears.", you might take note that this thread is 132 pages long and DJ's been posting all the way through. My experience with him has been that he has been exceptionally helpful (ongoing tax bugs notwithstanding). Do try to be a little less ungrateful. Max.
  23. maxxxie

    [CONTRIBUTION] CCGV (trad)

    Hey cafri, I asked this question of Vger just the other day. The short answer is that as it stands, a customer can only apply a single voucher to a particular purchase. Cheers, Max
  24. Can do, with a couple caveats: the first is that this contains modifications relating to the graphical borders mod. The second is that this is still a work in progress. Right now, if a manually-entered cross-sell exists, it does not "fill in the blanks" with random x-sells, it just shows the manually-entered x-sell. So you're best off not entering a manual x-sell at all, let the random bit do its thing. Ideally, I want to change this so that I can manually set a particular item as an x-sell, and have the module populate the rest of the row, so there's always 3 x-sells no matter if they are all random, all manually set, or a bit of both. Here's catalog/includes/modules/xsell_products.php. All work belongs to the original authors, and TBH I can't quite remember which code is mine! <?php /* $Id: xsell_products.php, v1 2002/09/11 // adapted for Separate Pricing Per Customer v4 2005/02/24 osCommerce, Open Source E-Commerce Solutions <http://www.oscommerce.com> Copyright (c) 2002 osCommerce Released under the GNU General Public License */ require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_XSELL_PRODUCTS); // 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; } if ($HTTP_GET_VARS['products_id']) { //Cache $dircache = DIR_FS_CACHE_XSELL . $HTTP_GET_VARS['products_id'] . '/'; $filename = $dircache . $languages_id . '-' . $customer_group_id . '.php'; $cache = '<?php $info_box_contents = array(); $info_box_contents[] = array(\'text\' => TEXT_XSELL_PRODUCTS); new contentBoxHeading($info_box_contents); $info_box_contents = array();'; if (file_exists($filename)) { require $filename; } else { //Fin cache if ($customer_group_id != '0') { $xsell_query = tep_db_query("select distinct p.products_id, p.products_image, pd.products_name, p.products_tax_class_id, IF(pg.customers_group_price IS NOT NULL, pg.customers_group_price, p.products_price) as products_price from " . TABLE_PRODUCTS_XSELL . " xp, " . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_PRODUCTS_GROUPS . " pg using(products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where xp.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and xp.xsell_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_status = '1' and pg.customers_group_id = '".$customer_group_id."' order by sort_order asc limit " . MAX_DISPLAY_ALSO_PURCHASED); } else { $xsell_query = tep_db_query("select distinct p.products_id, p.products_image, pd.products_name, p.products_tax_class_id, products_price from " . TABLE_PRODUCTS_XSELL . " xp, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where xp.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and xp.xsell_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_status = '1' order by sort_order asc limit " . MAX_DISPLAY_ALSO_PURCHASED); } // EOF Separate Pricing Per Customer // echo "x_sell query is " . $xsell_query . "<br>"; $num_products_xsell = tep_db_num_rows($xsell_query); // echo "num_products_xsell is " . $num_products_xsell . "<br>"; if ($num_products_xsell > 0) { ?> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <?php echo mws_header(TEXT_XSELL_PRODUCTS); ?> <td> <!-- xsell_products //--> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => TEXT_XSELL_PRODUCTS); new infoBoxHeading ($info_box_contents); $row = 0; $col = 0; $info_box_contents = array(); while ($xsell = tep_db_fetch_array($xsell_query)) { $xsell['specials_new_products_price'] = tep_get_products_special_price($xsell['products_id']); if ($xsell['specials_new_products_price']) { $xsell_price = '<s>' . $currencies->display_price($xsell['products_price'], tep_get_tax_rate($xsell['products_tax_class_id'])) . '</s><br>'; $xsell_price .= '<span class="productSpecialPrice">' . $currencies->display_price($xsell['specials_new_products_price'], tep_get_tax_rate($xsell['products_tax_class_id'])) . '</span>'; } else { $xsell_price = $currencies->display_price($xsell['products_price'], tep_get_tax_rate($xsell['products_tax_class_id'])); } //Cache $text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $xsell['products_image'], $xsell['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . $xsell['products_name'] .'</a><br>' . $xsell_price. '<br>'; //Fin cache $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"', 'text' => $text); //Cache $cache .= '$info_box_contents[' .$row . '][' . $col . '] = array(\'align\' => \'center\', \'params\' => \'class="smallText" width="33%" valign="top"\', \'text\' => \'' . str_replace("'", "\'", $text) .'\');'; //Fin cache $col ++; if ($col > 2) { $col = 0; $row ++; } } new noborderBox($info_box_contents); //Cache /* $cache .= 'new contentBox($info_box_contents); ?>'; if(!is_dir($dircache)) { mkdir($dircache,0777); } $fp = fopen($filename , 'w'); $fout = fwrite($fp , $cache); fclose($fp); */ //Fin Cache ?> </td> <?php echo mws_footer(''); ?> </tr> </table> <!-- xsell_products_eof //--> <?php } else { /* there are no xsell products registered at all for this product */ $mtm= rand(); $xsell_cat_query = tep_db_query("select categories_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "'"); $xsell_cat_array = tep_db_fetch_array($xsell_cat_query); //var_dump($xsell_cat_array); $xsell_category = $xsell_cat_array['categories_id']; //echo "xsell_category " . $xsell_category . "<br>"; $new_limit = 3 - $num_products_xsell; // $new_limit = 3; //echo "new_limit " . $new_limit . "<br>"; $xsell_prod_query = tep_db_query("select distinct p.products_id, p.products_image, pd.products_name, p.products_tax_class_id, products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pc.categories_id = '" . $xsell_category . "' and pc.products_id = p.products_id and p.products_id != '" . $HTTP_GET_VARS['products_id'] . "' and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_status = '1' order by rand($mtm) desc limit " . $new_limit); $num_prod_query_xsell = tep_db_num_rows($xsell_prod_query); // echo "num_products_xsell is " . $num_prod_query_xsell . "<br>"; if ($num_prod_query_xsell > 0) { ?> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <?php echo mws_header(TEXT_XSELL_PRODUCTS); ?> <td> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => TEXT_XSELL_PRODUCTS); new infoBoxHeading ($info_box_contents); $row = 0; $col = 0; $info_box_contents = array(); /* fill the box with all random products from the same category */ while ($xsell = tep_db_fetch_array($xsell_prod_query)) { $xsell['products_name'] = tep_get_products_name($xsell['products_id']); $xsell['specials_new_products_price'] = tep_get_products_special_price($xsell['products_id']); if ($xsell['specials_new_products_price']) { $xsell_price = '<s>' . $currencies->display_price($xsell['products_price'], tep_get_tax_rate($xsell['products_tax_class_id'])) . '</s><br>'; $xsell_price .= '<span class="productSpecialPrice">' . $currencies->display_price($xsell['specials_new_products_price'], tep_get_tax_rate($xsell['products_tax_class_id'])) . '</span>'; } else { $xsell_price = $currencies->display_price($xsell['products_price'], tep_get_tax_rate($xsell['products_tax_class_id'])); } // $text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $xsell['products_image'], $xsell['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . $xsell['products_name'] .'</a><br>' . $xsell_price. '<br>'; /* $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"', 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $xsell['products_image'], $xsell['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . $xsell['products_name'] . '</a>'); */ $text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $xsell['products_image'], $xsell['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . $xsell['products_name'] .'</a><br>' . $xsell_price. '<br>'; //Fin cache $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"', 'text' => $text); $col ++; if ($col > 2) { $col = 0; $row ++; } } new noborderBox($info_box_contents); ?> </td> <?php echo mws_footer(''); ?> </tr> </table> <?php } } } } ?> The idea behind this code is that it finds out the product's parent category, then yanks other products from that same category and populates the x-sell box with it. I hope this helps. :) Cheers, Max
  25. Do you mean something like at this page: http://www.gamesdepot.com.au/arma-armed-as...-dvd-p-211.html, where under the main picture are suggestions about other things the customer might like? If so, it sounds like you're looking for a cross-sell contribution. Have a look here: http://addons.oscommerce.com/category?search=cross+sell I use the "X-Sell v2-MS2 - Cross Sell for MS2" contribution, available at http://addons.oscommerce.com/info/1415, which I've modified a little to produce random results instead of having to manually enter in cross-sells for every item. I hope this helps! Max
×