Jump to content
Latest News: (loading..)

ken0306

Members
  • Content count

    298
  • Joined

  • Last visited

4 Followers

About ken0306

  • Birthday 11/01/1979

Profile Information

  1. ken0306

    2.2RC1 and PHP7

    @ I am upgrading my OLD v2.2RC1 to working with php7 now. Here is what I got so far. (NOTE: My previews application was running on PHP 5.6. ) Files you need to edit. store side: includes/classes/shopping_cart.php includes/classes/shipping.php includes/classes/packing.php includes/functions/database.php includes/functions/html_output.php admin side: admin/includes/functions/database.php I change the functions/database.php mysql connection function from mysql_fetch_row to mysqli_fetch_array and the application will be able to run under php7. 1.23. 1. replace function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') { global $$link; if (USE_PCONNECT == 'true') { $$link = mysql_pconnect($server, $username, $password); } else { $$link = mysql_connect($server, $username, $password); } if ($$link) mysql_select_db($database); return $$link; } function tep_db_close($link = 'db_link') { global $$link; return mysql_close($$link); } with function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') { global $$link; if (USE_PCONNECT == 'true') { $server = 'p:' . $server; } $$link = mysqli_connect($server, $username, $password, $database); if ( !mysqli_connect_errno() ) { mysqli_set_charset($$link, 'utf8'); } @mysqli_query($$link, 'set session sql_mode=""'); return $$link; } function tep_db_close($link = 'db_link') { global $$link; return mysqli_close($$link); } 2 replace $result = mysql_query($query, $$link) or tep_db_error($query, mysql_errno(), mysql_error()); to //$result = mysqli_query($query, $$link) or tep_db_error($query, mysqli_errno(), mysqli_error()); $result = mysqli_query($$link, $query) or tep_db_error($query, mysqli_errno($$link), mysqli_error($$link)); 3 replace function tep_db_fetch_array($db_query) { return @mysql_fetch_array($db_query, MYSQL_ASSOC); } function tep_db_num_rows($db_query) { return mysql_num_rows($db_query); } function tep_db_data_seek($db_query, $row_number) { return mysql_data_seek($db_query, $row_number); } function tep_db_insert_id($link = 'db_link') { global $$link; return mysql_insert_id($$link); } function tep_db_free_result($db_query) { return mysql_free_result($db_query); } function tep_db_fetch_fields($db_query) { return mysql_fetch_field($db_query); } to function tep_db_fetch_array($db_query) { // return @mysql_fetch_array($db_query, MYSQL_ASSOC); return @mysqli_fetch_array($db_query, MYSQLI_ASSOC); } function tep_db_num_rows($db_query) { // return mysql_num_rows($db_query); return mysqli_num_rows($db_query); } function tep_db_data_seek($db_query, $row_number) { // return mysql_data_seek($db_query, $row_number); return mysqli_data_seek($db_query, $row_number); } function tep_db_insert_id($link = 'db_link') { global $$link; // return mysql_insert_id($$link); return mysqli_insert_id($$link); } function tep_db_free_result($db_query) { // return mysql_free_result($db_query); return mysqli_free_result($db_query); } function tep_db_fetch_fields($db_query) { // return mysql_fetch_field($db_query); return mysqli_fetch_field($db_query); } You should be able to run the application on PHP 7 with some error. Since you can bring up the application, you will be able to patch each addon on your shopping cart to make it works. I holp this will help good luck. ken
  2. it works, thank you. the error is gone. This error also in the osc 2.3.4 defult package.
  3. Hi there, My website recently got the PCI SQL Injection Severity problem with the advanced_search_result.php page, here is the error WAS Payload keywords=%25%25&search_in_description=1&submit=Search&categories_id=98&inc_subcat=1&manufacturers_id=&pfrom=1e309&pto=&dfrom=&dto= What happens is when I adding the following code after advanced_search_result.php?keywords=%25%25&search_in_description=1&submit=Search&categories_id=98&inc_subcat=1&manufacturers_id=&pfrom=&pto=1e309&dfrom=&dto= The MySQL error print out on the screen. 1054 - Unknown column 'INF' in 'where clause' select count(distinct p.products_id) as total from products p left join manufacturers m using(manufacturers_id) left join specials s on p.products_id = s.products_id, products_description pd, categories c, products_to_categories p2c where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.products_id = p.products_id and p2c.products_id = pd.products_id and (p2c.categories_id = '98' or p2c.categories_id = '99' or p2c.categories_id = '104' or p2c.categories_id = '106' or p2c.categories_id = '111' or p2c.categories_id = '114' or p2c.categories_id = '117' or p2c.categories_id = '123' or p2c.categories_id = '125' or p2c.categories_id = '289') and ((pd.products_name like '%%%%' or p.products_model like '%%%%' or p.products_UPC like '%%%%' or p.products_MPN like '%%%%' or m.manufacturers_name like '%%%%' or pd.products_description like '%%%%') ) and (IF(s.status, s.specials_new_products_price, p.products_price) <= INF) I trying the since script on demo site from oscommerce.com, the search result also shows the same error. Any idea how to fix this problem with the script? thank you in advance. ken
  4. ken0306

    Contact Us Form Not Working Correctly?

    you should recheck on your smtp mail addon, most of the webmail like outlook, or gmail will require for sever setup the spf correctly. Test your mail server first by sending email to your own gmail account or hotmail account, and look at the source code. there will be more information about your smtp mail server setup and your spf setup for the email address you using for your store.
  5. ken0306

    Wordpress OSCommerce Integration

    Hi Jay, what kind of information do you want these two applications to share? I installed the addon before, but don't really see it useful. ken
  6. ken0306

    Clearance Price addon

    This can be a temporary solution. But when we decide to extend so deals, this will not really work. Also if I removed the items during the promotions period, there will be additional data inserted into the special table. thank you ken
  7. ken0306

    Clearance Price addon

    I am currently using the advanced specials to apply for my promotions too. However, my shop currently has over 10,000 items, and there are over 1000 items on clearance. During the holidays season, we often have a storewide sale, that is what the problem coming from after the sale. All price are going back to regular price and we need to spend a lot of time to find the correct price on the clearance items again. So, I wonder if there is any clearance price addon I can use the base for this kind of scenario. thank you ken
  8. ken0306

    Clearance Price addon

    Hi there, I am looking for an addon allow me to apply clearance price on the items. Here is the problem I have, for example Product A selling price at 9.99, and clearance price at 5.55. Now we will have another promotion will running for 7 days at 50% off, during the promotion period, product A will selling at 4.99. after the promotion over, product A will coming back to clearance price 5.55. The current special offer addon only allows me to add one special price on one product, after the promotion period, the price will be going back to regular price 9.99. So is there any addon allow me to add a clearance price on products? thank you ken
  9. Hi there, I am trying to setup my shopping cart with table rate and limited by product weight and postcode, and here is so far I can think about. 1. I setup the Table Rate charge by price, 29:8.99,49:6.99,49.01:0.00 so all orders over 49.01 will be free shipping. 2. Because I only want to offer free shipping to a small and medium size package, not the large item. I add the following code to /includes/class/shipping/ table.php change return $this->quotes; to if (($cart->show_weight() < 50 )) { return $this->quotes; } This will limit the shopping cart total weight while they check out. So, how do I change this to each item's weight instant of total cart weight? If customer order 2 x 21 lbs item will give total weight 52 lbs, the free shipping can't apply to order. So how can I change shopping cart total weight to heaviest items on the shopping cart's weight? 3. I also trying to limit the service only available in city area, so I will need to adding the restriction on postcode, if (($cart->show_weight() < 50 ) && $order->delivery['postcode'] != 'v6y 3j8') { return $this->quotes; } so how can I setup multiple valuable for delivery postcode and only check if first 3 characters match? thank you ken
  10. ken0306

    ULTIMATE Seo Urls 5 - by FWR Media

    Hi FWR Media, I saw your post about the Chinese charterer on url around page 138, do you have solution for that problem on the seo urls 5 pro version? thank you ken
  11. ken0306

    Wishlist 2.0 Support Thread

    HI, I have wishlist 2 installed, I add 1 extra field in my customer_wishlist table call categories_id, I want my customer be able to sort the wishlist by categories. I change the insert query from tep_db_query("insert into " . TABLE_WISHLIST . " (customers_id, products_id) values ('" . $customer_id . "', '" . $wishlist_id . "')"); to tep_db_query("insert into " . TABLE_WISHLIST . " (customers_id, products_id, categories_id) values ('" . $customer_id . "', '" . $wishlist_id . "', '" . $top_category_id . "')"); include/classes/wishlist.php since I only want to insert the top category to wishlist table, I add the following code under product_info.php page to show the category_id $cPath = implode('_', $cPath_array); $top_category_id = strtok($cPath, '_'); echo $top_category_id; before the </form> It does shows the top category id correctly under the products_info.php, but the sql query doesn't insert the $top_category_id to the table. Can somebody tell me how fix this problem? Thank you ken
  12. Hi, do you have installation instruction for 2.2 version/
  13. Hi, I have this add on install on my site, and I trying to rewrite my whole site with bootstrap 3.0. While I working on the product_filters.php page, I find out that the CLOSE X on the breadcrmb has the same class close with bootstrap. I trying to find the file under the breadcrmb.php, but don't really see it. Can some one tell me where to find the close class, and change to other clase? it is always floating to right on my page. thank you. ken
  14. This is superfish dropdown, you don't really need admin control.
×