Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Juto

Pioneers
  • Posts

    365
  • Joined

  • Last visited

  • Days Won

    2

Juto last won the day on July 21 2011

Juto had the most liked content!

Profile Information

  • Real Name
    Sara
  • Gender
    Female
  • Interests
    http://www.oscommerce.com/forums/topic/364291-oscommerce-v-23-when/page__st__260__p__1544272__hl__juto__fromsearch__1#entry1544272
  • Website

Recent Profile Visitors

36,683 profile views

Juto's Achievements

  1. @@kymation Goodmorning Jim, yes you are quite right, i.e the closing right parenthesis is within: eval('$keys .= ' . $value['set_function'] . "'" . $value['value'] . "', '" . $key . "');"); I see now that the db insert needs to be that way, otherwise the $value and the $key would be left out from the function. So it's not a bug, it was a learning lesson for me! Thanks Jim! Sara
  2. @@kymation Hi Jim and thanks for looking into this. However I do believe that the number of parenthesis must match, also in the insert list, the last parameters are: set_function, date_added That is, date_added is not part of the set_function. I cant beleive that this is correct: 1) tep_cfg_select_option(array(\'true\', \'false\'), ', now()) When looking at the function itself: 2) function tep_cfg_select_option($select_array, $key_value, $key = '') I can't see how 1) can match... kindly advice Thanks for looking, Jim. Hopefully this can be resolved. Sara
  3. Hi again, I've just reported this as a major bug in all modules... :) Sara
  4. @@Bob Terveuren Hi Bob, thanks for trying to install it. I am sorry for my late answer, I had to be at the doctors for a tiny op. First this line: $this->enabled = ((defined('MODULE_DOMESTICDELIVERY_STATUS') && (MODULE_DOMESTICDELIVERY_STATUS == 'true')) ? true : false); Should be: $this->enabled = ((defined('MODULE_DOMESTICDELIVERY_STATUS') && (MODULE_DOMESTICDELIVERY_STATUS == 'True')) ? true : false); Then, I think I've found a major bug, which concerns every module: This is the function tep_cfg_select_option($select_array, $key_value, $key = '') Used in the install code. As an example in the ot_loworder_fee we have: 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 ('Display Low Order Fee', 'MODULE_ORDER_TOTAL_LOWORDERFEE_STATUS', 'true', 'Do you want to display the low order fee?', '6', '1','tep_cfg_select_option(array(\'true\', \'false\'), ', now())"); A closer look at the line reveals that there are 6 left parenthesis, (, but only 5 right parenthesis, ), So they don't match up! The error seems to be here: tep_cfg_select_option(array(\'true\', \'false\'), ', now()) which should correspond to: set_function, date_added I seems to me that the above should read: tep_cfg_select_option(array(\'true\', \'false\'), '', ''), now() That is, the array is array(\'true\', \'false\') while the $key_value and $key are not set, maby they should be? Thoughts? Sara
  5. @@Bob Terveuren Hi! Thank you for answer, those lines are unchanged from the zones.php module. And at the end of that function there's this line: if ($error == true) $this->quotes['error'] = MODULE_DOMESTICDELIVERY_INVALID_ZONE; just before the quotes are returned. Since "MODULE_DOMESTICDELIVERY_INVALID_ZONE" isn't displayed I don't think that the problem is with the quotes. O' my... I am really lost.. Sara
  6. Hi, I have duplicated zones.php (incl. language files) in order to offer 5 shipping options from economy mail to ship as gift. Since I didn't like to input the table date each time while testing, also included those tables in the code: At the admin side it shows up as expected, but no options shows on the catalog side plus, the actual payment (money order) doesn't show I only get "This is the only payment method available..." The buying process goes through, despite the above. So, I need any advice to make this work: <?php /* DomesticDelivery.php based upon: $Id: zones.php 1739 2007-12-20 00:52:16Z hpdl $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ class DomesticDelivery { var $code, $title, $description, $enabled, $num_zones; // class constructor function DomesticDelivery() { $this->code = 'DomesticDelivery'; $this->icon = DIR_WS_IMAGES . 'shipping/posten_logo_small.gif'; $this->title = (defined('MODULE_DOMESTICDELIVERY_TEXT_TITLE') ? 'Posten Logistik AB: '. MODULE_DOMESTICDELIVERY_TEXT_TITLE .' Valid From 2013-01-01' : null); $this->description = (defined('MODULE_DOMESTICDELIVERY_TEXT_DESCRIPTION') ? MODULE_DOMESTICDELIVERY_TEXT_DESCRIPTION : null); $this->sort_order = (defined('MODULE_DOMESTICDELIVERY_SORT_ORDER') ? MODULE_DOMESTICDELIVERY_SORT_ORDER : 0); $this->tax_class = (defined('MODULE_DOMESTICDELIVERY_TAX_CLASS') ? MODULE_DOMESTICDELIVERY_TAX_CLASS : null); $this->enabled = ((defined('MODULE_DOMESTICDELIVERY_STATUS') && (MODULE_DOMESTICDELIVERY_STATUS == 'true')) ? true : false); // CUSTOMIZE THIS SETTING FOR THE NUMBER OF ZONES NEEDED $this->num_zones = 5; } // class methods function quote($method = '') { global $order, $shipping_weight, $shipping_num_boxes; $dest_country = $order->delivery['country']['iso_code_2']; $dest_zone = 0; $error = false; for ($i=1; $i<=$this->num_zones; $i++) { $countries_table = constant('MODULE_DOMESTICDELIVERY_COUNTRIES_' . $i); $country_zones = preg_split("/[,]/", $countries_table); if (in_array($dest_country, $country_zones)) { $dest_zone = $i; break; } } if ($dest_zone == 0) { $error = true; } else { $shipping = -1; $zones_cost = constant('MODULE_DOMESTICDELIVERY_COST_' . $dest_zone); $zones_table = preg_split("/[:,]/" , $zones_cost); $size = sizeof($zones_table); for ($i=0; $i<$size; $i+=2) { if ($shipping_weight <= $zones_table[$i]) { $shipping = $zones_table[$i+1]; $shipping_method = MODULE_DOMESTICDELIVERY_TEXT_WAY . ' ' . $dest_country . ' : ' . $shipping_weight . ' ' . MODULE_DOMESTICDELIVERY_TEXT_UNITS; break; } } if ($shipping == -1) { $shipping_cost = 0; $shipping_method = MODULE_DOMESTICDELIVERY_UNDEFINED_RATE; } else { $shipping_cost = ($shipping * $shipping_num_boxes) + constant('MODULE_DOMESTICDELIVERY_HANDLING_' . $dest_zone); } } $this->quotes = array('id' => $this->code, 'module' => MODULE_DOMESTICDELIVERY_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => $shipping_method, 'cost' => $shipping_cost))); if ($this->tax_class > 0) { $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']); } if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title); if ($error == true) $this->quotes['error'] = MODULE_DOMESTICDELIVERY_INVALID_ZONE; return $this->quotes; } function check() { if (!isset($this->_check)) { $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_DOMESTICDELIVERY_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 Zones Method', 'MODULE_DOMESTICDELIVERY_STATUS', 'True', 'Do you want to offer zone rate shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_DOMESTICDELIVERY_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_DOMESTICDELIVERY_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())"); for ($i = 1; $i <= $this->num_zones; $i++) { $current_rate = null; switch ($i) { case 1: //Zon 1 = option 1, MailEconomy shipping rate: $current_rate = '0.020:5.50,0.100:11.00,0.250:22.00,0.500:33.00,1.00:44.00,2.00:66.00,10000:0.00'; break; case 2: //Zon 2 = option 2, MailPrioritaire shipping rate: $current_rate = '0.020:6.00,0.100:12.00,0.250:24.00,0.500:36.00,1.00:48.00,2.00:72.00,10000:0.00'; break; case 3: //Zon 3 = option 3, MailPrioritaireRek shipping rate: $current_rate = '0.020:71.00,0.100:77.00,0.250:89.00,0.500:101.00,1.00:113.00,2.00:137.00,10000:0.00'; break; case 4: //Zon 4 = option 4, Parcel shipping rate: $current_rate = '3.00:155.00,5.00:185.00,10.00:235.00,15.00:285.00,20.00:330.00,10000:0.00'; break; //Zon 5 = option 5, ParcelGift shipping rate: case 5: $current_rate = '2.00:55.00,10000:0.00'; break; } $default_countries = 'SE'; tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone " . $i ." Countries', 'MODULE_DOMESTICDELIVERY_COUNTRIES_" . $i ."', '" . $default_countries . "', 'Comma separated list of two character ISO country codes that are part of Zone " . $i . ".', '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 ('Zone " . $i ." Shipping Table', 'MODULE_DOMESTICDELIVERY_COST_" . $i ."', '" . $current_rate . "', 'Shipping rates to Zone " . $i . " destinations based on a group of maximum order weights. Example: 3:8.50,7:10.50,... Weights less than or equal to 3 would cost 8.50 for Zone " . $i . " destinations.', '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 ('Zone " . $i ." Handling Fee', 'MODULE_DOMESTICDELIVERY_HANDLING_" . $i."', '0', 'Handling Fee for this shipping zone', '6', '0', now())"); } } function remove() { tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } function keys() { $keys = array('MODULE_DOMESTICDELIVERY_STATUS', 'MODULE_DOMESTICDELIVERY_TAX_CLASS', 'MODULE_DOMESTICDELIVERY_SORT_ORDER'); for ($i=1; $i<=$this->num_zones; $i++) { $keys[] = 'MODULE_DOMESTICDELIVERY_COUNTRIES_' . $i; $keys[] = 'MODULE_DOMESTICDELIVERY_COST_' . $i; $keys[] = 'MODULE_DOMESTICDELIVERY_HANDLING_' . $i; } return $keys; } } ?> I have tried for ages, but ... what ever I've tried didn't make it. I've looked and searched in the forums and with google... and I am at a stand still. Please advice me. I need this going. Many thanks Sara
  7. Goodmorning to all of you. While trying to find why duplicating a shipping module to a "store_pickup" isn't working I installed the zone based shipping module... (which worked) I found that it is indeed possible to get two taxes on the checkout confirmation page, if you also have enabled order total. This is possible since they are independent on each other. So, it's a bug, not a feature wrt to have separate outputs of taxes and shipping. "Early bird catches the world..." Sara
  8. Hi Jim, first of I'd like to congratulate you for product specifications. I have glanced through the pdf file and I am amazed of your work. Very good indeed! Many thanks for this, albeit I haven't installed it yet... Here's my set: I have upgraded from rc2a to v2.3.3 and the store is heavily modified and do have template_top and _bottom. But it doesn't have the jquery ui interface nor includes/modules/bm_boxes, I still have to add the boxes the old way. Here's what I would love to have: When adding a new product: Input fields for where the product is located, like so: Field 1) Annex Field 2) Etage Field 3) Alley Field 4) Rack Field 5) Box I know there's an addon "Product Location", but it have only one input field, which is not enough. And I think that the addon requires a lot of code changes which I can't realise as nescessary. My thinking is that the above fields could be concatenated into one variable with a suitable delimeter, a colon perhaps and having a separate database table "productlocation" carrying the above concatenated field plus the products id for that location. Then, on the packing slip, split that concatenated field into its components and add it. So I wonder if product specifications can do the job? Next, I have looked into the year make model addon (both of them) , the original have an auto installer which simply cant be used, due to all my edits on my site. The 2.3.1 version requires the jquery ui, which I do not have, nor plan to install either. It seems to me that product specifications will do a very good job on this, but how? Hopefully you can advise me on these two matters. Greetings and thanks Sara
  9. With this addon you can remove a manufacturers image under action=edit, without removing the manufacturer. Should work with any 2.x version tested and verified without problems in a live RC2a shop. Find it here: http://addons.oscommerce.com/info/8681 Enjoy! Sara
  10. @bruyndoncxHi Carine, thanks for your advice. I have managed to get it working apart from the preview page. Reading your post I realize that I need to split up the logic a bit, at least for debugging. So big thank you to you. :) There's a bit confusing when the preview page is like this: <td class="main"><?php echo tep_image(DIR_WS_CATALOG_IMAGES . $products_image_name, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="right" class="image-margins"') . $pInfo->products_description; ?></td> That is, using DIR_WS_CATALOG_IMAGES, instead of DIR_FS_CATALOG_IMAGES used during upload... So, I do have some work to do. Thanks again for your advice :) Sara
  11. Hi, I am working on a new contribution for default product images directory. That is set the directory as the manufacturers name. So far I have this piece, which isn't enough: <?php /* //Replaced // copy image only if modified $products_image = new upload('products_image'); $products_image->set_destination(DIR_FS_CATALOG_IMAGES); if ($products_image->parse() && $products_image->save()) { $products_image_name = $products_image->filename; } else { $products_image_name = (isset($_POST['products_previous_image']) ? $_POST['products_previous_image'] : ''); } break; } } */ //With: //Store product images in a directory = "manufacturers_name": if ( isset($_POST['manufacturers_id']) ) { $products_image_dir = null; //Get the manufacturers name: $manufacturers_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . $_POST['manufacturers_id'] . "'"); $manufacturers = tep_db_fetch_array($manufacturers_query); //Now we have the dir as: $products_image_dir = DIR_FS_CATALOG_IMAGES . $manufacturers['manufacturers_name']; //Check if that directory exists, if not create it: if (is_dir($products_image_dir) || mkdir($products_image_dir,0755)) { $products_image_dir = $products_image_dir.'/'; clearstatcache(); //The results of is_dir is cached, thus clear the cache } } //For debugging echo 'image dir = '.$products_image_dir;//Output: Ok. // $products_image = new upload('products_image'); $products_image->set_destination($products_image_dir); if ($products_image->parse() && $products_image->save()) {//Doesn't seem to work $products_image_name = $products_image_dir . $products_image->filename; //For debugging echo '<br>products_image_name = '.$products_image_name;//Output: Nothing. } else { $products_image_name = (isset($_POST['products_previous_image']) ? $_POST['products_previous_image'] : ''); } break; } } ?> Testing on an existing product, gives that the directory is created, but the image remains in the old directory. Obviously I need to edit more code or plce the snippet elsewhere. Hopefully someone knows how. So, any suggestion would be most welcome. Sara
  12. Hi John, nice work! I'll have to test it out, given time. Bon Noel! Sara
  13. @@ksotiris If I understand your code it's made for DB's running iso-8859-1 or? I am using this excellent contribution (Thanks Robert). My DB and site is utf-8 encoded and run without any hickups. Cheers!
  14. @@FWR Media Thanks Robert :) It's a pitty that I can't buy you a beer... or something better, without using paypal. Sara
  15. @@FWR Media Robert, in your post #207 you suggested changes to product_info.php. Presumably so that the manufacturers url will work. Security Pro will otherwise strip the forward slashes: http://www.oscommerce.com/forums/topic/293326-contribution-security-pro-querystring-protection-against-hackers/page__st__200 Sara
×
×
  • Create New...