Bobbywires Posted April 7, 2010 Share Posted April 7, 2010 I have researched the add-ons and haven't found many answers. The "Separate price for customers" add-on is over kill for what I need. Is there any documentation on oscommerce code that I could write my own add-on? Other PHP apps usually have functions lists that may be used by developers. Link to comment Share on other sites More sharing options...
♥mdtaylorlrim Posted April 7, 2010 Share Posted April 7, 2010 I have researched the add-ons and haven't found many answers. The "Separate price for customers" add-on is over kill for what I need. Is there any documentation on oscommerce code that I could write my own add-on? Other PHP apps usually have functions lists that may be used by developers. You could simply show the specials.php only when logged in. Community Bootstrap Edition, Edge Avoid the most asked question. See How to Secure My Site and How do I...? Link to comment Share on other sites More sharing options...
Bobbywires Posted April 7, 2010 Author Share Posted April 7, 2010 I'm a real nooby with oscommerce so excuse my ignorance. The specials page only allows price and experation date. How do I only show specials when logged in? Link to comment Share on other sites More sharing options...
♥mdtaylorlrim Posted April 7, 2010 Share Posted April 7, 2010 I'm a real nooby with oscommerce so excuse my ignorance. The specials page only allows price and experation date. How do I only show specials when logged in? If you are going to use osCommerce then you are going to have to be willing to do some code changes to the file, and the occasional database change with phpMyAdmin. Free does not always mean easy. Are you willing to learn? Community Bootstrap Edition, Edge Avoid the most asked question. See How to Secure My Site and How do I...? Link to comment Share on other sites More sharing options...
Bobbywires Posted April 7, 2010 Author Share Posted April 7, 2010 If you are going to use osCommerce then you are going to have to be willing to do some code changes to the file, and the occasional database change with phpMyAdmin. Free does not always mean easy. Are you willing to learn? I've found the function "tep_session_is_registered('customer_id')" which I think returns true if the user is logged in. I can modify the mysql query "IF(s.status, s.specials_new_products_price, p.products_price)" to incluse a logical AND against the "if logged in" varable and see if it works. :-" Link to comment Share on other sites More sharing options...
♥mdtaylorlrim Posted April 7, 2010 Share Posted April 7, 2010 I've found the function "tep_session_is_registered('customer_id')" which I think returns true if the user is logged in. I can modify the mysql query "IF(s.status, s.specials_new_products_price, p.products_price)" to incluse a logical AND against the "if logged in" varable and see if it works. :-" You're on the right track. if (tep_session_is_registered('customer_id')) include(DIR_WS_BOXES . 'specials.php'); This would show the specials infobox only if the customer was logged in. Community Bootstrap Edition, Edge Avoid the most asked question. See How to Secure My Site and How do I...? Link to comment Share on other sites More sharing options...
Bobbywires Posted April 7, 2010 Author Share Posted April 7, 2010 You're on the right track. if (tep_session_is_registered('customer_id')) include(DIR_WS_BOXES . 'specials.php'); This would show the specials infobox only if the customer was logged in. It is done Modified: /catalog/index.php /catalog/specials.php /catalog/includes/modules/new_products.php /catalog/includes/specials.php All of which display specials. added: if (tep_session_is_registered('customer_id')) { $modx = 1; } else { $modx = 0; } and used $modx in the query strings. Link to comment Share on other sites More sharing options...
Bobbywires Posted April 7, 2010 Author Share Posted April 7, 2010 Found another change /catalog/includes/functions/general.php function tep_get_products_special_price($product_id) { if (tep_session_is_registered('customer_id')) { $modx = 1; } else { $modx = 0; } $product_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . (int)$product_id . "' and status and ".$modx." = 1 "); $product = tep_db_fetch_array($product_query); return $product['specials_new_products_price']; } Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.