Jump to content

Bozmium

Members
  • Content count

    88
  • Joined

  • Last visited

Everything posted by Bozmium

  1. Hey Max, Had a similar problem as i use the wolfen featured sets and realised that all my "buy now" buttons on the homepage were basically going nowhere and giving a 404 not found error. Its odd as the buy now buttons in the reviews section were still working fine but i note that they use a slightly different routine. My fix was to simply turn off automatic redirects in the SEO url config page and voila all my buy now buttons now work correctly. If anyone has a fix for this that i have missed would love to see it! Hope this helps someone - not exactly a fix but will give you your buttons back. Cheers
  2. Bozmium

    TinyMCE

    Greetings Forum, There seems to be a few scattered mentions of good old tinyMCE about the forums but i cant see a forum dedicated to it, so i have started this thread. Some like TinyMCE, some prefer FCK Editor - tell us the pros and cons and why! Ill kick this thread off with some info i posted in some other thread somewhere about the place - perhaps it will be of interest, and found by more people, in a specifically TinyMCE thread. I have found an interesting fork on this great little WYSIWYG editor called TinyFCK - some clever chap has integrated the FCK file browser functions with TinyMCE which only has a paid file browser and sorely cries out for this addition. See it here: http://p4a.sourceforge.net/tinyfck or if you go here there is an updated Zip posted with the latest TinyMCE: http://sourceforge.net/forum/forum.php?forum_id=528776 There is also a plethora of groovy plugins for TinyMCE here: http://sourceforge.net/tracker/?atid=73874...281&func=browse The iBrowser plugin rocks and i highly recommend getting it added onto your TinyMCE. It even caches your product thumbs in admin via the GDLibrary, and you can set all sorts of limits and purge controls for controlling the number and size of thumb files in your cache folder! Tiny MCE runs a treat in all my editing fields but i have one question for someone who may be more familiar/more intelligent than a splice hack like myself: I wish to integrate tinymce into the image URL where i now have the MAXIDVD WYSIWYG html area. This currently works by popping up a file browser window from which you select an image and then it plops your URL into the text field - beautiful. Im sure most shops have this by now. Id like to be able to do the same thing with TinyMCE but am not sure how to achieve it. Alternatively if anyone knows how to replace the product description field with tinymce while retaining the HTML area image URL functionality - that would also be great - as it stands i havent yet figured out how to do this - its one or the other! Anyone else with some great TinyMCE or FCK edit hacks or add ons/skins/mods or updates please feel free to comment! Cheers! :D
  3. Bozmium

    Multi_Vendor_Shipping new thread

    Hi Forum, Ok the very last thing i have to do to make MVS fully functional in my shop is to get the old shipping estimator working. It works at the moment but does not pull any values (obviously!) So is showing no info. I have had a look at the file i need to change which i have posted below (apologies in advance for the large post!) but am stumped as to where to begin. Has anybody done this before or is anyone able to point me in the right direction? shipping_estimator.php <!-- shipping_estimator //--> <script language="JavaScript"> function shipincart_submit(sid){ if(sid){ document.estimator.sid.value=sid; } document.estimator.submit(); return false; } </script> <table align="center"><tr valign="top"><td> <?php // Only do when something is in the cart if ($cart->count_contents() > 0) { require(DIR_WS_LANGUAGES . $language . '/modules/' . FILENAME_SHIPPING_ESTIMATOR); // shipping cost require('includes/classes/http_client.php'); // shipping in basket //if($cart->get_content_type() !== 'virtual') { if (tep_session_is_registered('customer_id')) { // user is logged in if (isset($HTTP_POST_VARS['address_id'])){ // user changed address $sendto = $HTTP_POST_VARS['address_id']; }elseif (tep_session_is_registered('cart_address_id')){ // user once changed address $sendto = $cart_address_id; }else{ // first timer $sendto = $customer_default_address_id; } // set session now $cart_address_id = $sendto; tep_session_register('cart_address_id'); // set shipping to null ! multipickup changes address to store address... $shipping=''; // include the order class (uses the sendto !) require(DIR_WS_CLASSES . 'order.php'); $order = new order; }else{ // user not logged in ! if (isset($HTTP_POST_VARS['country_id'])){ // country is selected $country_info = tep_get_countries($HTTP_POST_VARS['country_id'],true); $order->delivery = array('postcode' => $HTTP_POST_VARS['zip_code'], 'country' => array('id' => $HTTP_POST_VARS['country_id'], 'title' => $country_info['countries_name'], 'iso_code_2' => $country_info['countries_iso_code_2'], 'iso_code_3' => $country_info['countries_iso_code_3']), 'country_id' => $HTTP_POST_VARS['country_id'], //add state zone_id 'zone_id' => $HTTP_POST_VARS['state'], 'format_id' => tep_get_address_format_id($HTTP_POST_VARS['country_id'])); $cart_country_id = $HTTP_POST_VARS['country_id']; tep_session_register('cart_country_id'); //add state zone_id $cart_zone = $HTTP_POST_VARS['zone_id']; tep_session_register('cart_zone'); $cart_zip_code = $HTTP_POST_VARS['zip_code']; tep_session_register('cart_zip_code'); }elseif (tep_session_is_registered('cart_country_id')){ // session is available $country_info = tep_get_countries($cart_country_id,true); $order->delivery = array('postcode' => $cart_zip_code, 'country' => array('id' => $cart_country_id, 'title' => $country_info['countries_name'], 'iso_code_2' => $country_info['countries_iso_code_2'], 'iso_code_3' => $country_info['countries_iso_code_3']), 'country_id' => $cart_country_id, 'format_id' => tep_get_address_format_id($cart_country_id)); } else { // first timer $cart_country_id = STORE_COUNTRY; tep_session_register('cart_country_id'); $country_info = tep_get_countries(STORE_COUNTRY,true); tep_session_register('cart_zip_code'); $order->delivery = array(//'postcode' => '', 'country' => array('id' => STORE_COUNTRY, 'title' => $country_info['countries_name'], 'iso_code_2' => $country_info['countries_iso_code_2'], 'iso_code_3' => $country_info['countries_iso_code_3']), 'country_id' => STORE_COUNTRY, 'format_id' => tep_get_address_format_id($HTTP_POST_VARS['country_id'])); } // set the cost to be able to calculate free shipping $order->info = array('total' => $cart->show_total(), // TAX ???? 'currency' => $currency, 'currency_value'=> $currencies->currencies[$currency]['value']); } // weight and count needed for shipping $total_weight = $cart->show_weight(); $total_count = $cart->count_contents(); require(DIR_WS_CLASSES . 'shipping.php'); $shipping_modules = new shipping; $quotes = $shipping_modules->quote(); $order->info['subtotal'] = $cart->total; // set selections for displaying $selected_country = $order->delivery['country']['id']; $selected_address = $sendto; //} // eo shipping cost // check free shipping based on order total if ( defined('MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING') && (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true')) { switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) { case 'national': if ($order->delivery['country_id'] == STORE_COUNTRY) $pass = true; break; case 'international': if ($order->delivery['country_id'] != STORE_COUNTRY) $pass = true; break; case 'both': $pass = true; break; default: $pass = false; break; } $free_shipping = false; if ( ($pass == true) && ($order->info['total'] >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)) { $free_shipping = true; include(DIR_WS_LANGUAGES . $language . '/modules/order_total/ot_shipping.php'); } } else { $free_shipping = false; } // begin shipping cost if(!$free_shipping && $cart->get_content_type() !== 'virtual'){ if (tep_not_null($HTTP_POST_VARS['sid'])){ list($module, $method) = explode('_', $HTTP_POST_VARS['sid']); $cart_sid = $HTTP_POST_VARS['sid']; tep_session_register('cart_sid'); }elseif (tep_session_is_registered('cart_sid')){ list($module, $method) = explode('_', $cart_sid); }else{ $module=""; $method=""; } if (tep_not_null($module)){ $selected_quote = $shipping_modules->quote($method, $module); if($selected_quote[0]['error'] || !tep_not_null($selected_quote[0]['methods'][0]['cost'])){ $selected_shipping = $shipping_modules->cheapest(); $order->info['shipping_method'] = $selected_shipping['title']; $order->info['shipping_cost'] = $selected_shipping['cost']; $order->info['total']+= $selected_shipping['cost']; }else{ $order->info['shipping_method'] = $selected_quote[0]['module'].' ('.$selected_quote[0]['methods'][0]['title'].')'; $order->info['shipping_cost'] = $selected_quote[0]['methods'][0]['cost']; $order->info['total']+= $selected_quote[0]['methods'][0]['cost']; $selected_shipping['title'] = $order->info['shipping_method']; $selected_shipping['cost'] = $order->info['shipping_cost']; $selected_shipping['id'] = $selected_quote[0]['id'].'_'.$selected_quote[0]['methods'][0]['id']; } }else{ $selected_shipping = $shipping_modules->cheapest(); $order->info['shipping_method'] = $selected_shipping['title']; $order->info['shipping_cost'] = $selected_shipping['cost']; $order->info['total']+= $selected_shipping['cost']; } } // virtual products use free shipping if($cart->get_content_type() == 'virtual') { $order->info['shipping_method'] = CART_SHIPPING_METHOD_FREE_TEXT . ' ' . CART_SHIPPING_METHOD_ALL_DOWNLOADS; $order->info['shipping_cost'] = 0; } if($free_shipping) { $order->info['shipping_method'] = MODULE_ORDER_TOTAL_SHIPPING_TITLE; $order->info['shipping_cost'] = 0; } $shipping=$selected_shipping; // end of shipping cost // end free shipping based on order total $info_box_contents = array(); $info_box_contents[] = array('text' => CART_SHIPPING_OPTIONS); new ContentBoxHeading($info_box_contents, true, true); $ShipTxt= tep_draw_form('estimator', tep_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'), 'post'); //'onSubmit="return check_form();"' $ShipTxt.=tep_draw_hidden_field('sid', $selected_shipping['id']); $ShipTxt.='<table>'; if(sizeof($quotes)) { if (tep_session_is_registered('customer_id')) { // logged in if (CARTSHIP_SHOWWT == 'true') { $showweight = ' (' . $total_weight . ' ' . CARTSHIP_WTUNIT . ')'; } else { $showweight = ''; } if(CARTSHIP_SHOWIC == 'true'){ $ShipTxt.='<tr><td colspan=6><span class="smallAmber"><center>SELECT THE APPROPRIATE OPTION BELOW AS INDICATED AT THE BOTTOM OF THE PRODUCTS PAGE</span><BR><span class="smallText">AUSPOST ONLY SUITABLE FOR SMALLER NON ELECTRONIC ITEMS SUCH AS TORCHES & BATTERIES.<BR>AAE IS NORMALLY YOUR MOST EFFICIENT CHOICE FOR SMALLER ORDERS GOING INTERSTATE, STAR FOR LOCAL.<BR>AIRROAD FOR LARGER ITEMS GOING INTERSTATE SUCH AS MONITORS, SET TOP BOXES & PC CASES, PRINTERS<br>PLEASE NOTE: All figures shown here are based on despatch from Melbourne.<br>For large items such as printers, monitors & Cases please <a href="'.tep_ascii_email(1, "XXXXX@bozcorptech.com.au").'"><u>Contact Us</u></a><br>We can often have items despatched from our interstate warehouses located closer to you to reduce your freight costs. Its often worth the email!<BR>METRO: within approx 20km of the city center.<br>OUTER: Everywhere else<br>BCT DOES NOT OFFER PICKUPS</center></SPAN></td></tr><tr><td class="smallAmber">' . ($total_count == 1 ? ' <b>Item:</b></td><td colspan="2" class="smalltext">' : ' <b>Items:</b></td><td colspan="2" class="smalltext">') . $total_count . $showweight . '</td></tr>'; } $addresses_query = tep_db_query("select address_book_id, entry_city as city, entry_postcode as postcode, entry_state as state, entry_zone_id as zone_id, entry_country_id as country_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . $customer_id . "'"); // only display addresses if more than 1 if (tep_db_num_rows($addresses_query) > 1){ while ($addresses = tep_db_fetch_array($addresses_query)) { $addresses_array[] = array('id' => $addresses['address_book_id'], 'text' => tep_address_format(tep_get_address_format_id($addresses['country_id']), $addresses, 0, ' ', ' ')); } $ShipTxt.='<tr><td colspan="3" class="smallAmber" nowrap>' . CART_SHIPPING_METHOD_ADDRESS .' '. tep_draw_pull_down_menu('address_id', $addresses_array, $selected_address, 'onchange="return shipincart_submit(\'\');"').'</td></tr>'; } $ShipTxt.='<tr valign="top"><td class="smallAmber"><b>' . CART_SHIPPING_METHOD_TO .'</b> </td><td colspan="2" class="smalltext">'. tep_address_format($order->delivery['format_id'], $order->delivery, 1, ' ', '<br>') . '</td></tr>'; } else { // not logged in // $ShipTxt.=tep_output_warning(CART_SHIPPING_OPTIONS_LOGIN); if(CARTSHIP_SHOWIC == 'true'){ $ShipTxt.='<tr><td colspan=6><span class="smallAmber"><center>SELECT THE APPROPRIATE OPTION BELOW AS INDICATED AT THE BOTTOM OF THE PRODUCTS PAGE</span><BR><span class="smallText">AUSPOST ONLY SUITABLE FOR SMALLER NON ELECTRONIC ITEMS SUCH AS TORCHES & BATTERIES.<BR>AAE IS NORMALLY YOUR MOST EFFICIENT CHOICE FOR SMALLER ORDERS GOING INTERSTATE, STAR FOR LOCAL.<BR>AIRROAD FOR LARGER ITEMS GOING INTERSTATE SUCH AS MONITORS, SET TOP BOXES & PC CASES, PRINTERS<br>PLEASE NOTE: All figures shown here are based on despatch from Melbourne.<br>For large items such as printers, monitors & Cases please <a href="'.tep_ascii_email(1, "XXXXX@bozcorptech.com.au").'"><u>Contact Us</u></a><br>We can often have items despatched from our interstate warehouses located closer to you to reduce your freight costs. Its often worth the email!<BR>METRO: within approx 20km of the city center.<br>OUTER: Everywhere else<br>BCT DOES NOT OFFER PICKUPS</center></td></tr><tr><td class="smallAmber">' . ($total_count == 1 ? ' <b>Item:</b></td><td colspan="2" class="smalltext">' : ' <b>Items:</b></td><td colspan="2" class="smalltext">') . $total_count . $showweight . '</td></tr>'; } if($cart->get_content_type() != 'virtual'){ if(CARTSHIP_SHOWCDD == 'true'){ $ShipTxt.='<tr><td colspan="3" class="smallAmber" nowrap>' . ENTRY_COUNTRY .' '. tep_get_country_list('country_id', $selected_country,'style="width=200"'); } //add state zone_id $state_array[] = array('id' => '', 'text' => 'Please Select'); $state_query = tep_db_query("select zone_name, zone_id from " . TABLE_ZONES . " where zone_country_id = '$selected_country' order by zone_country_id DESC, zone_name"); while ($state_values = tep_db_fetch_array($state_query)) { $state_array[] = array('id' => $state_values['zone_id'], 'text' => $state_values['zone_name']); } if(CARTSHIP_SHOWSDD == 'true'){ $ShipTxt.=' ' .ENTRY_STATE .' '. tep_draw_pull_down_menu('state',$state_array); } if(CARTSHIP_SHOWZDD == 'true'){ $ShipTxt.=' '.ENTRY_POST_CODE .' '. tep_draw_input_field('zip_code', $selected_zip, 'size="5"'); } // $ShipTxt.=' <a href="_" onclick="return shipincart_submit(\'\');">'.CART_SHIPPING_METHOD_RECALCULATE.'</a></td></tr>'; if(CARTSHIP_SHOWUB == 'true'){ $ShipTxt.=' <td><a href="_" onclick="return shipincart_submit(\'\');">'. tep_image_button('Update.gif', IMAGE_BUTTON_UPDATE_CART) . ' </a></td></td></tr>'; } } } if($cart->get_content_type() == 'virtual'){ // virtual product-download //$ShipTxt.='<tr><td colspan="3" class="main">'.tep_draw_separator().'</td></tr>'; $ShipTxt.='<tr><td class="main" colspan="3"> </td></tr><tr><td class="main" colspan="3"><i>' . CART_SHIPPING_METHOD_FREE_TEXT . ' ' . CART_SHIPPING_METHOD_ALL_DOWNLOADS . '</i></td></tr>'; }elseif ($free_shipping==1) { // order $total is free //$ShipTxt.='<tr><td colspan="3" class="main">'.tep_draw_separator().'</td></tr>'; $ShipTxt.='<tr><td class="main" colspan="3"> </td></tr><tr><td class="largeGreen" colspan="3"><i>' . sprintf(FREE_SHIPPING_DESCRIPTION, $currencies->format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)) . '</i></td><td> </td></tr>'; }else{ // shipping display $ShipTxt.='<tr><td colspan="3" class="main"> </td></tr><tr><td class="smallAmber"><b><u>' . CART_SHIPPING_CARRIER_TEXT . '</u></b></td><td class="smallAmber" align="left"><b><u>' . CART_SHIPPING_METHOD_TEXT . '</u></b></td><td class="smallAmber" colspan="2" align="right"><b><u>' . CART_SHIPPING_METHOD_RATES . '</u></b></td></tr>'; $ShipTxt.='<tr><td colspan="3" class="footer">'.tep_draw_separator().'</td></tr>'; for ($i=0, $n=sizeof($quotes); $i<$n; $i++) { if(sizeof($quotes[$i]['methods'])==1){ // simple shipping method $thisquoteid = $quotes[$i]['id'].'_'.$quotes[$i]['methods'][0]['id']; $ShipTxt.= '<tr class="'.$extra.'">'; $ShipTxt.='<td class="main">'.$quotes[$i]['icon'].' </td>'; if($quotes[$i]['error']){ $ShipTxt.='<td colspan="2" class="smallText">'.$quotes[$i]['module'].' '; $ShipTxt.= '('.$quotes[$i]['error'].')</td></tr>'; }else{ if($selected_shipping['id'] == $thisquoteid){ $ShipTxt.='<td class="infoBoxHeading"><a title="Select this method" href="_" onclick="return shipincart_submit(\''.$thisquoteid.'\');"><b>'.$quotes[$i]['module'].' '; $ShipTxt.= ''.$quotes[$i]['methods'][0]['title'].'</b></a> </td><td align="right" class="infoBoxHeading"><b>'.$currencies->format(tep_add_tax($quotes[$i]['methods'][0]['cost'], $quotes[$i]['tax'])).'</b></td><td class="smalltext">'.tep_image(DIR_WS_ICONS . 'selected.gif', 'Selected').'</td></tr>'; }else{ $ShipTxt.='<td class="smalltext"><a title="Select this method" href="_" onclick="return shipincart_submit(\''.$thisquoteid.'\');">'.$quotes[$i]['module'].' '; $ShipTxt.= ''.$quotes[$i]['methods'][0]['title'].'</a> </td><td align="right" colspan="2" class="smalltext">'.$currencies->format(tep_add_tax($quotes[$i]['methods'][0]['cost'], $quotes[$i]['tax'])).'</td></tr>'; } } } else { // shipping method with sub methods (multipickup) for ($j=0, $n2=sizeof($quotes[$i]['methods']); $j<$n2; $j++) { $thisquoteid = $quotes[$i]['id'].'_'.$quotes[$i]['methods'][$j]['id']; $ShipTxt.= '<tr class="'.$extra.'">'; $ShipTxt.='<td class="smalltext">'.$quotes[$i]['icon'].' </td>'; if($quotes[$i]['error']){ $ShipTxt.='<td colspan="2" class="smalltext">'.$quotes[$i]['module'].' '; $ShipTxt.= '('.$quotes[$i]['error'].')</td></tr>'; }else{ if($selected_shipping['id'] == $thisquoteid){ $ShipTxt.='<td class="infoBoxHeading"><a title="Select this method" href="_" onclick="return shipincart_submit(\''.$thisquoteid.'\');"><b>'.$quotes[$i]['module'].' '; $ShipTxt.= ''.$quotes[$i]['methods'][$j]['title'].'</b></a> </td><td align="right" class="infoBoxHeading"><b>'.$currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], $quotes[$i]['tax'])).'</b></td><td class="smalltext">'.tep_image(DIR_WS_ICONS . 'selected.gif', 'Selected').'</td></tr>'; }else{ $ShipTxt.='<td class="smalltext"><a title="Select this method" href="_" onclick="return shipincart_submit(\''.$thisquoteid.'\');">'.$quotes[$i]['module'].' '; $ShipTxt.= ''.$quotes[$i]['methods'][$j]['title'].'</a> </td><td align="right" colspan="2" class="smalltext">'.$currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], $quotes[$i]['tax'])).'</td><td class="smalltext"> </td></tr>'; } } } } } } } $ShipTxt.= '</table></form>'; $info_box_contents = array(); $info_box_contents[] = array('text' => $ShipTxt); new DarkInfoBox($info_box_contents); if (CARTSHIP_SHOWOT == 'true'){ // BOF get taxes if not logged in if (!tep_session_is_registered('customer_id')){ $products = $cart->get_products(); for ($i=0, $n=sizeof($products); $i<$n; $i++) { $products_tax = tep_get_tax_rate($products[$i]['tax_class_id'], $order->delivery['country_id'],$order->delivery['zone_id']); $products_tax_description = tep_get_tax_description($products[$i]['tax_class_id'], $order->delivery['country_id'], $order->delivery['zone_id']); if (DISPLAY_PRICE_WITH_TAX == 'true') { //Modified by Strider 42 to correct the tax calculation when a customer is not logged in // $tax_val = ($products[$i]['final_price']-(($products[$i]['final_price']*100)/(100+$products_tax)))*$products[$i]['quantity']; $tax_val = (($products[$i]['final_price']/100)*$products_tax)*$products[$i]['quantity']; } else { $tax_val = (($products[$i]['final_price']*$products_tax)/100)*$products[$i]['quantity']; } $order->info['tax'] += $tax_val; $order->info['tax_groups']["$products_tax_description"] += $tax_val; // Modified by Strider 42 to correct the order total figure when shop displays prices with tax if (DISPLAY_PRICE_WITH_TAX == 'true') { $order->info['total']; } else { $order->info['total']+=$tax_val; } } } // EOF get taxes if not logged in (seems like less code than in order class) require(DIR_WS_CLASSES . 'order_total.php'); $order_total_modules = new order_total; //echo '</td><td align="right">'; // order total code $order_total_modules->process(); $info_box_contents = array(); $info_box_contents[] = array('text' => CART_OT); new ContentBoxHeading($info_box_contents, true, true); $otTxt='<table align="right">'; $otTxt.=$order_total_modules->output().'</table>'; $info_box_contents = array(); $info_box_contents[] = array('text' => $otTxt); new DarkInfoBox($info_box_contents); } } else { echo '<table align="center"><tr><td class="largeGreen"><i>Please login to view shipping and order total estimates.</i></td></tr></table>'; } ?> </td></tr></table> Cheers & thanks!
  4. Bozmium

    Multi_Vendor_Shipping new thread

    Hi guys, Thanks for that not sure how i missed those my editor is supposed to match pairs of braces! Ill make sure i havent inadvertently switched it off and ill give it another whirl. Thanks again!
  5. Bozmium

    Multi_Vendor_Shipping new thread

    Ok heres one for one of the authors or someone more familiar with MVS. Trying to get the TNT shipping module working in MVS - this one here: TNT Aus based shipping on PCode I have followed the modules.txt rundown included with MVS on how to modify modules and think ive almost got it pegged. Unfortunately it keeps throwing this error up at me when in the Vendor manager window: Parse error: syntax error, unexpected $end in /home/bozcorpt/public_html/includes/modules/vendors_shipping/tntzipzonesroad.php on line 182 So i have missed or mucked something somewhere - line 182 incidentally is the very last line and is simply the closing php tag ?>. My parser is telling me that <?php is expected?! If there is anyone here who would be kind enough to have a quick look over this module and maybe point out where i have mucked up i would be very grateful. This can then be thrown onto the download page to join the other shipping modules already ported. This module is designed for Aus based TNT but no reason why it couldnt be altered easily via the rate tables and language files to be applicable anywhere. Here we go: <?php /* Released under the GNU General Public License */ class tntzipzonesroad { var $code, $title, $description, $enabled, $num_zones, $surcharge_factor, $sort_order, $vendors_id; // class constructor: function tntzipzonesroad() { global $order, $vendors_id; $this->vendors_id = ($products['vendors_id'] <= 0) ? 1 : $products['vendors_id']; $this->code = 'tntzipzonesroad'; $this->title = MODULE_SHIPPING_TNTZIPZONESROAD_TEXT_TITLE; $this->description = MODULE_SHIPPING_TNTZIPZONESROAD_TEXT_DESCRIPTION; $this->icon = DIR_WS_ICONS . ''; // $this->enabled = MODULE_SHIPPING_TNTZIPZONESROAD_STATUS; // Customize this setting for the number of zones needed (no change required by default) // $this->num_zones = 1; function num_zones($vendors_id='1') { $this->num_zones = constant('1' . $vendors_id); return $this->num_zones; } //More options can be added later for Express, Overnight etc when someone codes it. $this->types = array('TNT Off-Peak' => 'std'); // Change this surcharge factor to increase your profit margin on freight // $this->surcharge_factor = 1.1; function surcharge_factor($vendors_id='1') { $this->surcharge_factor = constant('1.1' . $vendors_id); return $this->surcharge_factor; } function sort_order($vendors_id='1') { $sort_order = 'MODULE_SHIPPING_TNTZIPZONESROAD_SORT_ORDER_' . $vendors_id; if (defined($sort_order)) { $this->sort_order = constant($sort_order); } else { $this->sort_order = '-'; } return $this->sort_order; } function tax_class($vendors_id='1') { $this->tax_class = constant('MODULE_SHIPPING_TNTZIPZONESROAD_CLASS_' . $vendors_id); return $this->tax_class; } function enabled($vendors_id='1') { $this->enabled = false; $status = @constant('MODULE_SHIPPING_TNTZIPZONESROAD_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_TNTZIPZONESROAD_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_TABLE_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; } // class methods function quote($method = '', $module = '', $vendors_id = '1') { global $HTTP_POST_VARS, $order, $shipping_weight, $shipping_num_boxes, $cart; // First get the dest zip and check the db for our dest zone $zip = $order->delivery['postcode']; if ( $zip == '' ){ // Something is wrong, we didn't find any zone if ($this->enabled($vendors_id) < 1) { $this->quotes['error'] = MODULE_SHIPPING_TNTZIPZONESROAD_NO_ZIPCODE_FOUND; return $this->quotes; } $sql = "SELECT * FROM tnt_zones WHERE $zip >= t_postcode and $zip <= t_postcode"; $qResult = tep_db_query($sql); // run the query $rec = tep_db_fetch_array($qResult); // get the first row of the result $zone_id = $rec['t_zone']; if ( $zone_id == '' ){ // Something is wrong, we didn't find any zone $this->quotes['error'] = MODULE_SHIPPING_TNTZIPZONESROAD_NO_ZONE_FOUND; return $this->quotes; } $sql = "SELECT t_rate FROM tnt_rates_road WHERE t_zone_id = '$zone_id'"; $qResult = tep_db_query($sql); while ($rec = tep_db_fetch_array($qResult)) {$retArr[] = $rec;} foreach($retArr as $aquote){ $cost = $aquote['t_rate']; } // Consignment charge insertion start $sql = "SELECT t_ccharge FROM tnt_rates_road WHERE t_zone_id = '$zone_id'"; $qResult = tep_db_query($sql); while ($rec = tep_db_fetch_array($qResult)) {$retArr[] = $rec;} foreach($retArr as $aquote){ $ccharge = $aquote['t_ccharge']; // Consignment charge insertion end } $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; } if ($shipping_weight <= '15') { $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_TNTZIPZONESROAD_TEXT_TITLE, 'methods' => array(array('id' => $this_code, 'title' => MODULE_SHIPPING_TNTZIPZONESROAD_TEXT_DESCRIPTION, // 'cost' => ((($ccharge)*1.10)* $this->surcharge_factor)+ MODULE_SHIPPING_TNTZIPZONESROAD_HANDLING))); 'cost' => $shipping + $handling)));} else { $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_TNTZIPZONESROAD_TEXT_TITLE, 'methods' => array(array('id' => $this_code, 'title' => MODULE_SHIPPING_TNTZIPZONESROAD_TEXT_DESCRIPTION, // 'cost' => ((($cost * ($shipping_weight - 15) + $ccharge)*1.10)* $this->surcharge_factor)+ MODULE_SHIPPING_TNTZIPZONESROAD_HANDLING))); 'cost' => $shipping + $handling)));} //1.10 added to calculate 10% GST on freight in Australia // if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title); if ($error == true) $this->quotes['error'] = MODULE_SHIPPING_TNTLZIPZONES_INVALID_ZONE; return $this->quotes; } // function check() { function check($vendors_id='1') { if (!isset($this->_check)) { $check_query = tep_db_query("select configuration_value from " . TABLE_VENDOR_CONFIGURATION . "where vendors_id = '". $vendors_id ."' and configuration_key = 'MODULE_SHIPPING_TNTZIPZONESROAD_STATUS_".$vendors_id . "'"); $this->_check = tep_db_num_rows($check_query); } return $this->_check; } // 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, date_added, vendors_id) VALUES ('Enable TNT Postcode Zones Method', 'MODULE_SHIPPING_TNTZIPZONESROAD_STATUS_" . $vendors_id . "', '1', 'Do you want to offer TNT postcode/zone rate shipping?', '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_TNTZIPZONESROAD_HANDLING_" . $vendors_id . "', '0', 'Handling Fee for this shipping method', '6', '0', now(), '" . $vendors_id . "')"); } // function remove() { function remove($vendors_id) { $keys = ''; $keys_array = $this->keys(); for ($i=0; $i<sizeof($keys_array); $i++) { $keys .= "'" . $keys_array[$i] . "',"; } $keys = substr($keys, 0, -1); 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) { $keys = array( 'MODULE_SHIPPING_TNTZIPZONESROAD_STATUS_'. $vendors_id, 'MODULE_SHIPPING_TNTZIPZONESROAD_HANDLING_' . $vendors_id ); return $keys; } } ?> Any help appreciated!
  6. Bozmium

    Multi_Vendor_Shipping new thread

    Just a quicky in addition to this - i am looking at installing the individual prices addon to handle a couple of my heavy items but wanted to confirm: If there is no individual price specified on an item will it default back to the tables or does a value have to be input for every item? i.e. Does it work in addition to, or as a replacement for the tables? Any clarification appreciated!
  7. Bozmium

    Multi_Vendor_Shipping new thread

    No one done this before - hmmmmmm. The alternative is to create a heap of standard table rates (now those i do know how to duplicate no probs!) This would mean having about 14 seperate tables installed - 2 zones in each of 7 states - no big issue to do but would that entail any performance issues i should be aware of? My thinking was if i could make an instance of MZMT for each Vendor then it would be a way around this but seems not possible. Any tips from those in the know? :huh: Cheers!
  8. Hi Guys, Love this mod its an absolute must have - one question - i need to duplicate the MZMT file so that i can have two seperate instances with seperate language files - anyone know what i have to change? Im running the MVS mod with the tweaked MZMT module to suit (which is 'almost' identical) and need to apply MZMT to a second vendor, and hence a second MZMT language file. Have had a roll amongst the code and ALMOST got it working by calling everything MZMT2 but its still seeing it as an installed version of the original so i have obviously missed something. So how do i go about duplicating this baby for a second MZMT module. Any tips met with fawning gratitude! Cheers! :)
  9. Bozmium

    Multi_Vendor_Shipping new thread

    Ok a quicky for those familiar with the MZMT addon for MVS - i need to instigate a second instance of MZMT for a second vendor. Whats the easiest way to duplicate the MZMT.php file to create a second instance? The reason for this is i need another set of zones and tables for another courier and i have already customised the one existing MZMT language file in its current setup - so i basically need to be able to activate a seperate MZMT for another vendor. Anyone know the tweaks? Have tried by creating MZMT2_ in place of MZMT in all the calls and tables & renaming the file MZMT2.php but it sees it as an installed instance of the original - so i have missed something somewhere that im not seeing! Cheers & thanks! :)
  10. Bozmium

    Multi_Vendor_Shipping new thread

    OOps sorry for the double post there guys. Just for anyone else who has experienced tax issues - somehow/somewhere my tax zone id in my SQL database has been changed and not been repointed - i went into SQL and changed the tax zone id to match my Australia country code - and voila all my prices are now showing correctly - but still not on shipping taxes - im guessing thats a similar issue with the zones to geozeones or a tax rate id somewhere and will poke around in the database till i find it, but expect that once i do all my shipping will revert to normal and i can take out all my temporary hacks . :D Just for anyone else having tax issues with or without MVS. Cheers & thanks!
  11. Bozmium

    Multi_Vendor_Shipping new thread

    Hi guys, Whoa - been some serious work going on here! See the new V1.1 is up - looks like i have some serious comparing to do as i am still running the beta versions (hacked to bits of course) - and yes still having shipping tax issues so might just find the problem in the new files. Just a quick one - has anyone got this working with the Ship In Cart (aka Shipping Estimator) v2.20 by Acheron? (Or any of its derivitives)? Used to have this working mighty fine with the standard shipping but of course now shes died as she knows not where to look for the info - have started to have a play amongst the code but would love to hear anything from someone who actually knows what they are doing. :blush: Keep up the good work guys - this is going to be the single biggest addition to OScomm in my opinion. :thumbsup: Cheers!
  12. Bozmium

    Multi_Vendor_Shipping new thread

    Hi guys, Whoa - been some serious work going on here! See the new V1.1 is up - looks like i have some serious comparing to do as i am still running the beta versions (hacked to bits of course) - and yes still having shipping tax issues so might just find the problem in the new files. Just a quick one - has anyone got this working with the Ship In Cart (aka Shipping Estimator) v2.20 by Acheron? (Or any of its derivitives)? Used to have this working mighty fine with the standard shipping but of course now shes died as she knows not where to look for the info - have started to have a play amongst the code but would love to hear anything from someone who actually knows what they are doing. :blush: Keep up the good work guys - this is going to be the single biggest addition to OScomm in my opinion. :thumbsup: Cheers!
  13. Bozmium

    Multi_Vendor_Shipping new thread

    Thanks DJ for sharing that fix - I was playing with this way back before MVS went final and nearly burst a blood vessel in my eye trying to fix it. Works a treat! Thanks heaps. :D
  14. Bozmium

    Multi_Vendor_Shipping new thread

    Hi Jim, Ok i have tried a few things and found: Chemos tep get tax rate was in fact upsetting my tax system & zones. I have found a fix relating to it which means i have now set my tax zones up the way they are meant to be - all good - but im wondering if it is an issue with shipping somehow as far as tax goes? Who knows. All i know is that selecting a tax zone or tax rate in any of the shipping module drop downs in MVS has 0 effect. I have one tax class - Taxable goods - set at a rate of 10% at priority 1 and it gets applied to goods and shipping alike. At the moment i have brutally hacked my way through all the shipping and ordering pages and hardcoded a 10% tax in on all the prices. *1.1 & /11 & all sorts of ugly dividers and multipliers all over the place but it works. I am also wondering if i am supposed to be setting a special "shipping tax" tax zone with a seperate shipping tax class? I have seen a number of different variations on the theme but none seem to have any effect. All is working anyway - the only thing i cant get it to do is add the credit card surcharge tax to the tax total, but i can live with that for the moment. All my order total/OT_XXX.php files are still bog standard oscommerce i have compared them all. I would post the hacks i have done but fear it may be darkly disturbing for some. For now i will get my shop up and running again, and will come back to tweak the code when it calms down a bit. Great add on guys thanks. :thumbsup:
  15. Bozmium

    Multi_Vendor_Shipping new thread

    Hi Jim, Aha! I see! Thanks for getting back. What i will do if that is the case is just disable the rowSelect function so that the clients will have to go by the radio button. Be interested to see if its actually possible to do the way you said. Cheers :thumbsup:
  16. Bozmium

    Multi_Vendor_Shipping new thread

    OK hoping this is the last little niggly bug for the moment. I have developed the ability to replace sleep with vast amounts of caffeine & nicotine and 20 mins of photosynthesis a day but feel i am close enough to make it worthwhile. I have installed the MZMT module into my MVS. It works well so far. My thanks to the author for sharing. One issue: When the customer mouseovers the various shipping options and selects an option, the ROW is selected as per normal but the radiobutton is not selected. Only if the customer clicks directly on top of the radiobutton itself does it actually 'check'. This is of course an unthinkable as i can already see the queue of people lining up to make their inappropriate and innattentive shipping choices, thinking that because the row had highlighted that the button had checked also. I will use the checkout payment as a comparo as it works fine - click anywhere in the highlighted row and the radiobutton is checked. Beautiful. The lines which control this in the standard checkout_shipping are (or appear to be): <?php if ( ($n > 1) || ($n2 > 1) ) { ?> <td class="smalltext"><?php echo $currencies->format($quotes[$i]['methods'][$j]['cost']) . tep_draw_hidden_field('shipping', $quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id'] . '_' . $shipping_tax); ?></td> <td class="smalltext" align="right"><?php echo tep_draw_radio_field('shipping', $quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id'], $checked); ?></td> <?php } else { ?> etc etc. Note how the selection area (made im assuming with the tep hidden field command) runs the entire length of the <td>and the radio button is dropped in the next <td> cell at the end. Groovy. Heres the same line from the modules/vendor_shipping file: <?php if ( ($n > 1) || ($n2 > 1) ) { ?> <td class="smalltext"><?php echo $currencies->format($quotes[$i]['methods'][$j]['cost']); ?></td> <td class="smalltext" align="right"> <?php echo tep_draw_radio_field('shipping_' . $vendor_id, $quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id'] . '_' . $shipping_tax, $checked); echo tep_draw_hidden_field('products_' . $vendor_id, implode("_", $products_ids)); ?> </td> <?php } else { ?> It appears to me that the tep hidden field has been relegated to the very end of the row with the radio button itself, and hence you have to be right on top of it to get it to check. I know enough about my clients to know this is a no no. I have fooled around and shuffled the tep draw radio & tep draw hidden field around and have even copied the lines directly from checkout_shipping into vendor_shipping, and though the figures werent right (expected) the functionality of the rowover and radio button was closer to what it should be. So - anyone, including the author, know a way we can rewrite this to return the ROWover and radio buttons to their original intended function? I know enough to be dangerous and not enough to be useful so all my attempts were met with various abnormal behaviours. I wait with baited breath the sure avalanche of replies. Much bowing and scraping bestowed upon anyone who can offer an alternative! ;) Cheers & thanks! :D
  17. Bozmium

    Multi_Vendor_Shipping new thread

    Hi HallMarc, Tanks for getting back. Yes its the last little thing thats irking me know. I have managed to hack my way to getting most of the other tax figures correct but this one just wont go. Im not sure what it is. I have Chemos tep get tax rate update installed which im thinking might be part of the (but what would i know) but apart from that i have no idea. I have been through all my shipping modules, tax class files and includes which pertain to both MVS and original Oscommerce and for the life of me they all come up comparing ok. ???? Anyway the rest of the mod is pretty smashing and im much happier with how thats working than the one line that isnt. Cheers
  18. Bozmium

    Multi_Vendor_Shipping new thread

    Hi Jim, Thanks for the response, much appreciated. I have checked the line you mentioned in OT_Shipping and it is indeed correct as you indicated. In fact i have compared all my OT files with original Oscommerce files and they are among the few to have escaped unmodded so they are bog standard oscommerce. I have compared all my files from the RC4 rollup package with what i have installed and all match the package. With regards to this line in classes/orders $products_tax = $this->products[$index]['tax']; I realise this is adding product tax only (and doing it correctly) is there a rough hack to tell it to add shipping tax i.e $products_tax = $this->products[$index]['tax']+$shipping_tax[blah blah blah]; I have tried a few different combinations but had little joy. For the moment i may just have to live with it and put a note saying GST figure does not include shipping as i really have to get my shop back online but it is something i will have to come back to. Apart from that - smashing Mod Jim thanks for your hard work! Cheers
  19. Bozmium

    Multi_Vendor_Shipping new thread

    Ok last desperate call for help. I have managed to get my shipping tax issues mostly sorted by simply hardcoding multiplication factors into the variables in classes/order.php as such: Line 158-160 'shipping_method' => $shipping['title'], 'shipping_cost' => $shipping['cost']*1.10, 'shipping_tax' => $shipping['cost']/11, Its rough but gives me the figures i need in my checkout confirmation page EXCEPT FOR THE SHIPPING TAX PAID BEING INCLUDED IN THE TAX FIGURE I.E. Sub-Total: $9.00 (correct) Express Post: $55.00 (correct) Total: $64.00 (correct) GST Paid: $0.82 (WRONG WRONG WRONG - this is product only i.e. 10% on $9.00 - wheres the $5 from the shipping?) This used to work! GRRRRRR Now on line 258 in classes/order.php is this line: $products_tax = $this->products[$index]['tax']; which appears to be controlling the final tax figure for the total. For love nor money i cannot find the appropriate way to force this to also include the shipping tax. IF ANYONE, INCLUDING THE AUTHORS WOULD HAVE ANY HACK, TWEAK OR KNOW WHICH STRING TO MANIPULATE TO THIS CALL TO GET THE SHIPPING TAX TO ADD I WOULD FOREVER GRATEFUL!! You would also be letting me get back into business! Unfortunately i am obliged to show all GST on an order by law - so until i fix this - im off the air and out of business. Everything else is fantastic! Great mod which has improved my systems greatly - except for this one minor irritating point with the shipping tax. Hoping pathetically for a knowledgable suggestion. Cheers! :(
  20. Bozmium

    Multi_Vendor_Shipping new thread

    Well well - now theres an odd one - if i go to shop configuration and set "Display prices with tax" to false - and then run my order through - blow me down the Total tax module is working and shows the correct tax. Unfortunately this doesnt help much as it means everything else is shown ex tax - but its a start - anyone seen this before? (w00t)
  21. Bozmium

    Multi_Vendor_Shipping new thread

    Woohoo! After a bit of further testing this MVS addon rocks. Does exactly what i needed it to do. Many thanks to the authors! Still stuck on the whole Total tax showing without the shipping tax included - which is starting to fool with my head - all else appears to be OK. Have tried a number of tweaks hack and variations but still no joy! I figure it is something to do with the OT_Shipping.php or more likely the OT_TAX.php file but as i know just enough to be dangerous i have no idea where to start looking. If there is anyone with any experience or knowledge in how to tweak the total tax showing on the checkout confirmation page any input would be met with fawning gratitude and ill take the rope down off the rafter! Thanks authors - good mod - hope they make it core - would love to hear any suggestions on the Tax issue if you read this. Cheers :thumbsup:
  22. Bozmium

    Multi_Vendor_Shipping new thread

    Im ready to give up. I have tried setting up shipping zones, classes & rates and applying them in a thousand different combinations. I have managed to fix the issue on the checkout shipping page but tax is still not being carried to the checkout confirmation page - so close yet so far! :huh: As so: Products (Edit) 1 x 2500mAH Rechargeable AA NiMH Batteries - Cased 12 Pack $40.00 Sub-Total: $40.00 TESTING TESTING - Flat rate: $55.00 Total: $95.00 GST PAID: $3.64 (incorrect should be $8.64) Have tried enabling taxes, disabling taxes, fiddling the OT files, changing the order total sort order and applying hacks found in the forums but all to no avail. My head hurts and im going to burst a vein in my eye so might look at this tomorrow. (w00t)
  23. Bozmium

    Multi_Vendor_Shipping new thread

    Aha! Always something stupid isnt it - in the modules/vendors shipping/flat.php i found it was missing line 23: $this->code = 'flat'; How many hours did that little piece of code cost? GRRRRR. :blink: Anyway that gets the module pulling up properly through to Checkout_confirmation - now - where has the shipping tax gone? heheheh we will get there yet! Still showing tax on product only - shipping still being shown ex tax despite being set as 'Taxable goods'. Fooling with setting seperate shipping tax zones as per some other forum suggestions but so far no joy.
  24. Bozmium

    Multi_Vendor_Shipping new thread

    Ok - tried your snippet Jim - no joy - same wierd error - error bar appears - nothing in it and the warning msg appears in the URL - go figure. Compared my classes/Shopping_cart.php with that included in the package - identical. There appears to be a few mods pertaining to $products_id = tep_get_prid($products_id_string); which arent mentioned in the install but do differ from the original so i also included those - no change. Checkout shipping is identical to that included in the package. Cant get the shipping module to activate or 'select and appear in checkout confirmation. Hmmmmm
  25. Bozmium

    Multi_Vendor_Shipping new thread

    Hi Jim, Thanks for that. Can you confirm for me that this code goes in the top of checkout_payment.php after the standard shipping check? As so: // if no shipping method has been selected, redirect the customer to the shipping method selection page if (!tep_session_is_registered('shipping')) { tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); } // MVS //if a shipping method has not been selected for all vendors, redirect the customer to the shipping method selection page if (SELECT_VENDOR_SHIPPING == 'true') { // This test only works under MVS if (!is_array ($shipping['vendor']) || count ($shipping['vendor']) != count ($cart->vendor_shipping)) { // No shipping selected or not all selected tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, 'error_message=' . ERROR_NO_SHIPPING_SELECTED_SELECTED, 'SSL')); } } // MVS end Ill keep grinding through and if i find anything outrageous be sure to let the board know. Ill double check my file as you suggested but i think they are as supplied in the package. Cheers
×