Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

candycanuck

Archived
  • Posts

    53
  • Joined

  • Last visited

About candycanuck

  • Birthday 02/08/1976

Profile Information

candycanuck's Achievements

  1. I have 3 shipping modules in use on my site. All of them set to $0. I have given each of them their own files and definitions. Everything shows up correctly on the shipping screen, but only 1 of the 3 works correctly(Free pickup). This moves on to the payment screen, but the other 2 options just refresh the screen. I get the same results when I change the prices and the sorting order. The files I have customized are: includes>modules>shipping> event_pickup.php pickup.php (this is the working one, the others are modified copies of this) best_ship.php includes>languages>english>modules>shipping> event_pickup.php pickup.php (the others are modified copies of this) best_ship.php Are there more files I need to be modifying? I just did a search and replace for pickup to event_pickup and _PICKUP to _EVENT_PICKUP pickup.php <?php /* $Id: pickup.php,v 1.40 2003/02/05 22:41:52 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ class pickup { var $code, $title, $description, $icon, $enabled; // class constructor function pickup() { global $order; $this->code = 'pickup'; $this->title = MODULE_SHIPPING_PICKUP_TEXT_TITLE; $this->description = MODULE_SHIPPING_PICKUP_TEXT_DESCRIPTION; $this->sort_order = MODULE_SHIPPING_PICKUP_SORT_ORDER; $this->icon = ''; $this->enabled = ((MODULE_SHIPPING_PICKUP_STATUS == 'True') ? true : false); } // class methods function quote($method = '') { global $order; $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_PICKUP_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => MODULE_SHIPPING_PICKUP_TEXT_WAY, 'cost' => MODULE_SHIPPING_PICKUP_COST))); if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title); 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_PICKUP_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 Customer Pickup', 'MODULE_SHIPPING_PICKUP_STATUS', 'True', 'Do you want to offer Customer Pickup?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shipping Cost', 'MODULE_SHIPPING_PICKUP_COST', '0.00', 'The shipping cost for all orders using this shipping method.', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_PICKUP_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())"); } function remove() { tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } function keys() { return array('MODULE_SHIPPING_PICKUP_STATUS', 'MODULE_SHIPPING_PICKUP_COST', 'MODULE_SHIPPING_PICKUP_SORT_ORDER'); } } ?> event_pickup.php <?php /* $Id: event_pickup.php,v 1.40 2003/02/05 22:41:52 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ class event_pickup { var $code, $title, $description, $icon, $enabled; // class constructor function event_pickup() { global $order; $this->code = 'event_pickup'; $this->title = MODULE_SHIPPING_EVENT_PICKUP_TEXT_TITLE; $this->description = MODULE_SHIPPING_EVENT_PICKUP_TEXT_DESCRIPTION; $this->sort_order = MODULE_SHIPPING_EVENT_PICKUP_SORT_ORDER; $this->icon = ''; $this->enabled = ((MODULE_SHIPPING_EVENT_PICKUP_STATUS == 'True') ? true : false); } // class methods function quote($method = '') { global $order; $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_EVENT_PICKUP_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => MODULE_SHIPPING_EVENT_PICKUP_TEXT_WAY, 'cost' => MODULE_SHIPPING_EVENT_PICKUP_COST))); if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title); 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_EVENT_PICKUP_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 Event Pickup', 'MODULE_SHIPPING_EVENT_PICKUP_STATUS', 'True', 'Do you want to offer Event Pickup?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shipping Cost', 'MODULE_SHIPPING_EVENT_PICKUP_COST', '0.00', 'The shipping cost for all orders using this shipping method.', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_EVENT_PICKUP_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())"); } function remove() { tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } function keys() { return array('MODULE_SHIPPING_EVENT_PICKUP_STATUS', 'MODULE_SHIPPING_EVENT_PICKUP_COST', 'MODULE_SHIPPING_EVENT_PICKUP_SORT_ORDER'); } } ?>
  2. In case you folks are scared to help because of a full page of code, here is the part that I believe needs changing. But since I don't know what the . means in this context, I don't know what to change it to. /*== upload directory where the file will be stored relative to where script is run ==*/ $uploaddir = ".";
  3. I have put together a Community Partners page with a backend that allows you to add the text plus upload an image of your business card. It is functioning as is. But, I want to reorganize so all the images go into /images/partners Right now it goes to the root. I borrowed this code from somewhere else, so I don't know where to define the upload location. Anyone can help? View online <?php /* $Id: conditions.php,v 1.22 2003/06/05 23:26:22 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CONDITIONS)); ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <title><?php echo TITLE; ?></title> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <?php if ($_SERVER['REQUEST_METHOD'] == "POST") { /* SUBMITTED INFORMATION - use what you need * temporary filename (pointer): $imgfile * original filename : $imgfile_name * size of uploaded file : $imgfile_size * mime-type of uploaded file : $imgfile_type */ /*== upload directory where the file will be stored relative to where script is run ==*/ $uploaddir = "."; /*== get file extension (fn at bottom of script) ==*/ /*== checks to see if image file, if not do not allow upload ==*/ $pext = getFileExtension($imgfile_name); $pext = strtolower($pext); if (($pext != "jpg") && ($pext != "jpeg")) { print "<h1>ERROR</h1>Image Extension Unknown.<br>"; print "<p>Please upload only a JPEG image with the extension .jpg or .jpeg ONLY<br><br>"; print "The file you uploaded had the following extension: $pext</p>\n"; /*== delete uploaded file ==*/ unlink($imgfile); exit(); } //-- RE-SIZING UPLOADED IMAGE /*== only resize if the image is larger than 250 x 200 ==*/ $imgsize = GetImageSize($imgfile); /*== check size 0=width, 1=height ==*/ if (($imgsize[0] > 250) || ($imgsize[1] > 250)) { /*== temp image file -- use "tempnam()" to generate the temp file name. This is done so if multiple people access the script at once they won't ruin each other's temp file ==*/ $tmpimg = tempnam("/tmp", "MKUP"); /*== RESIZE PROCESS 1. decompress jpeg image to pnm file (a raw image type) 2. scale pnm image 3. compress pnm file to jpeg image ==*/ /*== Step 1: djpeg decompresses jpeg to pnm ==*/ system("djpeg $imgfile >$tmpimg"); /*== Steps 2&3: scale image using pnmscale and then pipe into cjpeg to output jpeg file ==*/ system("pnmscale -xy 250 200 $tmpimg | cjpeg -smoo 10 -qual 50 >$imgfile"); /*== remove temp image ==*/ unlink($tmpimg); //print "Error Uploading File - Too large."; // exit(); } /*== setup final file location and name ==*/ /*== change spaces to underscores in filename ==*/ $final_filename = str_replace(" ", "_", $imgfile_name); $newfile = $uploaddir . "/$final_filename"; /*== do extra security check to prevent malicious abuse==*/ if (is_uploaded_file($imgfile)) { /*== move file to proper directory ==*/ if (!copy($imgfile,"$newfile")) { /*== if an error occurs the file could not be written, read or possibly does not exist ==*/ print "Error Uploading File."; exit(); } } /*== delete the temporary uploaded file ==*/ unlink($imgfile); print("<img src=\"$final_filename\">"); /*== DO WHATEVER ELSE YOU WANT SUCH AS INSERT DATA INTO A DATABASE ==*/ } ?> <!-- header_eof //--> <!-- body //--> <!-- Start code --> <tr><td valign="top"> <table border="0" cellspacing="0" cellpadding="0"> <tr><td width="212" valign="top"><?php require(DIR_WS_INCLUDES . 'column_left.php'); ?></td> <td width="4"></td> <td width="502" valign="top"> <table border="0" cellspacing="0" cellpadding="0"> <tr><td height="2" bgcolor="#919191" width="502"></td></tr> <tr><td height="28" bgcolor="#003471" width="490" style="padding-left:22px;"><span class="tx2">Community Partners</span></td></tr> </table> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr><td class="smallText_11"> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr> <td class="main"> <? # connect to database $cid = mysql_connect(DB_SERVER,DB_SERVER_USERNAME,DB_SERVER_PASSWORD); if (!$cid) { echo("ERROR: " . mysql_error() . "\n"); } ?> <table width="100%" border="1" cellpadding="5"> <tr bgcolor="#336699"> <td align="center"><a href=partners.php>View Partners</a></td> <td align="center"><a href=insert_partner.php>Add Partners</a></td> <td align="center"><a href=manage.php>Edit Partners</a></td> <td align="center"><a href=upload.php>Upload Image</a></td> </tr> </table> **Note**<br> <span class="style1"><font color="#CC0033">Image MUST be no more than 250x250px and MUST be a jpeg or jpg file. <br> If upload error occurs, use BACK button to try again.</font></span> <form action="<?php echo $_SERVER['community/PHP_SELF']; ?>" method="POST" enctype="multipart/form-data"> <input type="hidden" name="MAX_FILE_SIZE" value="100000"> <p>Upload Image: <input type="file" name="imgfile"><br> <font size="1">Click browse to upload a local file</font><br> <br> <input type="submit" value="Upload Image"> </form> </body> </html> <?php /*== FUNCTIONS ==*/ function getFileExtension($str) { $i = strrpos($str,"."); if (!$i) { return ""; } $l = strlen($str) - $i; $ext = substr($str,$i+1,$l); return $ext; } ?> </td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr> </table> <!-- body_eof //--> </td></tr> </table> <!-- body_eof //--> <!-- End code --> </td> </tr> </table> </td></tr> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
  4. I have found a number of contributions that will sort the attributes within the drop down box. But I can't find one that will sort what order the drop down boxes appear in. i.e. order options display... Back Art Colour Size Setup Fee Front Art correct order... Colour Size Front Art Back Art Setup Fee I expect I just need to add one more column to a table. And change some SQL statements to have ORDER BY ... but I don't know which SQL statements to look at so the order carries throughout the checkout process and into the confirmation email.
  5. I don't know if this is the answer you need or not. But I noticed this note/code in the bottom of my catalog/includes/functions/general.php // nl2br() prior PHP 4.2.0 did not convert linefeeds on all OSs (it only converted \n) function tep_convert_linefeeds($from, $to, $string) { if ((PHP_VERSION < "4.0.5") && is_array($from)) { return ereg_replace('(' . implode('|', $from) . ')', $to, $string); } else { return str_replace($from, $to, $string); } } Maybe try adding that function to see if it handles the linefeeds any better?
  6. I'm trying to MERGE Option_Type_Feature_1[1].7.2.zip into my existing site and I am having difficulty figuring out what goes where on one file in particular... catalog/includes/functions/general.php My file looks nothing like the sample given. Is this a step I can skip? or can someone help me figure out what my custom updates are. Here is a copy of the contribution tep_get_uprid // Return a product ID with attributes function tep_get_uprid($prid, $params) { $uprid = $prid; if ( (is_array($params)) && (!strstr($prid, '{')) ) { while (list($option, $value) = each($params)) { //CLR 030714 Add processing around $value. This is needed for text attributes. $uprid = $uprid . '{' . $option . '}' . htmlspecialchars(stripslashes(trim($value)), ENT_QUOTES); } //CLR 030228 Add else stmt to process product ids passed in by other routines. } else { $uprid = htmlspecialchars(stripslashes($uprid), ENT_QUOTES); } return $uprid; } //// // Return a product ID from a product ID with attributes Here is a copy of my tep_get_uprid. // Return a product ID with attributes function tep_get_uprid($prid, $params) { if (is_numeric($prid)) { $uprid = $prid; if (is_array($params) && (sizeof($params) > 0)) { $attributes_check = true; $attributes_ids = ''; reset($params); while (list($option, $value) = each($params)) { if (is_numeric($option) && is_numeric($value)) { $attributes_ids .= '{' . (int)$option . '}' . (int)$value; } else { $attributes_check = false; break; } } if ($attributes_check == true) { $uprid .= $attributes_ids; } } } else { $uprid = tep_get_prid($prid); if (is_numeric($uprid)) { if (strpos($prid, '{') !== false) { $attributes_check = true; $attributes_ids = ''; // strpos()+1 to remove up to and including the first { which would create an empty array element in explode() $attributes = explode('{', substr($prid, strpos($prid, '{')+1)); for ($i=0, $n=sizeof($attributes); $i<$n; $i++) { $pair = explode('}', $attributes[$i]); if (is_numeric($pair[0]) && is_numeric($pair[1])) { $attributes_ids .= '{' . (int)$pair[0] . '}' . (int)$pair[1]; } else { $attributes_check = false; break; } } if ($attributes_check == true) { $uprid .= $attributes_ids; } } } else { return false; } } return $uprid; } //// // Return a product ID from a product ID with attributes
  7. I just added a contribution to mine that may help. Quantity Price Break per Product One of the features on it is that it will round to the nearest value you want. i.e. If the customer indicates 37 sq ft and you want to sell in lots of 25 sq ft, it will round up and sell them 50 sq ft. You also have the option to give them a discount if they buy lots, but it is optional. It won't have a calculator to do the multiplying though, so you would need to add basic instructions to your site.
  8. I know someone who is using that contribution successfully in his shop. He is using version 1.7.1 I will be adding it to mine as well. But I am having problems with another contribution I want to fix before opening a new can of worms. Good luck.
  9. Would this idea work? Instead of using a mod, just use attributes. i.e. 10lb box of candy - up to 5 different choices candy choice 1 ... all candy choices available candy choice 2 ... all candy choices available + no 2nd option candy choice 3 ... all candy choices available + no 3rd option candy choice 4 ... all candy choices available + no 4th option candy choice 5 ... all candy choices available + no 5th option This way they could choose all the same or any variety they wanted. You would prepare it with equal amounts of each.. unless they chose one item more than once, indicating a desire to have more of that than the rest.
  10. I have just installed 3 contributions. I did some testing after each one, and didn't notice any problems until the 3rd was added. Here is what I added.. in order. Product Setup Fee Linkmatics Attributes Sets Plus Quantity Price Break per Product Here is what I see in checkout: Attributes display correctly Setup displays correctly Total (per Item) displays correctly Subtotal displays incorrectly >> Base price + Setup (no attribute values) NOTE: The correct values are being carried forward to the rest of the checkout and display properly on checkout_confirmation.php NOTE 2: After the first (& 2nd) contribution, Setup fees appeared in red with the attributes. They were not being added to the product total, but were adding to the Subtotal. All the math was working fine. Current Site: www.tcsnaturals.ca/ppstore
  11. Bringing up an old topic that I havn't seen a reply to yet.... I'm trying to show the final price, including discounts BEFORE the customer is asked for their payment information. Does anyone have any ideas on how to do this? I've tried changing the page the discount code is entered on, but I have not been able to make it a functional entry field when I do that.
  12. In order to receive the notification email, you have to enter the address you want it sent to. Admin > Configuration > My Store > Send Extra Order Emails To Hope that helps
  13. Is this the issue with having Debug mode turned on? Try switching your setting on this and see if it helps. Admin > Modules > Order Totals > Discount Coupons
  14. Are you finding this issue when the discount is applied to any order or just specific ones? I was finding a similar issue when I had a $0 item in my cart. Try checking for patterns if it is not consistent. Also, You want to use this as a GC? Keep in mind, those should normally be applied after tax, not before. A flat rate discount is more like a coupon when handled by this mod. The difference this will make depends on the tax rate you have. I posted an example about 2 screens back if you want to see.
  15. Louise, Did you check your database to see if the new tables were installed? and if all the columns are correct?
×
×
  • Create New...