Guest Posted January 27, 2010 Share Posted January 27, 2010 Hello everyone, I need to change the URL redirect found in product_info.php so that during the product creation process an email address can be entered into the box instead of a URL. This is the code from the product_info.php: if (tep_not_null($product_info['products_url'])) { ?> <tr> <td class="main"><?php echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false)); ?></td> </tr> So, I want the product description to have a link to an email address instead. When the customer clicks: For more information, please (<a href="mailto:[email protected]">)<u>Email</u>(</a>)the sales rep. minus the () ofcourse. Any ideas ? Chris Link to comment Share on other sites More sharing options...
multimixer Posted January 27, 2010 Share Posted January 27, 2010 I saw somewhere a contribution to request more info about a product, "ask a question" something like this, maybe this could do An other idea is to work on the tell a friend example as follows: 1) Make a new file on tell_a_friend.php basis, call it ie salesrep.php. Just change the empty input fields for friends name and email to be prefiled with the salesrep info. Customer will be able to add comments and the salesrep will know what the customer is talking about 2) make a button that will go to this file, best is if it pop up in a new window not to leave the product info page 3) Maybe to make a dropdown with various salereps ie regional? Just an idea, I hope it match your concept, so if you like this direction, lets think about in detail My community profile | Template system for osCommerce - New: Responsive | Feedback channel Link to comment Share on other sites More sharing options...
♥mdtaylorlrim Posted January 27, 2010 Share Posted January 27, 2010 Have you tried this: if (tep_not_null($product_info['products_url'])) { ?> <tr> <td class="main"><?php echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto=your_email\@your_domain.com' ), 'NONSSL', true, false)); ?></td> </tr> 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...
Guest Posted January 27, 2010 Share Posted January 27, 2010 Hey Mark, This can't be that difficult to change what that line of code does. I have played with it but keep getting syntax issues. Instead of going to a URL, I just need it to open the customers default email client. Has to be a simple solution. But, I just can't seem to get it right. Chris Link to comment Share on other sites More sharing options...
♥mdtaylorlrim Posted January 27, 2010 Share Posted January 27, 2010 Rethought and edited to something much simpler... 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...
Guest Posted January 27, 2010 Share Posted January 27, 2010 Mark, As soon as OSC hits FILENAME_REDIRECT, the redirect.php forces the email address to be a URL. Popup opens asking 'Are you sure you want to log into yourdomain.com using username sales. Chris Link to comment Share on other sites More sharing options...
multimixer Posted January 27, 2010 Share Posted January 27, 2010 Why do you need to use the FILENAME_REDIRECT at all? My community profile | Template system for osCommerce - New: Responsive | Feedback channel Link to comment Share on other sites More sharing options...
Guest Posted January 27, 2010 Share Posted January 27, 2010 Hi George, I did try the 'Ask a Question' Contribution. However, it conflicts with the Simple Multi Image Add-on w/fancy Pop-up Contribution that is already installed. Thanks for the suggestion though. Chris Link to comment Share on other sites More sharing options...
♥mdtaylorlrim Posted January 27, 2010 Share Posted January 27, 2010 then either try mailto: in front of the email address, or just get rid of the tep function altogether and put a simply html link there. You're not building this for someone else are you? If you do not need to keep it tep compliant then don't worry about the tep functions. 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...
Guest Posted January 27, 2010 Share Posted January 27, 2010 Mark, Yes, this is for a client. It is a used car lot. Salespersons work on commission so they want any vehicle that is added to the site to have the sales reps email address on the product info page. (whoever creates the posting, gets to put their direct contact info on the page) You can see it at www.dunwebhostingDOTcom/vehicle If you look at under General Motors and click the Pontiac G6.......you will see the link, and see the outcome if you click it. Chris Link to comment Share on other sites More sharing options...
♥mdtaylorlrim Posted January 27, 2010 Share Posted January 27, 2010 Mark, Yes, this is for a client. It is a used car lot. Salespersons work on commission so they want any vehicle that is added to the site to have the sales reps email address on the product info page. (whoever creates the posting, gets to put their direct contact info on the page) You can see it at www.dunwebhostingDOTcom/vehicle If you look at under General Motors and click the Pontiac G6.......you will see the link, and see the outcome if you click it. Chris Ok, then you obviously have a field in the products table for the salesman that created the listing. Now you will have to create a new tep function to create an email link, or just hard code in the link. <td class="main"><?php echo "<a href=mailto:" . $salesman_email . " >Contact Sales</a>" ?></td> If you want to keep it tep and language compliant then there will be a bit more work to do. 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...
Guest Posted January 27, 2010 Share Posted January 27, 2010 Hi Mark, I never even thought of the categories.php file in Admin. Here is that code: <td class="main"><?php if ($i == 0) echo TEXT_PRODUCTS_URL . '<br><small>' . TEXT_PRODUCTS_URL_WITHOUT_HTTP . '</small>'; ?></td> <td class="main"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_input_field('products_url[' . $languages[$i]['id'] . ']', (isset($products_url[$languages[$i]['id']]) ? stripslashes($products_url[$languages[$i]['id']]) : tep_get_products_url($pInfo->products_id, $languages[$i]['id']))); ?></td> I was just thinking this was a text field input. Obviously I was wrong. Chris Link to comment Share on other sites More sharing options...
♥mdtaylorlrim Posted January 27, 2010 Share Posted January 27, 2010 No, the product URL field in the catalog in admin cannot be used for this. You need an extra field.... OR...why not put the email link in the product description? 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...
Guest Posted January 27, 2010 Share Posted January 27, 2010 Hi Mark, Thanks for the input. I might have to rethink this. The sales rep email must be entered during the product creation process. Thanks again Chris Link to comment Share on other sites More sharing options...
♥mdtaylorlrim Posted January 27, 2010 Share Posted January 27, 2010 Hi Mark, Thanks for the input. I might have to rethink this. The sales rep email must be entered during the product creation process. Thanks again Chris Sure, as you enter the product description you simply add the email link to the end of the description. 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...
multimixer Posted January 27, 2010 Share Posted January 27, 2010 Sorry for jumping in, I'm "coming back" with my "original idea" little modified, after I got the topic now So, after we know that each product will have only 1 sales rep, I would do following: 1) Make a new field in admin/categories.php to enter the sales rep mail and name like I do for product name etc 2) Take the tell_a_friend.php, make it saesrep.php . I modify the file so that all fields (customer name and email - salesrep (friend) name and email and not editable. email subject is the product name as per default. Comments area will exist ofcourse 3) I create a button in product info with the same function as boxs/tell_a_friend.php or just one more box and call it boxes/salesrep.php The advantage of this is 1) people use a form and not their email client (looks more fancy somehow) 2) salesrep email are not printed on the screen 3) salesrep will allways know what the customer is talking about. Thats not sure in a common email. My community profile | Template system for osCommerce - New: Responsive | Feedback channel Link to comment Share on other sites More sharing options...
Guest Posted January 27, 2010 Share Posted January 27, 2010 I am going to give it a try George. Thanks for the suggestion. Chris Link to comment Share on other sites More sharing options...
Guest Posted January 27, 2010 Share Posted January 27, 2010 Well, I thought I could hack this up (http://addons.oscommerce.com/info/1320) to use for my purpose as it has ALL the features I need and more, but I was shot down by the changes needed for Simple Multi Image Add-on with Fancy Pop Ups.........Darn Sam for deleting and moving things around in categories.php.........lol Chris Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.