Jump to content

Seagoofy

Members
  • Content count

    21
  • Joined

  • Last visited

Everything posted by Seagoofy

  1. Seagoofy

    I get weird symbols when changing languagefiles.

    There are many texteditors out there. Some are free and some are not so free. The choice is yours to make. I honestly can't recommend any specific software because I use a mac and the text editor(s) I use are mac-only ;) I've been told that Notepad is usable, and that one comes with Windows. The problem with Word and many html-editors is that they add extra characters/tags to the text and these characters mess up the php code. (in static html these extra tags usually don't cause problems). So whichever editor you use make sure you save the text(s) as PLAIN TEXT. Open /catalog/includes/languages/swedish.php and look at lines 15-20. You should see something like // Examples: // on RedHat try 'en_US' // on FreeBSD try 'en_US.ISO_8859-1' // on Windows try 'en', or 'English' @setlocale(LC_TIME, 'en_US.ISO_8859-1'); It probably has "swe" instead of "en". This is the osC out-of-the-box setting. You must save your (edited) files with the same encoding. Better editors let you see/choose the encoding they are using and/or saving in. (xxx8859-1 and latin-1 mean the same thing). Also if you look at the source code of any web page (in your browser) youl'll see something like this: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> where after the <head> you see the line beginning with "<meta http-equiv=" has the "charset=xxxxxxx" which should tell your browser which character set/encoding to use, in this (forum page) case UTF-8. Lycka till Sjölångben
  2. Seagoofy

    I get weird symbols when changing languagefiles.

    And You are editing the language files with...? Don't use Word. Use any decent text editor. (Word is not a text editor, it's a word processor) Another cause could be wrong character encoding. Most servers hereabouts default to ISO-latin-1 (ISO-8859-1) which shows åäö just fine. osC also defaults to ISO-latin-1. UTF-8 (Unicode) would be better, but currently we often have to live with latin 1. Sjölångben
  3. Hi been modifying the "Padoren"-contribution (Norwegian postal contrib), but the problem would be the same in any shipping module I've seen so far. Namely: I use "volume-weight" for shipping, but I need to add some extra handling cost to the shipment based on the actual (product)weight of the heaviest item in cart. (some people charge extra if they have to carry a 100+ kg stove to the n:th floor :P ) Basically I need to get an array of the products_weight(s) in cart and figure out the heaviest weight. (I figure easiest way to get the heaviest would be to sort the array by weight and pick the first or last depending on sort order) The problem is I don't seem to be able to create the array :blush: Among other things I've tried: adding $cart to the (shipping module) globals and added this piece of code to the shipping module: $kollit_array = 0; $kollit = $cart->get_products(); for ($i=0, $n=sizeof($kollit); $i<$n; $i++) { $this->kollit[$kollit_array] = array('weight' => $kollit[$i]['weight']); echo $kollit_array; the echo is for testing purposes, it gives me "00" (double zero). If I place it before the "for" I get "array". So apparently I get an empty array :angry: I'm sure my mistakes are elementary, but I seem to have hit the wall. Any ideas? thanks Seagoofy
  4. NEITHER :lol: 1st one gives the (appr.) same error 2nd one gives a syntax error Luckily you gave that buglink. I was beginning to think I was the bug :rolleyes: This piece of advise did the trick: So (in /catalog/includes/modules/featured_sets.php) there are ? 3 instances of $featured_products_query_raw with 2 left joins ? 1 instance of $featured_manufacturers_query_raw with 1 left join (in //do manufacturer w/ product features) ? 3 instances of $featured_categories_query_raw with 2 left joins Example: Changed this: $featured_manufacturer_products_query_raw = "select p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, pd.products_name, pd.products_description, pd.products_short, p.products_image, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price, m.manufacturers_id, m.manufacturers_name, m.manufacturers_image, m.manufacturer_featured_until, mi.manufacturers_id, mi.languages_id, mi.manufacturers_url from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_MANUFACTURERS_INFO . " mi left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = mi.manufacturers_id and mi.languages_id = '" . (int)$languages_id . "' and m.manufacturer_featured = '1' order by " . FEATURED_MANUFACTURER_SORT_ORDER . " " . FEATURED_MANUFACTURER_DIRECTION . ' limit ' . MAX_DISPLAY_FEATURED_MANUFACTURER; to this: $featured_manufacturer_products_query_raw = "select p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, pd.products_name, pd.products_description, pd.products_short, p.products_image, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price, m.manufacturers_id, m.manufacturers_name, m.manufacturers_image, m.manufacturer_featured_until, mi.manufacturers_id, mi.languages_id, mi.manufacturers_url from ( " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_MANUFACTURERS_INFO . " mi ) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = mi.manufacturers_id and mi.languages_id = '" . (int)$languages_id . "' and m.manufacturer_featured = '1' order by " . FEATURED_MANUFACTURER_SORT_ORDER . " " . FEATURED_MANUFACTURER_DIRECTION . ' limit ' . MAX_DISPLAY_FEATURED_MANUFACTURER; It even works in Mysql 4+ :-" (disclaimer: did't test your solution(s) on all instances, but convinced myself ;) that they did't work ) Anyway, Many Thanks! w/out your link I probably would've stumbled forever. Seagoofy
  5. Hi! I've installed Open_Featured_Sets_v1.13_for_osCommerce_2.2_MS2_Update_051113 on two macs. One is running php 4.4.1 and mysql 4.0.21 just fine. The other is running php 5.something and mysql 5.something and I get this on frontpage: 1054 - Unknown column 'p.products_id' in 'on clause' select p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, pd.products_name, pd.products_description, pd.products_short, p.products_image, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price, m.manufacturers_id, m.manufacturers_name, m.manufacturers_image, m.manufacturer_featured_until, mi.manufacturers_id, mi.languages_id, mi.manufacturers_url from products p, products_description pd, manufacturers m, manufacturers_info mi left join specials s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '4' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = mi.manufacturers_id and mi.languages_id = '4' and m.manufacturer_featured = '1' order by rand() DESC limit 3 [TEP STOP] instead of the open_featured_box. (same sort of error shows on all pages with corresp text differences.) So far I've located the text(s) to featured_sets.php. Have compared the files on both sites: the same. I even replaced the file on the malfunc site with the func one. No dice. Can't figure why this file/query can't locate the p.products_id when all other parts of the store can???? :angry: There is a difference in mysql encoding: latin-1/utf-8 (working/nonworking) if it matters. Any ideas? Seagoofy
  6. Seagoofy

    Featured products question

    You need to import the included "featured_products_english.sql" -dump (if you are using english) into your database. You need to use phpmyadmin or whatever your service provider has set up for database management. In other words you need to connect to your database directly, you can't do it with osCommerce. Yes it does. That's step 13. "Go to your admin panel and add the products that you want featured." Seagoofy
×