Jump to content

Juto

Members
  • Content count

    365
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by Juto


  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. @@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


  4. @@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


  5. 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


  6. 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


  7. 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


  8. @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


  9. 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


  10. @@FWR Media

    Hi Robert. Yes, it's horrible... :)

    I have tracked down where it comes from. The errorstack is simply overflowed, and that is caused by an addon "total_configuration.php"

     

    It repeats things like this:

     

    Error Type: [E_NOTICE] Constant TEXT_CONFIGURATION_KEY already defined

    On line 99

    File includes/languages/svenska/total_configuration.php

     

    And doing so for every constant! :(

     

    The number of errors is explained by me reloding the page with that addon, while editing the css and testing the outcom.

     

    It's a pitty that the total_configuration.php behave like this. And me not being able to fix it... :(

     

    So I am left with either remove it or clear the error reports after uisng it. (A bad option, I think).

     

    Thanks Robert,

     

    Sara


  11. @@strub

    Hi, just a short question:

     

    Is it possible to set a time when the newsletter will be send?

    Why? Because, if I send the news let's say about the time when people are coming home from work.. then that mail will be among the first in perhaps a pile of emails. The likelyhood of being read is just so much higher.

     

    Kind regards

     

    Sara


  12. Hi Robert, hopefully you will see this.

     

    Yesterday I tweaked the admin, moved to use template_top.php and _bottom.php.

    It all went well apart from this:

     

    Undefined offset: 8192 in xxxx/admin/includes/kiss_error_handler.php on line 183

     

    Which is the third line in:

     

       private static function registryAttach( $errno, $errstr, $errfile, $errline ) {
      isset( self::$registry['errors'][$errno] ) ? null : self::$registry['errors'][$errno] = array();
      self::$registry['errors'][$errno][] = array( 'type'   => self::$error_types[$errno],
    											   'string' => $errstr,
    											   'file'   => $errfile,
    											   'line'   => $errline );
       } // end method
    

     

    How do I handle it?

     

    Kind regards and many thanks

     

    Sara


  13. A woman from Sweden, living a dream in Eden

    Just ripped a site on the laws of cookies

    to serv osC professionals and cookie rockies

     

    <div id="bd">
    
    <div id="HTMLBlock1995" class="HTMLBlock">
    <h1>Geeknet Opt-Out Choices</h1>
    <p>Users of the SourceForge, Slashdot and Freecode websites have choices regarding the collection and use of information through our websites.  This page summarizes some of those choices regarding our use of cookies, some advertising and other tools we use on our websites, and choices that you have about receiving newsletters and other communications from Geeknet.  This page is designed to highlight some of the choices you have; for a more detailed discussion, please see <a href="/privacy-statement">Geeknet’s Privacy Statement</a>.</p>
    <h2>Cookies</h2>
    <p>"Browser" cookies are small text files placed on a computer for various purposes including marketing, data analysis, and to enable our web sites to tailor the user’s experience on our sites.  You may set your browser to reject cookies or to notify you when a web site tries to place cookies in your browser program.  For your convenience, additional information about how to manage cookies for major browsers please follow the following links: </p>
    <ul>
    <li>Safari: <a href="http://docs.info.apple.com/article.html?path=Safari/3.0/en/11471.html">http://docs.info.apple.com/article.html?path=Safari/3.0/en/11471.html</a></li>
    <li>Firefox: <a href="http://support.mozilla.org/en-US/kb/Deleting%20cookies">http://support.mozilla.org/en-US/kb/Deleting%20cookies</a></li>
    <li>Internet Explorer: <a href="http://support.microsoft.com/kb/278835">http://support.microsoft.com/kb/278835</a></li>
    <li>Chrome: <a href="https://support.google.com/chrome/bin/answer.py?answer=95647">https://support.google.com/chrome/bin/answer.py?answer=95647</a></li>
    </ul>
    <p>Our websites also may use local shared objects, also known as "Flash cookies" to store your preferences or display content based upon what you view on our website to personalize your visit.  To learn how to manage privacy and storage settings for Flash cookies, including how to delete Flash cookies, please click here:
    <a href="http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager.html#117118">http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager.html#117118</a>.</p>
    
    <h2>Additional opt-out choices for analytics and marketing networks</h2>
    <p>Several of the advertising networks and service providers that we use to analyze activities on our sites also offer opt-out mechanisms as an alternative to managing the placement of cookies by these services through your browser settings as discussed above:  </p>
    <p>Google Analytics.  If you would like to opt-out of Google Analytics, Google has developed a tool that works with major internet browsers to permit you to opt-out.  For more information and install their opt-out tool, please click here: <a href="https://tools.google.com/dlpage/gaoptout">https://tools.google.com/dlpage/gaoptout</a></p>
    <p>Google Advertising.  To opt-out of or manage your targeted third-party advertising preferences with Google, please click here: <a href="http://www.google.com/policies/privacy/ads/">http://www.google.com/policies/privacy/ads/</a></p>
    <p>ComScore.  To opt-out of comScore’s universal data collection, please click here: <a href="http://www.scorecardresearch.com/preferences.aspx">http://www.scorecardresearch.com/preferences.aspx</a> </p>
    <p>National Advertising Initiative.  To opt-out of targeted third party advertising by Network Advertising Initiative members, please click here: <a href="http://www.networkadvertising.org/managing/opt_out.asp">http://www.networkadvertising.org/managing/opt_out.asp</a></p>
    <p>In addition, some of our third party advertising partners display an “ad choices” icon with the advertisement on our site.  If you see this icon with an advertisement, you can click on it to find out more information about the ad and your ad choices.</p>
    
    <h2>Additional opt-out choices for social media</h2>
    <p>Integration of social media links to our sites may enable tracking  by these providers, who provide their own opt-out and data control mechanisms:</p>
    <ul>
    <li>Facebook, whose cookie control instructions are at  <a href="https://www.facebook.com/help/?page=176591669064814">https://www.facebook.com/help/?page=176591669064814</a></li>
    <li>Twitter, whose Privacy Policy links to various account control options at <a href="http://twitter.com/privacy">http://twitter.com/privacy</a></li>
    <li>Google Plus, which provides display control at <a href="http://www.google.com/profiles">http://www.google.com/profiles</a></li>
    </ul>
    <h2>Geeknet Newsletters and Direct Marketing Communications</h2>
    If you would like to opt-out/unsubscribe from receiving newsletters or marketing communications  or deactivate your accounts, please use the links below and provide a copy of the communication or account name you wish to unsubscribe.  Please understand that it may take up to a week for your request to be processed.</p>
    <p>For Sourceforge, please contact us at <a href="mailto:sfnet_ops@[member='geek'].net">sfnet_ops@[member='geek'].net</a></p>
    <p>For Slashdot, please contact us at <a href="mailto:feedback@[member='Slashdot'].org">feedback@[member='Slashdot'].org</a></p>
    <p>For FreeCode, please contact us at <a href="mailto:help@freecode.com">help@freecode.com</a></p>
    
    </div>
    </div>
    

     

    Let's Rock an' Roll!

×