Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

tgely

Team
  • Posts

    2,159
  • Joined

  • Last visited

  • Days Won

    51

Posts posted by tgely

  1. @@Mort-lemur

     

    These error occured when installation fails or non-standard installation was runned. I have these duplicates if I develop modules and non fixed constant used, deleted or modified between developings.
    Its natural if you are a developer, but you should handle this in configuration table.

     

    Probably you canceled or semi finalished the app installation when runned app setup with during errors.

     

     

    (Somewhere is a commit to prevent this on the github with modules when unistall.)

  2.  

    @@Gergely,

     

    I had to add "required aria-required="true""  to the input field to get the validation to work if no state is in the DB for the selected country:

         	 echo tep_draw_input_field('state', NULL, 'id="inputState" class="form-control" required aria-required="true" placeholder="' . ENTRY_STATE    . '"');
    

     

    and could you step forward in registration?

  3. @@raiwa

    Hi Rainer,

     

    great work!

    if customers are not loged in then would be great to define zone_id in $order->delivery

    Example from order class:

          $this->delivery = array('firstname' => $shipping_address['entry_firstname'],
                                  'lastname' => $shipping_address['entry_lastname'],
                                  'company' => $shipping_address['entry_company'],
                                  'street_address' => $shipping_address['entry_street_address'],
                                  'suburb' => $shipping_address['entry_suburb'],
                                  'city' => $shipping_address['entry_city'],
                                  'postcode' => $shipping_address['entry_postcode'],
                                  'state' => ((tep_not_null($shipping_address['entry_state'])) ? $shipping_address['entry_state'] : $shipping_address['zone_name']),
                                  'zone_id' => $shipping_address['entry_zone_id'], //its critical
                                  'country' => array('id' => $shipping_address['countries_id'], 'title' => $shipping_address['countries_name'], 'iso_code_2' => $shipping_address['countries_iso_code_2'], 'iso_code_3' => $shipping_address['countries_iso_code_3']),
                                  'country_id' => $shipping_address['entry_country_id'],
                                  'format_id' => $shipping_address['address_format_id']);
    

    My solution with STORE_ZONE:
     

    		      	$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),
                                          'zone_id' => STORE_ZONE);
    

    Thanks!

  4. then it works...

    Hotfix for non-english languages

     

    change code in ext/modules/content/header/content_searches.php file

     

    Find both of:

     

    str_replace(' ', '+', $query)
    

    replace width:

     

    urlencode(str_replace(' ', '+', $query))
    
  5. Great Contrib, thanks.

     

    I use an older Version of OSC BS

     

    How can i get the Search bar in the "boxes_header" Group?

     

    I Use the Group "header" only in index with the Page Carousel Banner Slider Module

     

    At this moment we are in the same version. :D  In next days I will do it for myself.

     

    I try to figure out for ourselves..

     

    Change:

        var $group = 'header';
    

    To:

        var $group = 'boxes_header';
    

    Change:

     

          include(DIR_WS_MODULES . 'content/' . $this->group . '/templates/store_search.php');
          $template = ob_get_clean();
    
          $oscTemplate->addContent($template, $this->group);
    

    to:

          include(DIR_WS_MODULES . 'boxes/templates/store_search.php');
          $template = ob_get_clean();
    
          $oscTemplate->addBlock($template, $this->group);
    

    Find ext/modules/.../store_searches.php

    change:

      include(DIR_WS_LANGUAGES . $language . '/modules/content/header/cm_header_store_search.php');
    

    to:

      include(DIR_WS_LANGUAGES . $language . '/modules/boxes/cm_header_store_search.php');
    

     

    Upload structure is a little bit different

    catalog/includes/boxes/templates/ (here should upload template file store_search.php)

    catalog/includes/boxes/ (here we should upload cm_header_store_search.php)

     

    catalog/includes/langauges/english/modules/boxes/ (here we should upload cm_header_store_search.php language file)

     

     

    ext directories could be origin format because all links are absolutes.

     

    I think it should be all, but I will test later. Post here if something is wrong.

  6. Hello @@Gergely,

     

    Thank you for the suggestions.

    The code parts you mention are based on the solution @De Dokta posted here:

    http://www.oscommerce.com/forums/topic/397121-drop-down-state-selection-and-2334bs3/?p=1724667

     

    I only packed them together to a add-on package, previous permission of De Docta, of course.

    So I would prefer if you discuss the modifications with him before I include the suggestions to the add-on.

     

    Kindest regards

    Rainer

     

    Hi Rainer,

     

    sorry I dont know the prerequisites.

     

    He had passed to you the responsibility :)

     

    http://www.oscommerce.com/forums/topic/397121-drop-down-state-selection-and-2334bs3/?p=1727767

     

     

  7. Thank you for the great work on this contribution!

     

    There is one area where I have an issue - people frequently search on  my store by model number as well as keyword. If they use model number then they get the "No Products Found! Try Here" message instead of the relevant product. If they hit return they get taken to the Advanced Search page or if they click the magnifying glass they go directly to the product which are both fine.

     

    My fear is that when they see the "No Products Found" message they will abandon the store.

     

    I managed to get it working just with model number by changing line 106 of content_searches.php to this:

       $like_statement .= " p.products_model LIKE '%" . tep_db_input($g) . "%' AND ";

    … but I haven't been able to get the search incorporating results from model number as well as product name.

     

     

    Greg

     

    Thanks the report. I see the problem. "AND" statement caused this in the query string. I will fix it in the next release with separated "OR" between fields in query.

  8. @@raiwa

    Hi Rainer,

    nice addon!

    Some code changes may be good for BS form control:
     

    <?php
      if (ACCOUNT_STATE == 'true') {
    ?>
        <div class="form-group has-feedback">
          <label for="inputState" class="control-label col-sm-3"><?php echo ENTRY_STATE; ?></label>
          <div id="results" class="col-sm-9">
            <?php
            $check_query = tep_db_query("select count(*) as total from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "'");
            $check = tep_db_fetch_array($check_query);
            $entry_state_has_zones = ($check['total'] > 0);
          
            if ($entry_state_has_zones == true) {
              $zones_array = array();
              $zones_array[0] = array('id' => '', 'text' => PULL_DOWN_DEFAULT);                        
              $zones_query = tep_db_query("select zone_name from zones where zone_country_id = '" . (int)$country . "' order by zone_name");
                while ($zones_values = tep_db_fetch_array($zones_query)) {
                  $zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']);
                }
    //            echo '<span id="results">';
                echo tep_draw_pull_down_menu('state', $zones_array, '', 'required aria-required="true" id="inputState"');
    //            echo '</span>';
                echo FORM_REQUIRED_INPUT;
            } else {
    //          echo '<span id="results">';
              echo tep_draw_input_field('state', NULL, 'id="inputState"  class="form-control" placeholder="' . ENTRY_STATE    . '"');
    //          echo '</span>';
    //          echo FORM_REQUIRED_INPUT;
            }
            if (tep_not_null(ENTRY_STATE_TEXT)) echo '<span class="help-block">' . ENTRY_STATE_TEXT . '</span>';
            ?>
          </div>
        </div>
    <?php
      }
    ?>
    

    If not state then I have conflict with ENTRY_STATE_MIN_LENGTH so I had to change it 0 in admin site.
     

    This origin '0' value prevent the form controll here.

    $zones_array[0] = array('id' => '0', 'text' => PULL_DOWN_DEFAULT);

    It would be better empty '' id as exists in my example.


    <span> tag is obsolate so you could use:
     

    <div id="results" class="col-sm-9">
    


    I dont see the onchange function in get_states.php tep_draw_pull_down_menu() function. Am I missing something?

    I have found mixing text in ht_get_states.php
     

     

    'The pages to add the Datepicker jQuery Scripts to.'

  9.  

    @@Harald Ponce de Leon

     

    I have a bug for the PayPal app - it is missing the parameter SHIPTOSTREET2 which is called 'suburb' in OsC. Looking back a previous versions of PayPal Express it look like its always been missing.

     

    I presume the difference in terminology has caused the omission - Address Line 2 (optional) in PayPal vs Suburb in OsC (I have always renamed Suburb in OsC to Address Line 2).

     

    If a customer adds or updates their address using the checkout with PayPal button - this 2nd address line or suburb line is omitted when entered into the order and DB  (which for some delivery location is very critical).

     

    This can easily be fixed with the following changes to /ext/modules/payment/paypal/express.php

     

    Under

              $ship_address = tep_db_prepare_input($appPayPalEcResult['PAYMENTREQUEST_0_SHIPTOSTREET']);
    

    Add

    		  //added for address line 2
              $ship_suburb = tep_db_prepare_input($appPayPalEcResult['PAYMENTREQUEST_0_SHIPTOSTREET2']);
    

    And under;

              $ship_address = tep_db_prepare_input($appPayPalEcResult['SHIPTOSTREET']);
    

    Add

    		  //added for address line 2
              $ship_suburb = tep_db_prepare_input($appPayPalEcResult['SHIPTOSTREET2']);
    

    And changed this

            $check_query = tep_db_query("select address_book_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and entry_firstname = '" . tep_db_input($ship_firstname) . "' and entry_lastname = '" . tep_db_input($ship_lastname) . "' and entry_street_address = '" . tep_db_input($ship_address) . "' and entry_postcode = '" . tep_db_input($ship_postcode) . "' and entry_city = '" . tep_db_input($ship_city) . "' and (entry_state = '" . tep_db_input($ship_zone) . "' or entry_zone_id = '" . (int)$ship_zone_id . "') and entry_country_id = '" . (int)$ship_country_id . "' limit 1");
    

    To

    		//modified to add address line 2
            $check_query = tep_db_query("select address_book_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and entry_firstname = '" . tep_db_input($ship_firstname) . "' and entry_lastname = '" . tep_db_input($ship_lastname) . "' and entry_street_address = '" . tep_db_input($ship_address) . "' and entry_suburb = '" . tep_db_input($ship_suburb) . "' and entry_postcode = '" . tep_db_input($ship_postcode) . "' and entry_city = '" . tep_db_input($ship_city) . "' and (entry_state = '" . tep_db_input($ship_zone) . "' or entry_zone_id = '" . (int)$ship_zone_id . "') and entry_country_id = '" . (int)$ship_country_id . "' limit 1");
    

     

    Thanks the report! Next please post into bug forum

     

    http://www.oscommerce.com/forums/tracker/issue-1219-paypal-app-express-checkout-by-greasemonkey/

  10. Hi all,

     

    my Extended Search Bar pushed out for BS stores.

     

    http://oscom.hu/images/store_search/store_search_bootstrap_oscommerce.png

     

    Add-On : http://addons.oscommerce.com/info/9328

     

     

    • If products are found more than 5 result then advanced search link appears in dropdown as 6th line.
    • If product is not found then advanced search link is displaying in dropdown.
    • Exception: typed single "b" or "B" has no effect.
    • Store Search field working as an origin Search bar with typed enter/return or click on button.
    • Search in description configuration mode has effect only as origin Search method.
    • File content searches are only in "OR" conditions.
    • Categories and product results are working by "AND" conditions.
  11. I updated my url redirects add on to the latest and then downloaded the file.  It was delimited by semicolon, so that's how I imported it.  It worked fine, putting the fields into columns in Excel.

     

    I then saved the file as csv.  Is that the correct format for uploading?

     

    Also, when uploading, is the data processed as an update query?  Meaning if I have only 10 records I want to update, can I upload just those?  Or do I have to upload the entire file, with changes to just the 10 records?

     

    I don't want to upload just 10 records and lose thousands already in place.

     

    Thanks

     

    Deletion is allowed on admin site only. CSS import update or insert only.

  12. now i cant edit the file, there is no  delimiter

    attachicon.gifexcel.JPG

    @@altoid

    I have just rewrited the csvExpImp for better compatibility

     

    Here is

    very usefull for all excell users.

    when you edited the file save into CSV (MS-DOS) mode!

     

    Well, the new compatibility mode should be CSV (comma-separated values) and double qouted strings as phpMyAdmin do the same by default.

     

    <?php
    /*
      Copyright by Gergely Tóth http://oscom.hu
    
      v1.2b
    
      Export from query
      1. parse query
      2. get header fields
      3. run query and save results into temporary csv file
      4. download if need
      5. delete temporary file
    */
    
      define('FS_OUTPUT_PATH', '');
    
      class export2csv {
        // public variables
        var $filename,
            $lines_terminated,
            $fields_terminated,
            $optionally_enclosed,
            $output,
            $sql_result,
            $tmpfname = '';
        var $inistatus = false;
    
        // run the export
        //$query could be sql string or object results
        function downloadCsv($query = Null) {
    
          // default init call from built in $this->inisetCSV() function
          if (!$this->inisatus) {
            $this->inisetCSV();
          }
    
          if (!$this->filename) {
            $this->setFilename();
          }
    
          if (!is_object($query)) {
            $this->getResult($query);
          }
    
          $this->buildDatasheet($this->sql_result);
          $this->downloadFile();
          unlink(FS_OUTPUT_PATH . $this->tmpfname);
    
        }
    
        function getResult($query) {
          $this->sql_result = tep_db_query($query);
        }
    
        function buildHeader($sql_result) {
          // Get The Field Name from query
          while ( $columns = tep_db_fetch_fields($sql_result) ) {
            $this->output .= $columns->name . $this->fields_terminated;
          }
          $this->output = substr($this->output, 0, -(strlen($this->fields_terminated)));
          $this->output .= $this->lines_terminated;
        }
    
        function buildDatasheet($sql_result) {
          // init
          $this->tmpfname = strftime('%Y%m%d-%H%M%S') . '.csv';
          $fp = fopen(FS_OUTPUT_PATH . $this->tmpfname, "a+");
    
          // reset output and build csv header line
          $this->setOutput();
          $this->buildHeader($sql_result);
    
          fwrite($fp, $this->output);
    
          // Get Records from the query
          while ($row = tep_db_fetch_array($sql_result)) {
            fputcsv($fp, $row, $this->fields_terminated, $this->optionally_enclosed);
          }
    
          fclose($fp);
        }
    
        function downloadFile() {
          // Download the file
    
          $file_size  = filesize(FS_OUTPUT_PATH . $this->tmpfname);
          $file = @fopen(FS_OUTPUT_PATH . $this->tmpfname,"rb");
    
          header("Content-Encoding: UTF-8");
          header("Content-type: text/csv; charset=UTF-8");
          header("Content-Disposition: attachment; filename=" . $this->tmpfname . "");
          header("Content-Length: " . $file_size . "");
          header("Pragma: no-cache");
          header("Expires: 0");
    
          set_time_limit(0);
          fseek($file, $seek_start);
    
          while(!@feof($file)) {
            print(@fread($file, 1024*8));
            ob_flush();
            flush();
            if ( connection_status() != 0 ) {
              @fclose($file);
              exit;
            }
          }
    
        }
    
        function setOutput($string = '') {
          $this->output = $string;
        }
    
        // set the download filename
        function setFilename($filename = 'csvexport.csv') {
          $this->filename = $filename;
        }
    
        // set the CSV file
        function inisetCSV($optionally_enclosed = '"', $fields_terminated = ",", $lines_terminated = "\n") {
          $this->lines_terminated = $lines_terminated;
          $this->fields_terminated = $fields_terminated;
          $this->optionally_enclosed = $optionally_enclosed;
          $this->inistatus = true;
        }
      }
    
    
      /*
        Import from upload
        1. upload csv file
        2. parse csv
        3. get header
        4. slice file if need
        5. insert into data table
        6. delete uploaded files
      */
    
      class CSVImport {
        var $data;
    
        function csv_to_array($filename = '', $delimiter = ",") {
          if(!file_exists($filename) || !is_readable($filename))
            return false;
    
          $header = null;
          $this->data = array();
          if (($handle = fopen($filename, 'r')) !== false) {
            while (($row = fgetcsv($handle, 1000, $delimiter)) !== false) {
              if (!$header) {
                $header = $row;
              } else {
                $this->data[] = array_combine($header, $row);
              }
            }
            fclose($handle);
          }
    
          return true;
        }
    
        function get_data() {
          return $this->data;
        }
      }
    ?>
    
  13. Can the message stack be put into a language file, then let the shop owners modify that do their needs?

    Yes

     

    Also, will the message stack only show for redirected products and categories?

     

    Yes

     

    Also, will the message stack only show for redirected products and categories? But not a 404 or 410 because that's a different situation.

     

    There are redirections and header responses. USU 5 give 404 without any hasitation if products_id is not found from application_top so the product_info.php breaks in the first line. We dont have any possibiity to do something for 404/410 evens when URL redirection modul should be overtaken USU 5's classes.

     

    I dont see any good fast solution without cache because all server request should be analyse before display something. V2.4 would be better with PDO cache for this problem

     

    A simple array solution could be good from ini files (in v2.3) to do better 404/410 pages.

     

    If no URL SEO than URL redirection could work with 404 or 410 responses. :(

     

    There are two way. First we should rewrite URL SEO functions/classes with enable/disable URL SEO redirections in some cases or we should built in later the URL redirection into URL SEO secondly. :wacko:

     

     

     

    I'd prefer that products_id and cPath or every params should be validated firstly in the codebase (like another parameter as language_id) and secondly URL SEO or Redirections could be use the validation informations. Its a dream of next versions.

×
×
  • Create New...