Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

sopinon

Members
  • Content count

    12
  • Joined

  • Last visited

Profile Information

  • Real Name
    Silent Bob
  1. sopinon

    [Contribution] Auction Module

    As I promised some month ago, here is my showcase of this contribution. I've implemented this contribution here: http://www.rogerfederershop.com/osc/auctions.php (official Roger Federer Store) As you can see, there are some more features than in the default contribution. I will implement it in the auctions contribution when I have time...
  2. sites with "www.rogerfederershop.com/cms" are Typo3 content sites, and sites with "www.rogerfederershop.com/osc" are osCommerce Sites. You don't really see a difference between typo3 and OSC, because the Templates are quite similar. In Typo3, the Menu Point "Shop" is only a redirect to "osc/index.php"... It points to Typo3, but it redirects back to OSC.
  3. This Contribution explains how you can display a Typo3 Navigation in your osCommerce Store. (Without iFrames!!) With this solution, you can use Typo3 for content Sites, and osCommerce for the Product and Checkout Part. osCommerce caches the loaded Typo3 Navigation. After 3 hours the navigation will be reloaded. With this solution you can safe a lot of performance. I've used this contribution for the official Roger Federer Store: http://www.rogerfederershop.com The Contribution is splitted in 2 Parts: - Typo3 Part "1_Typo3_Part.txt" - and osCommerce Part "2_osCommerce_Part.txt" Contribution: http://www.oscommerce.com/community/contributions,5109
  4. Hi there, I have only one Shipping Module active (Swiss Post Shipping). This Shipping module is based on "Zones Rates". It work's fine. But I want to extend this module... If there are Products in the Shopping Cart from different Product Categories. It should split the shipping in "n"-boxes (one per Category). Example: Categories: T-Shirts, Shoes Shopping Cart: 1 T-Shirt blue 0.5 k weight 1 T-Shirt red 0.5k weight 1 Nike Shoes 1.5k weight Shipping Boxes: (1 x 1k) -> price (1 x 1.5k) -> price How could i implement this? Here is the link to the Swiss Post Shipping Contribution (only 1 php module file): http://www.oscommerce.com/community/contributions,997 <?php /* $Id: chp.php,v 1.02 2003/02/18 03:37:00 harley_vb Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2002 - 2003 osCommerce Released under the GNU General Public License Patches: - tom 001: Prices changed per 27.7.2006 */ /******************************************************************** * Copyright (C) 2001 - 2003 TheMedia, Dipl.-Ing Thomas Plänkers * http://www.themedia.at & http://www.oscommerce.at * * All rights reserved * * This program is free software licensed under the GNU General Public License (GPL). * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * *********************************************************************/ class chp { var $code, $title, $description, $icon, $enabled, $num_chp, $types; // class constructor function chp() { global $order; $this->code = 'chp'; $this->title = MODULE_SHIPPING_CHP_TEXT_TITLE; $this->description = MODULE_SHIPPING_CHP_TEXT_DESCRIPTION; $this->sort_order = MODULE_SHIPPING_CHP_SORT_ORDER; $this->icon = DIR_WS_ICONS . 'shipping_chp.gif'; $this->tax_class = MODULE_SHIPPING_CHP_TAX_CLASS; $this->enabled = ((MODULE_SHIPPING_CHP_STATUS == 'True') ? true : false); if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_CHP_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_CHP_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; } } $this->types = array('ECO' => 'Economy', 'PRI' => 'Priority', 'URG' => 'Urgent'); // CUSTOMIZE THIS SETTING FOR THE NUMBER OF ZONES NEEDED $this->num_chp = 6; // ch + 5 Zonen } // class methods function quote($method = '') { global $HTTP_POST_VARS, $order, $shipping_weight, $shipping_num_boxes; $dest_country = $order->delivery['country']['iso_code_2']; $dest_zone = 0; $error = false; if ($shipping_weight - SHIPPING_BOX_WEIGHT == 0) $free_shipping = 0; else $free_shipping = 1; for ($j=1; $j<=$this->num_chp; $j++) { $countries_table = constant('MODULE_SHIPPING_CHP_COUNTRIES_' . $j); $country_zones = split("[,]", $countries_table); if (in_array($dest_country, $country_zones)) { $dest_zone = $j; break; } } if ($dest_zone == 0) { $error = true; } else { $shipping = -1; $chp_cost_eco = @constant('MODULE_SHIPPING_CHP_COST_ECO_' . $j); $chp_cost_pri = @constant('MODULE_SHIPPING_CHP_COST_PRI_' . $j); $chp_cost_urg = @constant('MODULE_SHIPPING_CHP_COST_URG_' . $j); $methods = array(); if ($chp_cost_eco != '') { $chp_table_eco = split("[:,]" , $chp_cost_eco); for ($i=0; $i<sizeof($chp_table_eco); $i+=2) { if ($shipping_weight <= $chp_table_eco[$i]) { $shipping_eco = $chp_table_eco[$i+1]; break; } } if ($shipping_eco == -1) { $shipping_cost = 0; $shipping_method = MODULE_SHIPPING_CHP_UNDEFINED_RATE; } else { $shipping_cost_1 = ($shipping_eco + MODULE_SHIPPING_CHP_HANDLING); } if ($shipping_eco != 0) { $methods[] = array('id' => 'ECO', 'title' => 'Economy', 'cost' => (MODULE_SHIPPING_CHP_HANDLING + $shipping_cost_1) * $shipping_num_boxes * $free_shipping); } } if ($chp_cost_pri != '') { $chp_table_pri = split("[:,]" , $chp_cost_pri); for ($i=0; $i<sizeof($chp_table_pri); $i+=2) { if ($shipping_weight <= $chp_table_pri[$i]) { $shipping_pri = $chp_table_pri[$i+1]; break; } } if ($shipping_pri == -1) { $shipping_cost = 0; $shipping_method = MODULE_SHIPPING_CHP_UNDEFINED_RATE; } else { $shipping_cost_2 = ($shipping_pri + MODULE_SHIPPING_CHP_HANDLING); } if ($shipping_pri != 0) { $methods[] = array('id' => 'PRI', 'title' => 'Priority', 'cost' => (MODULE_SHIPPING_CHP_HANDLING + $shipping_cost_2) * $shipping_num_boxes * $free_shipping); } } if ($chp_cost_urg != '') { $chp_table_urg = split("[:,]" , $chp_cost_urg); for ($i=0; $i<sizeof($chp_table_urg); $i+=2) { if ($shipping_weight <= $chp_table_urg[$i]) { $shipping_urg = $chp_table_urg[$i+1]; break; } } if ($shipping_urg == -1) { $shipping_cost = 0; $shipping_method = MODULE_SHIPPING_CHP_UNDEFINED_RATE; } else { $shipping_cost_3 = ($shipping_urg + MODULE_SHIPPING_CHP_HANDLING); } if ($shipping_urg != 0) { $methods[] = array('id' => 'URG', 'title' => 'Urgent', 'cost' => (MODULE_SHIPPING_CHP_HANDLING + $shipping_cost_3) * $shipping_num_boxes * $free_shipping); } } } $this->quotes = array('id' => $this->code, 'module' => $this->title . ' (' . $shipping_num_boxes . ' x ' . $shipping_weight . ' ' . MODULE_SHIPPING_CHP_TEXT_UNITS .')'); $this->quotes['methods'] = $methods; if ($this->tax_class > 0) { $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']); } if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title); if ($error == true) $this->quotes['error'] = MODULE_SHIPPING_CHP_INVALID_ZONE; if ( (tep_not_null($method)) && (isset($this->types[$method])) ) { for ($i=0; $i<sizeof($methods); $i++) { if ($method == $methods[$i]['id']) { $methodsc = array(); $methodsc[] = array('id' => $methods[$i]['id'], 'title' => $methods[$i]['title'], 'cost' => $methods[$i]['cost']); break; } } $this->quotes['methods'] = $methodsc; } 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_CHP_STATUS'"); $this->_check = tep_db_num_rows($check_query); } return $this->_check; } function install() { // (...) Configuration (...) skipped } function remove() { tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } function keys() { $keys = array('MODULE_SHIPPING_CHP_STATUS', 'MODULE_SHIPPING_CHP_HANDLING', 'MODULE_SHIPPING_CHP_TAX_CLASS', 'MODULE_SHIPPING_CHP_ZONE', 'MODULE_SHIPPING_CHP_SORT_ORDER'); for ($i=1; $i <= $this->num_chp; $i++) { $keys[count($keys)] = 'MODULE_SHIPPING_CHP_COUNTRIES_' . $i; $keys[count($keys)] = 'MODULE_SHIPPING_CHP_COST_ECO_' . $i; $keys[count($keys)] = 'MODULE_SHIPPING_CHP_COST_PRI_' . $i; $keys[count($keys)] = 'MODULE_SHIPPING_CHP_COST_URG_' . $i; } return $keys; } } ?>
  5. sopinon

    [Contribution] Auction Module

    And special thanks to you, starting this contribibution... It saved my a lot of development time... I'm working on a bigger shop Project. The Auction is a big part of this Project. The shop will go public in 2 weeks. I will inform you about it... beside the countdown, I've also solved some other problems. At the moment I want to implement a short overview of the Auction "winners" in the back end.
  6. sopinon

    [Contribution] Auction Module

    The Countdown was very buggy (all solutions) and to complicated... so i've fixed it. All you have to do is: In includes/modules/auction_bids.php replace following line: $datetime_count_down = tep_date_count_down($auction_infor['expires_date']); with: $datetime_count_down = strtotime($auction_infor['expires_date'])-time(); The function tep_date_count_down is not used anymore! Also replace the Javascript Code on the bottom of the file with this: <script type="text/javascript"> var tz = 0; // Offset for your timezone in hours from UTC var lab = 'countdown_date'; // The id of the page entry where the timezone countdown is to show function start() {displayTZCountDown(<?=$datetime_count_down?>,lab);} // ** The start function can be changed if required ** window.onload = start(); ////////// DO NOT EDIT PAST THIS LINE ////////////////// function displayTZCountDown(countdown,tzcd) { if (countdown < 0) document.getElementById(tzcd).innerHTML = "Sorry, you are too late."; else {var secs = countdown % 60; if (secs < 10) secs = '0'+secs; var countdown1 = (countdown - secs) / 60; var mins = countdown1 % 60; if (mins < 10) mins = '0'+mins; countdown1 = (countdown1 - mins) / 60; var hours = countdown1 % 24; var days = (countdown1 - hours) / 24; document.getElementById(tzcd).innerHTML = days + " <?php echo COUNTDOWN_DAYS; ?> "+hours+ '<?php echo COUNTDOWN_HOURS; ?>'+' : ' +mins+ '<?php echo COUNTDOWN_MINS; ?> : '+secs+'<?php echo COUNTDOWN_SECS;?>'; setTimeout('displayTZCountDown('+(countdown-1)+',\''+tzcd+'\');',999); } } </SCRIPT> so you don't need the Javascript Function setTZCountDown(month,day,hour,tz)... it is much more easy than the old "solution" and it's always displaying the correct countdown...
×