Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

thpek

Archived
  • Posts

    32
  • Joined

  • Last visited

Everything posted by thpek

  1. Dear all, I needed this MOD. At the same time, my store is MOD with the register globals turn off MOD. I installed the Order Editor MOD and did not manage to get it to work. My suspicion tells me it has got something to do with register globals variable being turn off. Wonder if their are any experts here that can advise how to get this MOD work together with register globals turn off. Much appreciated for any help offered.
  2. Hi, I like this MOD very much and will need it to modify one of my order. However, I am not php expert and my store is heavily modified. Therefore, would really appreciate if someone is kind enough to provide the step by step guide for the installation rather then to compare with the original file for what is the difference. Thanks and regards, Terry
  3. Dear Iane, You are simply marvellous. With the indication of the error and your confirmation that the $custid requires register_global to be activated. I have managed to resolve this issue by reading through the register_global MODs again on the portion teaching people how to modify the MODs to work with register_global off. I hope the solution provided below will assist others who have both recover_cart_sales MOD and register_global MOD installed to get it working. Your MOD is simply marvellous. Solution as follows: Backup Backup if need to. Just modify this file catalog/admin/recover_cart_sales.php. Locate this portion: require(DIR_WS_CLASSES . 'currencies.php'); Add this below the sentence: link_post_variable('custid'); It should look like this now: require('includes/application_top.php'); require(DIR_WS_CLASSES . 'currencies.php'); link_post_variable('custid'); $currencies = new currencies(); ---------------------------------------------------------------- It's just that simple. Add link_post_variable('custid'); and the problem is resolved. Cheers everyone :) I am a happy man once again.
  4. Hi guys, For my previous posting regarding my email portion doesn't work. I manage to narrow down to the portion of the php file which does not work and hope some expert can assist me. Portion of the admin\recover_cart_sales.php file ------------------------------------------------------------------------------------------ <?php // Are we doing an e-mail to some customers? <?php echo 'test'; ?> - Shows as test on the webpage if (count($custid) > 0 ) { ?> <tr> <td class="pageHeading" align="left" colspan=2 width="50%"><? echo HEADING_TITLE; ?> </td> <td class="pageHeading" align="left" colspan=4 width="50%"><? echo HEADING_EMAIL_SENT; ?> </td> </tr> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent" align="left" colspan="1" width="15%" nowrap><?php echo TABLE_HEADING_CUSTOMER; ?></td> <td class="dataTableHeadingContent" align="left" colspan="1" width="30%" nowrap> </td> <td class="dataTableHeadingContent" align="left" colspan="1" width="25%" nowrap> </td> <td class="dataTableHeadingContent" align="left" colspan="1" width="10%" nowrap> </td> <td class="dataTableHeadingContent" align="left" colspan="1" width="10%" nowrap> </td> <td class="dataTableHeadingContent" align="left" colspan="1" width="10%" nowrap> </td> </tr><tr> <br></tr> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent" align="left" colspan="1" width="15%" nowrap><?php echo TABLE_HEADING_MODEL; ?></td> <td class="dataTableHeadingContent" align="left" colspan="2" width="55%" nowrap><?php echo TABLE_HEADING_DESCRIPTION; ?></td> <td class="dataTableHeadingContent" align="center" colspan="1" width="10%" nowrap> <?php echo TABLE_HEADING_QUANTY; ?></td> <td class="dataTableHeadingContent" align="right" colspan="1" width="10%" nowrap><?php echo TABLE_HEADING_PRICE; ?></td> <td class="dataTableHeadingContent" align="right" colspan="1" width="10%" nowrap><?php echo TABLE_HEADING_TOTAL; ?></td> </tr> <?php foreach ($custid as $cid) { $query1 = tep_db_query("select cb.products_id pid, cb.customers_basket_quantity qty, cb.customers_basket_date_added bdate, cus.customers_firstname fname, cus.customers_lastname lname, cus.customers_email_address email from " . TABLE_CUSTOMERS_BASKET . " cb, " . TABLE_CUSTOMERS . " cus where cb.customers_id = cus.customers_id and cus.customers_id = '".$cid."' order by cb.customers_basket_date_added desc "); $knt = mysql_num_rows($query1); for ($i = 0; $i < $knt; $i++) { $inrec = tep_db_fetch_array($query1); // set new cline and curcus if ($lastcid != $cid) { if ($lastcid != "") { $cline .= " <tr> <td class='dataTableContent' align='right' colspan='6' nowrap><b>" . TABLE_CART_TOTAL . "</b>" . $currencies->format($tprice) . "</td> </tr> <tr> <td colspan='6' align='right'><a href=" . tep_href_link(FILENAME_RECOVER_CART_SALES, "action=delete&customer_id=" . $cid . "&tdate=" . $tdate) . ">" . tep_image_button('button_delete.gif', IMAGE_DELETE) . "</a></td> </tr>\n"; echo $cline; } $cline = "<tr> <td class='dataTableContent' align='left' colspan='6' nowrap><a href='" . tep_href_link(FILENAME_CUSTOMERS, 'search=' . $inrec['lname'], 'NONSSL') . "'>" . $inrec['fname'] . " " . $inrec['lname'] . "</a>".$customer."</td></tr>"; $tprice = 0; } $lastcid = $cid; // get the shopping cart $query2 = tep_db_query("select p.products_price price, p.products_model model, pd.products_name name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_LANGUAGES . " l where p.products_id = '" . $inrec['pid'] . "' and pd.products_id = p.products_id and pd.language_id = " . (int)$languages_id ); $inrec2 = tep_db_fetch_array($query2); $sprice = tep_get_products_special_price( $inrec['pid'] ); if( $sprice < 1 ) $sprice = $inrec2['price']; $tprice = $tprice + ($inrec['qty'] * $sprice); $pprice_formated = $currencies->format($sprice); $tpprice_formated = $currencies->format(($inrec['qty'] * $sprice)); $cline .= "<tr class='dataTableRow'> <td class='dataTableContent' align='left' width='15%' nowrap>" . $inrec2['model'] . "</td> <td class='dataTableContent' align='left' colspan='2' width='55%'><a href='" . tep_href_link(FILENAME_CATEGORIES, 'action=new_product_preview&read=only&pID=' . $inrec['pid'] . '&origin=' . FILENAME_RECOVER_CART_SALES . '?page=' . $HTTP_GET_VARS['page'], 'NONSSL') . "'>" . $inrec2['name'] . "</a></td> <td class='dataTableContent' align='center' width='10%' nowrap>" . $inrec['qty'] . "</td> <td class='dataTableContent' align='right' width='10%' nowrap>" . $pprice_formated . "</td> <td class='dataTableContent' align='right' width='10%' nowrap>" . $tpprice_formated . "</td> </tr>"; $mline .= $inrec['qty'] . ' x ' . $inrec2['name'] . "\n"; if( EMAIL_USE_HTML == 'true' ) $mline .= ' <blockquote><a href="' . tep_catalog_href_link(FILENAME_CATALOG_PRODUCT_INFO, 'products_id='. $inrec['pid']) . '">' . tep_catalog_href_link(FILENAME_CATALOG_PRODUCT_INFO, 'products_id='. $inrec['pid']) . "</a></blockquote>\n\n"; else $mline .= ' (' . tep_catalog_href_link(FILENAME_CATALOG_PRODUCT_INFO, 'products_id='. $inrec['pid']).")\n\n"; } $cline .= "</td></tr>"; // E-mail Processing - Requires EMAIL_* defines in the // includes/languages/english/recover_cart_sales.php file $cquery = tep_db_query("select * from orders where customers_id = '".$cid."'" ); $email = EMAIL_TEXT_LOGIN; if( EMAIL_USE_HTML == 'true' ) $email .= ' <a HREF="' . tep_catalog_href_link(FILENAME_CATALOG_LOGIN, '', 'SSL') . '">' . tep_catalog_href_link(FILENAME_CATALOG_LOGIN, '', 'SSL') . '</a>'; else $email .= ' (' . tep_catalog_href_link(FILENAME_CATALOG_LOGIN, '', 'SSL') . ')'; $email .= "\n" . EMAIL_SEPARATOR . "\n\n"; if (RCS_EMAIL_FRIENDLY == 'true') $email .= EMAIL_TEXT_SALUTATION . $inrec['fname'] . ","; else $email .= STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n"; if (mysql_num_rows($cquery) < 1) $email .= sprintf(EMAIL_TEXT_NEWCUST_INTRO, $mline); else $email .= sprintf(EMAIL_TEXT_CURCUST_INTRO, $mline); $email .= EMAIL_TEXT_BODY_HEADER . $mline . EMAIL_TEXT_BODY_FOOTER; if( EMAIL_USE_HTML == 'true' ) $email .= '<a HREF="' . tep_catalog_href_link('', '') . '">' . STORE_OWNER . "\n" . tep_catalog_href_link('', '') . '</a>'; else $email .= STORE_OWNER . "\n" . tep_catalog_href_link('', ''); $email .= "\n\n". $_POST['message']; $custname = $inrec['fname']." ".$inrec['lname']; $outEmailAddr = '"' . $custname . '" <' . $inrec['email'] . '>'; if( tep_not_null(RCS_EMAIL_COPIES_TO) ) $outEmailAddr .= ', ' . RCS_EMAIL_COPIES_TO; tep_mail('', $outEmailAddr, EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); $mline = ""; // See if a record for this customer already exists; if not create one and if so update it $donequery = tep_db_query("select * from ". TABLE_SCART ." where customers_id = '".$cid."'"); if (mysql_num_rows($donequery) == 0) tep_db_query("insert into " . TABLE_SCART . " (customers_id, dateadded, datemodified ) values ('" . $cid . "', '" . seadate('0') . "', '" . seadate('0') . "')"); else tep_db_query("update " . TABLE_SCART . " set datemodified = '" . seadate('0') . "' where customers_id = " . $cid ); echo $cline; $cline = ""; } echo "<tr><td colspan=8 align='right' class='dataTableContent'><b>" . TABLE_CART_TOTAL . "</b>" . $currencies->format($tprice) . "</td> </tr>"; echo "<tr><td colspan=6 align='right'><a href=" . tep_href_link(FILENAME_RECOVER_CART_SALES, "action=delete&customer_id=" . $cid . "&tdate=" . $tdate) . ">" . tep_image_button('button_delete.gif', IMAGE_DELETE) . "</a></td> </tr>\n"; echo "<tr><td colspan=6 align=center><a href=".$PHP_SELF.">" . TEXT_RETURN . "</a></td></tr>"; } else //we are NOT doing an e-mail to some customers { ?> <?php echo 'test'; ?> - Shows as test on the webpage --------------------------------------------------------------------------- What I did was to try echo test at certain portion of the php file and I did not get the test displayed on website at the portion of the php file shown above. That portion happens to be the part for getting info and sending the mail to the customer. I am not a php programmer and know nothing about php except that I learnt some programming before and know abit of troubleshooting. The history of my problem starts after I installed the MOD "register_globals_v1.3". Before this MOD was installed, I did a trial test and the email was sent to my mailbox. After that MOD was installed, I did not perform any further testing as I presume this MOD will still work. However, I am wrong. I strongly felt the "register_globals_v1.3" MOD somehow affected this MOD. Anyone manage to get this MOD worked with "register_globals_v1.3"? Or what could be the contribution to my problem? Any advise will be good. Thank you for reading this posting.
  5. Hi guys, I monitor closely on the scart table of my database and notice that it does not get updated eventhough I deleted/added an unfinish cart. Could that be part of the reason why my email does not work? The strange thing is that under the tools-> Recover Cart Sales, I manage to see the unfinished cart items. But I do not see the items under the scart table?? Can anyone advise?
  6. Hi guys, I still can't figure out why I can't use the email notification feature. I notice the email notification feature failed only after I installed the MOD to enable register_global in php.ini file. Could that be the reason? I would appreciate any advise for this.
  7. Thanks for the advise. I was testing with my trial account all the while. The email sending portion from the website for eg. newsletter or to send email to customer was alright. Except the recover cart sale MOD. Anyone can suggest what could be the possible problem? Check also the log from the mailserver but found no mail sent from my website. Strange :(
  8. Hi, Guess no one has the same error as mine. So far no response. Still can't figure out why when I click to send email, it does not show the customer is contacted and no email was sent out. I remember it was working initially when I added this MOD. However, as more MODs are added, I did not try the email portion again until recently I saw customer with outstanding cart items and decided to sent them email. That's when I notice this problem. Hope someone can help.
  9. Hi guys, I am someone who appreciate this MOD. However, the email portion that contacts the customer at the Admin -> Tools portion is not working. Wonder if anyone can assist?
  10. Hi guys, need some help. The MOD works in some sense but the email notification don't seems to work for my case. When I am at the admin page under the tools section. I saw that there is outstanding cart items. So, I check the box next to the user and click send email. When I check the email, no such email was sent or received. Can someone pls advise what to check out for that might cause this problem? My website is http://www.blueseatackle.com Thanks and regards.
  11. Hi guys, This MOD is great. Now I can monitor who is visiting my website. however, I notice that when I click on the linck to display the time and the page visited by the visitor, it shows nothing. Wonder if any great soul can help. Thanks and regards, thpek
  12. Dear Matti, I have never been so happy as I am stuck with this problem trying to look for solution since 2-3 weeks ago. Due to lack in knowledge of PHP programming, I am so glad that help has finally arrived. You are really great. Thanks again pal. :thumbsup:
  13. Is there anyone that can help with my query? I still unable to figure out how to link my slave products back to master product webpage. Appreciate if there will be any expert to advise how to go about it.
  14. Hi all, I notice something and cannot find the solution in this forum. I installed Master Products and is working fine. However, I notice that is customer will to click on the slave product which the browser will bring the to webpage of the slave products, is there anyway to create a link for the customer to click to go to it's master product without affecting it's SessionID as if I just create a direct link to the master product, all the customer product records will be gone as the SessionID is gone. I am a novice for php and am trying to figure out how can this be done. Pls help. Thanks in advance.
  15. Hi guys, Not to worry about my problem anymore. I have redone my website and skip some of the MODs which I suspected could be the problem. So far, it is working fine. Thanks for all the efforts to help me resolve my problem :)
  16. Hi Guys, Am glad that someone responds. I tried the above solution but still have problems updating the items to shopping cart. Detailed problem as follows: 1. Add items to cart, sometimes added sometimes shows empty. 2. Add items to cart (afew) and sometimes the last one added will not be shown in shopping cart. 3. Remove item from cart. Sometimes work sometimes don't. 4. Checkout items and orders closed. But the ordered items still show in shopping cart. Have to removed them one by one. Sometimes happen sometimes don't. 5. Login and add items to cart. Checkout and login using a valid ID. Items empty. Sometimes also. The most weird thing is that after I login or whenever I click on the "Top" link, all things seems to be resetted. Eg. login shows empty, shopping cart all blank. All the problems above could be related to the MODs I have installed. I know is a list of problems and very hard to troubleshoot but I do believe that they are of similar cause as the symptoms are quite identical. Below are the MODs I have installed for ref: They are in order. 1. Master_products-v1.1.5.zip 2. WYSIWYG HTMLAreaMS2v1_7.zip 3. categories_description_MS2_1.9.zip 4. Margin Report v2.56b.zip 5. Google Adsense Box.zip 6. news_scroller_with_ff-fix ver 1.zip 7. mail_validation_1_4.zip 8. disable_right_click_and_dragV1.2.zip Infact, it's really easy to see the problems if you were to try them at the website: www.blueseatackle.com However, you will get to see some of the problems even without creating an account. Sorry for such a long thread. Am about to give up and redo the whole thing again as this is really getting me no where. Good thing is that I do backup almost after each MOD installed. So I am trying to figure out which MOD may be the problem. Did suspected 4. Margin Report v2.56b.zip is the cause. Restore to the files before this MOD and it seems to be much better. place this MOD back and problem seems to come back although not so visible. However, even if i skip this MOD and proceed with 5. Google Adsense Box.zip 6. news_scroller_with_ff-fix ver 1.zip 8. disable_right_click_and_dragV1.2.zip The problem seems there as well. So can't really pinpoint which is the real problem. Appreciate all possible contribution for the solution.
  17. Hi guys, notice my problem with the shopping cart was due to the fact that I install Master Product with Margin Reports. That may be the cause why the shopping cart is empty or not showing the correct items at times. Anyone manage to get these 2 MODs working together? Mind sharing your experience and what needs to be done?
  18. Needed help please. Post a chat above regarding the problem with Master Products MOD on my newly installed OSC2.2. Had the problem of an empty shopping cart although things are added. Have some other related problems as well. Need some expert advise as I am a noivce or not even to mention know programming of PHP.
  19. Hi, sorry about that. Got the problem with empty shopping cart. Also encounter problems with the shopping cart not being emptied after successful order. It's hard for me to explain. If you like to tried out at my website, pls do so. Any if you need a test account, just create one as I will clear all the accounts before provision. Pls help out.
  20. Hi guys, really need help. Have already made the necessary bug fix to resolve this error via the previous chat. But problem still there. Pls refer to the application_top.php file as follows: <?php /* $Id: application_top.php,v 1.280 2003/07/12 09:38:07 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright ? 2003 osCommerce Master Products - JOHNSON - 05/07/2003 [email protected] Copyright ? 2003 Suomedia - Dynamic Content Management Released under the GNU General Public License */ // start the timer for the page parse time log define('PAGE_PARSE_START_TIME', microtime()); // set the level of error reporting error_reporting(E_ALL & ~E_NOTICE); // check if register_globals is enabled. // since this is a temporary measure this message is hardcoded. The requirement will be removed before 2.2 is finalized. if (function_exists('ini_get')) { ini_get('register_globals') or exit('FATAL ERROR: register_globals is disabled in php.ini, please enable it!'); } // Set the local configuration parameters - mainly for developers if (file_exists('includes/local/configure.php')) include('includes/local/configure.php'); // include server parameters require('includes/configure.php'); if (strlen(DB_SERVER) < 1) { if (is_dir('install')) { header('Location: install/index.php'); } } // define the project version define('PROJECT_VERSION', 'osCommerce 2.2-MS2'); // set the type of request (secure or not) $request_type = (getenv('HTTPS') == 'on') ? 'SSL' : 'NONSSL'; // set php_self in the local scope if (!isset($PHP_SELF)) $PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF']; if ($request_type == 'NONSSL') { define('DIR_WS_CATALOG', DIR_WS_HTTP_CATALOG); } else { define('DIR_WS_CATALOG', DIR_WS_HTTPS_CATALOG); } // include the list of project filenames require(DIR_WS_INCLUDES . 'filenames.php'); // include the list of project database tables require(DIR_WS_INCLUDES . 'database_tables.php'); // customization for the design layout define('BOX_WIDTH', 125); // how wide the boxes should be in pixels (default: 125) // include the database functions require(DIR_WS_FUNCTIONS . 'database.php'); // make a connection to the database... now tep_db_connect() or die('Unable to connect to database server!'); // set the application parameters $configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION); while ($configuration = tep_db_fetch_array($configuration_query)) { define($configuration['cfgKey'], $configuration['cfgValue']); } // if gzip_compression is enabled, start to buffer the output if ( (GZIP_COMPRESSION == 'true') && ($ext_zlib_loaded = extension_loaded('zlib')) && (PHP_VERSION >= '4') ) { if (($ini_zlib_output_compression = (int)ini_get('zlib.output_compression')) < 1) { if (PHP_VERSION >= '4.0.4') { ob_start('ob_gzhandler'); } else { include(DIR_WS_FUNCTIONS . 'gzip_compression.php'); ob_start(); ob_implicit_flush(); } } else { ini_set('zlib.output_compression_level', GZIP_LEVEL); } } // set the HTTP GET parameters manually if search_engine_friendly_urls is enabled if (SEARCH_ENGINE_FRIENDLY_URLS == 'true') { if (strlen(getenv('PATH_INFO')) > 1) { $GET_array = array(); $PHP_SELF = str_replace(getenv('PATH_INFO'), '', $PHP_SELF); $vars = explode('/', substr(getenv('PATH_INFO'), 1)); for ($i=0, $n=sizeof($vars); $i<$n; $i++) { if (strpos($vars[$i], '[]')) { $GET_array[substr($vars[$i], 0, -2)][] = $vars[$i+1]; } else { $HTTP_GET_VARS[$vars[$i]] = $vars[$i+1]; } $i++; } if (sizeof($GET_array) > 0) { while (list($key, $value) = each($GET_array)) { $HTTP_GET_VARS[$key] = $value; } } } } // define general functions used application-wide require(DIR_WS_FUNCTIONS . 'general.php'); require(DIR_WS_FUNCTIONS . 'html_output.php'); // set the cookie domain $cookie_domain = (($request_type == 'NONSSL') ? HTTP_COOKIE_DOMAIN : HTTPS_COOKIE_DOMAIN); $cookie_path = (($request_type == 'NONSSL') ? HTTP_COOKIE_PATH : HTTPS_COOKIE_PATH); // include cache functions if enabled if (USE_CACHE == 'true') include(DIR_WS_FUNCTIONS . 'cache.php'); // include shopping cart class require(DIR_WS_CLASSES . 'shopping_cart.php'); // include navigation history class require(DIR_WS_CLASSES . 'navigation_history.php'); // some code to solve compatibility issues require(DIR_WS_FUNCTIONS . 'compatibility.php'); // check if sessions are supported, otherwise use the php3 compatible session class if (!function_exists('session_start')) { define('PHP_SESSION_NAME', 'osCsid'); define('PHP_SESSION_PATH', $cookie_path); define('PHP_SESSION_DOMAIN', $cookie_domain); define('PHP_SESSION_SAVE_PATH', SESSION_WRITE_DIRECTORY); include(DIR_WS_CLASSES . 'sessions.php'); } // define how the session functions will be used require(DIR_WS_FUNCTIONS . 'sessions.php'); // set the session name and save path tep_session_name('osCsid'); tep_session_save_path(SESSION_WRITE_DIRECTORY); // set the session cookie parameters if (function_exists('session_set_cookie_params')) { session_set_cookie_params(0, $cookie_path, $cookie_domain); } elseif (function_exists('ini_set')) { ini_set('session.cookie_lifetime', '0'); ini_set('session.cookie_path', $cookie_path); ini_set('session.cookie_domain', $cookie_domain); } // set the session ID if it exists if (isset($HTTP_POST_VARS[tep_session_name()])) { tep_session_id($HTTP_POST_VARS[tep_session_name()]); } elseif ( ($request_type == 'SSL') && isset($HTTP_GET_VARS[tep_session_name()]) ) { tep_session_id($HTTP_GET_VARS[tep_session_name()]); } // start the session $session_started = false; if (SESSION_FORCE_COOKIE_USE == 'True') { tep_setcookie('cookie_test', 'please_accept_for_session', time()+60*60*24*30, $cookie_path, $cookie_domain); if (isset($HTTP_COOKIE_VARS['cookie_test'])) { tep_session_start(); $session_started = true; } } elseif (SESSION_BLOCK_SPIDERS == 'True') { $user_agent = strtolower(getenv('HTTP_USER_AGENT')); $spider_flag = false; if (tep_not_null($user_agent)) { $spiders = file(DIR_WS_INCLUDES . 'spiders.txt'); for ($i=0, $n=sizeof($spiders); $i<$n; $i++) { if (tep_not_null($spiders[$i])) { if (is_integer(strpos($user_agent, trim($spiders[$i])))) { $spider_flag = true; break; } } } } if ($spider_flag == false) { tep_session_start(); $session_started = true; } } else { tep_session_start(); $session_started = true; } // set SID once, even if empty $SID = (defined('SID') ? SID : ''); // verify the ssl_session_id if the feature is enabled if ( ($request_type == 'SSL') && (SESSION_CHECK_SSL_SESSION_ID == 'True') && (ENABLE_SSL == true) && ($session_started == true) ) { $ssl_session_id = getenv('SSL_SESSION_ID'); if (!tep_session_is_registered('SSL_SESSION_ID')) { $SESSION_SSL_ID = $ssl_session_id; tep_session_register('SESSION_SSL_ID'); } if ($SESSION_SSL_ID != $ssl_session_id) { tep_session_destroy(); tep_redirect(tep_href_link(FILENAME_SSL_CHECK)); } } // verify the browser user agent if the feature is enabled if (SESSION_CHECK_USER_AGENT == 'True') { $http_user_agent = getenv('HTTP_USER_AGENT'); if (!tep_session_is_registered('SESSION_USER_AGENT')) { $SESSION_USER_AGENT = $http_user_agent; tep_session_register('SESSION_USER_AGENT'); } if ($SESSION_USER_AGENT != $http_user_agent) { tep_session_destroy(); tep_redirect(tep_href_link(FILENAME_LOGIN)); } } // verify the IP address if the feature is enabled if (SESSION_CHECK_IP_ADDRESS == 'True') { $ip_address = tep_get_ip_address(); if (!tep_session_is_registered('SESSION_IP_ADDRESS')) { $SESSION_IP_ADDRESS = $ip_address; tep_session_register('SESSION_IP_ADDRESS'); } if ($SESSION_IP_ADDRESS != $ip_address) { tep_session_destroy(); tep_redirect(tep_href_link(FILENAME_LOGIN)); } } // create the shopping cart & fix the cart if necesary if (tep_session_is_registered('cart') && is_object($cart)) { if (PHP_VERSION < 4) { $broken_cart = $cart; $cart = new shoppingCart; $cart->unserialize($broken_cart); } } else { tep_session_register('cart'); $cart = new shoppingCart; } // include currencies class and create an instance require(DIR_WS_CLASSES . 'currencies.php'); $currencies = new currencies(); // include the mail classes require(DIR_WS_CLASSES . 'mime.php'); require(DIR_WS_CLASSES . 'email.php'); // set the language if (!tep_session_is_registered('language') || isset($HTTP_GET_VARS['language'])) { if (!tep_session_is_registered('language')) { tep_session_register('language'); tep_session_register('languages_id'); } include(DIR_WS_CLASSES . 'language.php'); $lng = new language(); if (isset($HTTP_GET_VARS['language']) && tep_not_null($HTTP_GET_VARS['language'])) { $lng->set_language($HTTP_GET_VARS['language']); } else { $lng->get_browser_language(); } $language = $lng->language['directory']; $languages_id = $lng->language['id']; } // include the language translations require(DIR_WS_LANGUAGES . $language . '.php'); // currency if (!tep_session_is_registered('currency') || isset($HTTP_GET_VARS['currency']) || ( (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') && (LANGUAGE_CURRENCY != $currency) ) ) { if (!tep_session_is_registered('currency')) tep_session_register('currency'); if (isset($HTTP_GET_VARS['currency'])) { if (!$currency = tep_currency_exists($HTTP_GET_VARS['currency'])) $currency = (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') ? LANGUAGE_CURRENCY : DEFAULT_CURRENCY; } else { $currency = (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') ? LANGUAGE_CURRENCY : DEFAULT_CURRENCY; } } // navigation history if (tep_session_is_registered('navigation')) { if (PHP_VERSION < 4) { $broken_navigation = $navigation; $navigation = new navigationHistory; $navigation->unserialize($broken_navigation); } } else { tep_session_register('navigation'); $navigation = new navigationHistory; } $navigation->add_current_page(); // Shopping cart actions if (isset($HTTP_GET_VARS['action'])) { // redirect the customer to a friendly cookie-must-be-enabled page if cookies are disabled if ($session_started == false) { tep_redirect(tep_href_link(FILENAME_COOKIE_USAGE)); } if (DISPLAY_CART == 'true') { $goto = FILENAME_SHOPPING_CART; $parameters = array('action', 'cPath', 'products_id', 'pid'); } else { $goto = basename($PHP_SELF); if ($HTTP_GET_VARS['action'] == 'buy_now') { $parameters = array('action', 'pid', 'products_id'); } else { $parameters = array('action', 'pid'); } } switch ($HTTP_GET_VARS['action']) { // customer wants to update the product quantity in their shopping cart case 'update_product' : for ($i=0, $n=sizeof($HTTP_POST_VARS['products_id']); $i<$n; $i++) { if (in_array($HTTP_POST_VARS['products_id'][$i], (is_array($HTTP_POST_VARS['cart_delete']) ? $HTTP_POST_VARS['cart_delete'] : array()))) { $cart->remove($HTTP_POST_VARS['products_id'][$i]); } else { if (PHP_VERSION < 4) { // if PHP3, make correction for lack of multidimensional array. reset($HTTP_POST_VARS); while (list($key, $value) = each($HTTP_POST_VARS)) { if (is_array($value)) { while (list($key2, $value2) = each($value)) { if (ereg ("(.*)][(.*)", $key2, $var)) { $id2[$var[1]][$var[2]] = $value2; } } } } $attributes = ($id2[$HTTP_POST_VARS['products_id'][$i]]) ? $id2[$HTTP_POST_VARS['products_id'][$i]] : ''; } else { $attributes = ($HTTP_POST_VARS['id'][$HTTP_POST_VARS['products_id'][$i]]) ? $HTTP_POST_VARS['id'][$HTTP_POST_VARS['products_id'][$i]] : ''; } $cart->add_cart($HTTP_POST_VARS['products_id'][$i], $HTTP_POST_VARS['cart_quantity'][$i], $attributes, false); } } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); break; // customer adds a product from the products page case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) { $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']); } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); break; //Master Products // customer adds multiple products from the master_listing page case 'add_slave' : reset($HTTP_POST_VARS); while ( list( $key, $val ) = each( $HTTP_POST_VARS ) ) { if (substr($key,0,11) == "Qty_ProdId_") { $prodId = substr($key,11); $qty = $val; if(isset($HTTP_POST_VARS["id_$prodId"]) && is_array($HTTP_POST_VARS["id_$prodId"])) { // We have attributes $cart->add_cart($prodId, $cart->get_quantity(tep_get_uprid($prodId,$HTTP_POST_VARS["id_$prodId"]))+$qty, $HTTP_POST_VARS["id_$prodId"]); } else { // No attributes $cart->add_cart($prodId, $cart->get_quantity($prodId)+$qty); } } } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); break; //Master Products EOF // performed by the 'buy now' button in product listings and review page case 'buy_now' : if (isset($HTTP_GET_VARS['products_id'])) { if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) { tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id'])); } else { $cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+1); } } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); break; case 'notify' : if (tep_session_is_registered('customer_id')) { if (isset($HTTP_GET_VARS['products_id'])) { $notify = $HTTP_GET_VARS['products_id']; } elseif (isset($HTTP_GET_VARS['notify'])) { $notify = $HTTP_GET_VARS['notify']; } elseif (isset($HTTP_POST_VARS['notify'])) { $notify = $HTTP_POST_VARS['notify']; } else { tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'notify')))); } if (!is_array($notify)) $notify = array($notify); for ($i=0, $n=sizeof($notify); $i<$n; $i++) { $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $notify[$i] . "' and customers_id = '" . $customer_id . "'"); $check = tep_db_fetch_array($check_query); if ($check['count'] < 1) { tep_db_query("insert into " . TABLE_PRODUCTS_NOTIFICATIONS . " (products_id, customers_id, date_added) values ('" . $notify[$i] . "', '" . $customer_id . "', now())"); } } tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'notify')))); } else { $navigation->set_snapshot(); tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); } break; case 'notify_remove' : if (tep_session_is_registered('customer_id') && isset($HTTP_GET_VARS['products_id'])) { $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'"); $check = tep_db_fetch_array($check_query); if ($check['count'] > 0) { tep_db_query("delete from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'"); } tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')))); } else { $navigation->set_snapshot(); tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); } break; case 'cust_order' : if (tep_session_is_registered('customer_id') && isset($HTTP_GET_VARS['pid'])) { if (tep_has_product_attributes($HTTP_GET_VARS['pid'])) { tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['pid'])); } else { $cart->add_cart($HTTP_GET_VARS['pid'], $cart->get_quantity($HTTP_GET_VARS['pid'])+1); } } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); break; } } // include the who's online functions require(DIR_WS_FUNCTIONS . 'whos_online.php'); tep_update_whos_online(); // include the password crypto functions require(DIR_WS_FUNCTIONS . 'password_funcs.php'); // include validation functions (right now only email address) require(DIR_WS_FUNCTIONS . 'validations.php'); // split-page-results require(DIR_WS_CLASSES . 'split_page_results.php'); // infobox require(DIR_WS_CLASSES . 'boxes.php'); // auto activate and expire banners require(DIR_WS_FUNCTIONS . 'banner.php'); tep_activate_banners(); tep_expire_banners(); // auto expire special products require(DIR_WS_FUNCTIONS . 'specials.php'); tep_expire_specials(); // calculate category path if (isset($HTTP_GET_VARS['cPath'])) { $cPath = $HTTP_GET_VARS['cPath']; } elseif (isset($HTTP_GET_VARS['products_id']) && !isset($HTTP_GET_VARS['manufacturers_id'])) { $cPath = tep_get_product_path($HTTP_GET_VARS['products_id']); } else { $cPath = ''; } if (tep_not_null($cPath)) { $cPath_array = tep_parse_category_path($cPath); $cPath = implode('_', $cPath_array); $current_category_id = $cPath_array[(sizeof($cPath_array)-1)]; } else { $current_category_id = 0; } // include the breadcrumb class and start the breadcrumb trail require(DIR_WS_CLASSES . 'breadcrumb.php'); $breadcrumb = new breadcrumb; $breadcrumb->add(HEADER_TITLE_TOP, HTTP_SERVER); $breadcrumb->add(HEADER_TITLE_CATALOG, tep_href_link(FILENAME_DEFAULT)); // add category names or the manufacturer name to the breadcrumb trail if (isset($cPath_array)) { for ($i=0, $n=sizeof($cPath_array); $i<$n; $i++) { $categories_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$cPath_array[$i] . "' and language_id = '" . (int)$languages_id . "'"); if (tep_db_num_rows($categories_query) > 0) { $categories = tep_db_fetch_array($categories_query); $breadcrumb->add($categories['categories_name'], tep_href_link(FILENAME_DEFAULT, 'cPath=' . implode('_', array_slice($cPath_array, 0, ($i+1))))); } else { break; } } } elseif (isset($HTTP_GET_VARS['manufacturers_id'])) { $manufacturers_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'"); if (tep_db_num_rows($manufacturers_query)) { $manufacturers = tep_db_fetch_array($manufacturers_query); $breadcrumb->add($manufacturers['manufacturers_name'], tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'])); } } // add the products model to the breadcrumb trail if (isset($HTTP_GET_VARS['products_id'])) { $model_query = tep_db_query("select products_model from " . TABLE_PRODUCTS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'"); if (tep_db_num_rows($model_query)) { $model = tep_db_fetch_array($model_query); $breadcrumb->add($model['products_model'], tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . $cPath . '&products_id=' . $HTTP_GET_VARS['products_id'])); } } // initialize the message stack for output messages require(DIR_WS_CLASSES . 'message_stack.php'); $messageStack = new messageStack; // set which precautions should be checked define('WARN_INSTALL_EXISTENCE', 'true'); define('WARN_CONFIG_WRITEABLE', 'true'); define('WARN_SESSION_DIRECTORY_NOT_WRITEABLE', 'true'); define('WARN_SESSION_AUTO_START', 'true'); define('WARN_DOWNLOAD_DIRECTORY_NOT_READABLE', 'true'); ?> You may like to test and see the results yourself at my website: http://www.blueseatackle.com/ Pls help. Thank you.
  21. Hi, It's fine now. Guess there was some problem with the test email account. Thank you.
  22. Hi, Managed to get the mod up but when I tried to send verification email, it states an email was sent but I never receive. Any advise?
  23. No worries for this. Managed to remove the changes for 3 files and looks fine now. Thank you.
  24. Hi, additional notes to my problem in the last posting. As mention in the posting above who have the same problem as mine, have to revert the /include/classes/order.php & shopping_cart.php (means without changes as of margin report installation) and /checing_process.php files back to before to resolve this problem. Wonder what difference can we see/impact if we did/didn't follow the instructions to include the changes as per margin report installation notes. Thanks for advise.
  25. HI, a great contribution and very useful to me. However I have problems getting it to work with Osc2.2 installed with ACA. The margin report works fine but the shop is not now. After placing orders, when customer checkout, it shows blank screen and when customer review their order also blank screen. May have more problem. Just a few I notice. Possible to advise how to integrate your MOD to ACA? Thanks in advance.
×
×
  • Create New...