Twillders Posted March 11, 2005 Share Posted March 11, 2005 Hi How do i get the customer to login before prices are revealed?so if not account is help no product prices are shown Link to comment Share on other sites More sharing options...
Tcet Posted March 11, 2005 Share Posted March 11, 2005 Hi ..my boss asked me the sma ething befor i started installing Oscommerce.. Here's what you can do ... I hope you are a little familiar with looking at the code..nothing fancy required... Can you find you're way around the HTML...tags... (if not ..just mail ..me i might be able to do it for you... just a fair trade..) (i have been planning to create an contribution for that..but have other things to do first so it might take a while..and you might notbeable to wait thatlong!) If so ..you can use this.. for the prices... You have to go through all the files that list prices... And DOUBLE the code...for easy quick results..) You get...something like... For example .the SPECIALS BOx ..rightcolumn Go to ...catalog/includes/boxes/specials.php open... Now you see the code/... that produces the contents( img..weight..price..name...) that you see in the right column... this code ..also ..LIST PRICES!!! What you want to do .. and that goes for all..the price parts you want to edit... something like.. if (!tep_session_is_registered('customer_id')){ ..your edited code...(=copy code there+takeout price) }else{ the code that was there(untouched) }; I give you my actual code ..for ../includes/boxes/specials.php... Look at it nade compare with your code.... and you'll see what i did....to "UNDO" the price listing..K.. There are SMARTEr way of doing this..but this way works for everyone... Also ... if youhave to edit the price in the files in the catalog forlde ..or anything like that ... see something like ... <tr> <td> <php? echo "<img src="image/myAdvertisemetNOlogin.gif">"; ?> </td> </tr> OR.... <tr> <td> <php? echo tep_image(DIR_WS_IMAGES . 'myAdvertismentloginok.gif'); ?> </td> </tr> You can now control content..If customer is logged in..(display general info about your specials...and asking them to JOINT first to see OR..of list specials...bolow..the text for all .. that logged in.... If you replse the above code likethis.... <tr> <td> if (!tep_session_is_registered('customer_id')){ <php? echo "<img src="image/myAdvertisemetNOlogin.gif">"; ?> }else{ <php? echo tep_image(DIR_WS_IMAGES . 'myAdvertismentloginok.gif'); ?> }; </td> </tr> Hope that helps, otherwise ...just ask, K Alx... I help you, you help me ...and before you know it ...?? We might actually have a COMMUNITY! Link to comment Share on other sites More sharing options...
Tcet Posted March 11, 2005 Share Posted March 11, 2005 HERE's the example code... from my site My Webpage Still working on it ... but prices are edited ..so are SOME LINKS... NOtice how i used the same thing to BLOCK the entire shop part from users and the get REDOIECTED to the NEWSLETTER. if (!tep_session_is_registered('customer_id')){ tep_redirect(tep_href_link(FILENAME_NIEUWSBRIEF)); }else{ <doctype...> <html... ..the code already on your index page...untouched </body> ../html> }; ANYWAY ...The code i wanted to give you for the SPECIALS BOX.. IS this... <?php /* $Id: specials.php,v 1.31 2003/06/09 22:21:03 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ if ($random_product = tep_random_select("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' order by s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS)) { ?> <!-- specials //--> <tr> <td> <?php if (!tep_session_is_registered('customer_id')){ $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_SPECIALS); new infoBoxHeading($info_box_contents, false, false, ''); $info_box_contents = array(); $info_box_contents[] = array('align' => 'center', 'text' => '' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '<br><br><b><font size="+">' . $random_product['products_name'] . '</font></b>' ); new infoBox($info_box_contents); }else{ $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_SPECIALS); new infoBoxHeading($info_box_contents, false, false, tep_href_link('actie_korting.php?inhoud=link2')); $info_box_contents = array(); $info_box_contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product["products_id"]) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a>'. '<br><s>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>'); new infoBox($info_box_contents); }; ?> </td> </tr> <!-- specials_eof //--> <?php } ?> Let me know how that works out for you! Cheers, Alx Link to comment Share on other sites More sharing options...
Twillders Posted March 11, 2005 Author Share Posted March 11, 2005 Hi How do i get the customer to login before prices are revealed?so if not account is help no product prices are shown <{POST_SNAPBACK}> Hi Thanks for your reply but to tell you the truth i didnt get any of it. Be great if you could do it for me. Thanks :) Link to comment Share on other sites More sharing options...
Tcet Posted March 11, 2005 Share Posted March 11, 2005 HiThanks for your reply but to tell you the truth i didnt get any of it. Be great if you could do it for me. Thanks :) <{POST_SNAPBACK}> Sure! How do you wanna do it...? I need either one two things... A copy of your catalog folder... or ftp acces...so i can make a copy... ..edit the files ... so you can just drag and drop it back onto yourserver...and continue where youleft off... (you'll still beable to add or oudate the databse..with rpoducts and such... the files in catalog ..only read data..to display. That way you can keep updating the content for your site ..with the site you have ..... and after i'm done ...every thing is the same ...just the rpices are not-shown if not logged .in.. IS it a NEW oscommerce install ..are there other updates you would like to install first...(might make it a little harder to do so .. since the rpices get listed all over the place.... like the product listing fix...(instead of products from catagories get shown...one-per-line....it does 3 or 4 ..next to eachother..for each line ...(LIKE SPECIALS page) Idunno.... Let me know,..what's up.. and what you're intentions are concerning the contributions youhave or still would like ...i suggest tat we do those first... Anyway... cheers, Alx Link to comment Share on other sites More sharing options...
Twillders Posted March 11, 2005 Author Share Posted March 11, 2005 Sure!How do you wanna do it...? I need either one two things... A copy of your catalog folder... or ftp acces...so i can make a copy... ..edit the files ... so you can just drag and drop it back onto yourserver...and continue where youleft off... (you'll still beable to add or oudate the databse..with rpoducts and such... the files in catalog ..only read data..to display. That way you can keep updating the content for your site ..with the site you have ..... and after i'm done ...every thing is the same ...just the rpices are not-shown if not logged .in.. IS it a NEW oscommerce install ..are there other updates you would like to install first...(might make it a little harder to do so .. since the rpices get listed all over the place.... like the product listing fix...(instead of products from catagories get shown...one-per-line....it does 3 or 4 ..next to eachother..for each line ...(LIKE SPECIALS page) Idunno.... Let me know,..what's up.. and what you're intentions are concerning the contributions youhave or still would like ...i suggest tat we do those first... Anyway... cheers, Alx <{POST_SNAPBACK}> Hi Alx could i just give you my login details so that you could acces the file and sort if for me please Thanks Tracey Link to comment Share on other sites More sharing options...
Tcet Posted March 11, 2005 Share Posted March 11, 2005 Sure...you can. First of all.. I willneed the FTP adress.... Something like ftp.myshop.com a user name +password and perhaps...a port number if not (default 21) I'll make a copy...of the files and edit it from here.. What's the time frame on that, anyway? I wont get around to it until monday..or some 'stolen' hours inbetween.. still working on my own deadline... but this are look up..so .. ... Also ..what's it worth to ya? I'd say .. i fix it and return the files like you asked a week later. and you ..order me a token of appreciation at amazon.com or something..(they'll ship to my adres...) it should be a token ...!...not an income.!, K? ..think of a number ...subtract shipping cost to holland... and let me know what's left...hihi...of your orriginal number (what ever you feel! is fair) and let me know....what that is .. without second guessing.. the number you had in mind.... i'll pick something...for that amount...let you know and that's that? How abou t that... it might be hard for you to edit.. butit's still fun for me... so you decide the worth..k.. Remember ..think Token ... not income..k? Link to comment Share on other sites More sharing options...
Tcet Posted March 11, 2005 Share Posted March 11, 2005 my email is listed on my Personal CArd information. Alx Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.