jaymz77 Posted December 21, 2007 Share Posted December 21, 2007 Jack, no worries.. I found another contribution and modified it for my needs. Thanks anyways! Have a Merry Christmas! James Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted December 22, 2007 Author Share Posted December 22, 2007 A new version has been uploaded. It contains these changes: - Changed code in request-product-info.php for Mysql 5 compatibility - Added table width to provide a more consistent appearance - Fixed code to work properly with products with attributes The last change should fix the problem some people are having getting this to work. The failure, from what I could see, only happened with a product that had attributes. I hadn't tested with that previously but could get it to fail when I did. Jack Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
drumcentral Posted December 23, 2007 Share Posted December 23, 2007 Hi there, many thanks for this great little contribution. It's all working fine on our site: Drum Central I wondered if you could help me with one minor thing? When a customer is logged into the site, and clicks on the regular 'Contact Us' link, his or her name and email address are automatically filled in on the form. However, when using the 'Product Request' link the name or email address are not pre-filled. It would be great if you had any clues..... Quote -------------------------------------------------------------------------------------------------- Link to comment Share on other sites More sharing options...
Jack_mcs Posted December 24, 2007 Author Share Posted December 24, 2007 You need to read in the customer information from the database and fill it in. Since the email form used in this contribution is based on the contact us code, you should be able to compare the two and just copy the needed code to get it to work. It's a good idea though for a futer version. Jack Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
drumcentral Posted December 24, 2007 Share Posted December 24, 2007 Hi Jack. Thanks for the info. After a bit of experimenting I managed to find the code in the catalog/contact_us.php file and inserted it into the catalog/request-product-info.php file. After Line 114, which should be: <?php if ($messageStack->size('request_info') > 0) { ?> insert this code from the catalog/contact_us file: <?php } else { if (tep_session_is_registered('customer_id')) { $account_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'"); $account = tep_db_fetch_array($account_query); $name = $account['customers_firstname'] . ' ' . $account['customers_lastname']; $email = $account['customers_email_address']; } ?> This should automatically add the logged-in customers name and email address the the form fields. I hope this is of some use to everyone. Thanks again. Quote -------------------------------------------------------------------------------------------------- Link to comment Share on other sites More sharing options...
ayyaou Posted December 27, 2007 Share Posted December 27, 2007 Error messages doesn't work with the latest Quote Link to comment Share on other sites More sharing options...
drumcentral Posted December 27, 2007 Share Posted December 27, 2007 Sorry to hear that it's not working for you. I am using the latest version of this mod, and it works for my site. There's probably something in your code, if you've previously modified your oscommerce files. I know it seems to work better with Firefox (surprise!) Quote -------------------------------------------------------------------------------------------------- Link to comment Share on other sites More sharing options...
Guest Posted January 3, 2008 Share Posted January 3, 2008 A new version has been uploaded. It contains these changes: - Changed code in request-product-info.php for Mysql 5 compatibility - Added table width to provide a more consistent appearance - Fixed code to work properly with products with attributes The last change should fix the problem some people are having getting this to work. The failure, from what I could see, only happened with a product that had attributes. I hadn't tested with that previously but could get it to fail when I did. Jack Hi Jack, Is there a possibility the contribution could work in this scenario: several products are added to the "cart" by a customer, and then once the customer is finished 'shopping' he/she enters the cart, and only one button is made available to "request information" on the collective group of products at once? Thanks for this great tool! Erick Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted January 3, 2008 Author Share Posted January 3, 2008 Hi Jack, Is there a possibility the contribution could work in this scenario: several products are added to the "cart" by a customer, and then once the customer is finished 'shopping' he/she enters the cart, and only one button is made available to "request information" on the collective group of products at once? Thanks for this great tool! Erick It has that option already. If you don't want the request button on the product page, it can be removed. Jack Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
Guest Posted January 10, 2008 Share Posted January 10, 2008 It has that option already. If you don't want the request button on the product page, it can be removed. Jack It was a while since I checked in, and thanks for the response. I will begin installing your contribution, and looking forward to it. Thanks again Jack Erick Quote Link to comment Share on other sites More sharing options...
MANDY1 Posted January 24, 2008 Share Posted January 24, 2008 Hello Jack, This is terriffic ! One question : can it be modified so that it can show up only on certain products rather than all? I have some products that do not need it. I'm definitely not en expert on reworking code and since I all your contribs that I use installed easily. I'm still on MS2.2 and with Mysql 4.1.3. Thank you in advance! Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted January 24, 2008 Author Share Posted January 24, 2008 Hello Jack, This is terriffic ! One question : can it be modified so that it can show up only on certain products rather than all? I have some products that do not need it. I'm definitely not en expert on reworking code and since I all your contribs that I use installed easily. I'm still on MS2.2 and with Mysql 4.1.3. Thank you in advance! In the product_info.php file, locate this line of code, which was added by this contribution <td class="main" align="center"><?php echo '<a href="' . tep_href_link(FILENAME_REQUEST_PRODUCT_INFO, tep_get_all_get_params()) . '">' . tep_image_button('button_request_product_info.gif', IMAGE_BUTTON_REQUEST_PRODUCT_INFO) . '</a>'; ?></td> Change that to <?php $prodArray = array(); $prodArray[] = XX; $prodArray[] = YY; $prodArray[] = ZZ; if (in_array($product_info['products_id'], $prodArray) { ?> <td class="main" align="center"><?php echo '<a href="' . tep_href_link(FILENAME_REQUEST_PRODUCT_INFO, tep_get_all_get_params()) . '">' . tep_image_button('button_request_product_info.gif', IMAGE_BUTTON_REQUEST_PRODUCT_INFO) . '</a>'; ?></td> <?php } ?> where XX, YY and ZZ are product id numbers you want to enable. You can add as many as you want by just copying the line, $prodArray[] = ZZ;, and changing the ZZ to some ID. I haven't tested this so be sure to backup your file first. As for the shopping cart request button, the same process should work but $product_info would be different. And it would require more code since there may be mixed products in the cart so more chekcing would need to be done to make sure only the wanted ones are asked about. Jack Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
MANDY1 Posted January 24, 2008 Share Posted January 24, 2008 In the product_info.php file, locate this line of code, which was added by this contribution <td class="main" align="center"><?php echo '<a href="' . tep_href_link(FILENAME_REQUEST_PRODUCT_INFO, tep_get_all_get_params()) . '">' . tep_image_button('button_request_product_info.gif', IMAGE_BUTTON_REQUEST_PRODUCT_INFO) . '</a>'; ?></td> Change that to <?php $prodArray = array(); $prodArray[] = XX; $prodArray[] = YY; $prodArray[] = ZZ; if (in_array($product_info['products_id'], $prodArray) { ?> <td class="main" align="center"><?php echo '<a href="' . tep_href_link(FILENAME_REQUEST_PRODUCT_INFO, tep_get_all_get_params()) . '">' . tep_image_button('button_request_product_info.gif', IMAGE_BUTTON_REQUEST_PRODUCT_INFO) . '</a>'; ?></td> <?php } ?> where XX, YY and ZZ are product id numbers you want to enable. You can add as many as you want by just copying the line, $prodArray[] = ZZ;, and changing the ZZ to some ID. I haven't tested this so be sure to backup your file first. As for the shopping cart request button, the same process should work but $product_info would be different. And it would require more code since there may be mixed products in the cart so more chekcing would need to be done to make sure only the wanted ones are asked about. Thanks Jack, I'll try tonight when there are fewer customers on the website... with 3,000 products this might not be an easy way to go! Should you think of a way to be able to toggle from Admin. I don't need it in the shopping cart, just on the products pages. Thanks again. Mandy Jack Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted January 25, 2008 Author Share Posted January 25, 2008 It's possible to set them from admin but that is not a quick change and is beyond the scope of forum help. Jack Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
stephano6 Posted January 25, 2008 Share Posted January 25, 2008 (edited) hello, I installed the contibution in product info. the result appears in request product info, but I have not received any detail of the product in mail. The name, phone and more. I see (For info, I had to remove column_left.php and column_right.php to request_product_info.php for use in my template) Thanks for replay Steph from Switzerland (Sorry for my English) :blush: Edited January 25, 2008 by stephano6 Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted January 26, 2008 Author Share Posted January 26, 2008 Te code uses the same code to send emails that is standard in the shop so if your other email works, it should too. Do you receive an email when an order is placed? Are the email fields set in admin->Configuraiton? Jack Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
MANDY1 Posted January 26, 2008 Share Posted January 26, 2008 In the product_info.php file, locate this line of code, which was added by this contribution <td class="main" align="center"><?php echo '<a href="' . tep_href_link(FILENAME_REQUEST_PRODUCT_INFO, tep_get_all_get_params()) . '">' . tep_image_button('button_request_product_info.gif', IMAGE_BUTTON_REQUEST_PRODUCT_INFO) . '</a>'; ?></td> Change that to <?php $prodArray = array(); $prodArray[] = XX; $prodArray[] = YY; $prodArray[] = ZZ; if (in_array($product_info['products_id'], $prodArray) { ?> <td class="main" align="center"><?php echo '<a href="' . tep_href_link(FILENAME_REQUEST_PRODUCT_INFO, tep_get_all_get_params()) . '">' . tep_image_button('button_request_product_info.gif', IMAGE_BUTTON_REQUEST_PRODUCT_INFO) . '</a>'; ?></td> <?php } ?> where XX, YY and ZZ are product id numbers you want to enable. You can add as many as you want by just copying the line, $prodArray[] = ZZ;, and changing the ZZ to some ID. I haven't tested this so be sure to backup your file first. As for the shopping cart request button, the same process should work but $product_info would be different. And it would require more code since there may be mixed products in the cart so more chekcing would need to be done to make sure only the wanted ones are asked about. Jack Thanks ever so much Jack... I spent the night playing around with the OSC product status function and found that it could be adapted so with your fantastic contribution (which was much lacking in my store for certain products) I now have it controlled from ADMIN with "status" buttons on the product page and in New products so I can just activate the contrib on the products needing it. Without you I never would never have thought I could have this ! Thanks so much. Mandy Quote Link to comment Share on other sites More sharing options...
stephano6 Posted January 28, 2008 Share Posted January 28, 2008 hello, I installed the contibution in product info. the result appears in request product info, but I have not received any detail of the product in mail. The name, phone and more. I see (For info, I had to remove column_left.php and column_right.php to request_product_info.php for use in my template) Thanks for replay Steph from Switzerland (Sorry for my English) :blush: ----------------------------------------------------------------- Email Return ------------------------- Sebastien has asked for information about the following product(s): ID PRODUCT Here is the contact information for fgfgfgfgfgfg Phone: 43643623 Email Address: seb@test.com Mailing Address: 3 rue des arbres Additional Comments: merci --------------------------------------------- I did not change to { $products = TEXT_PRODUCT_COLUMNS; for ($i = 0; $i < count($productList); ++$i) { $product_info_query = tep_db_query("select p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$productList[$i] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product_info = tep_db_fetch_array($product_info_query); $products .= $product_info['products_id'] . "\t" . $product_info['products_name'] . "\n"; } ------------------------------------------------ Please help, Thanks Quote Link to comment Share on other sites More sharing options...
vinciamo Posted March 21, 2008 Share Posted March 21, 2008 Hi, the Problem is the unserialize command instead myunserialize function call , at line 31 find $productList = unserialize($_POST['productList']); change to $productList = myunserialize($_POST['productList']); and then all works Regards Vincenzo ----------------------------------------------------------------- Email Return -------------------------Sebastien has asked for information about the following product(s): ID PRODUCT Here is the contact information for fgfgfgfgfgfg Phone: 43643623 Email Address: seb@test.com Mailing Address: 3 rue des arbres Additional Comments: merci --------------------------------------------- I did not change to { $products = TEXT_PRODUCT_COLUMNS; for ($i = 0; $i < count($productList); ++$i) { $product_info_query = tep_db_query("select p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$productList[$i] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product_info = tep_db_fetch_array($product_info_query); $products .= $product_info['products_id'] . "\t" . $product_info['products_name'] . "\n"; } ------------------------------------------------ Please help, Thanks Quote Link to comment Share on other sites More sharing options...
pageyu Posted April 16, 2008 Share Posted April 16, 2008 (edited) Hi, I am not good in coding. I need a help. I have in shopping_cart.php to limit that only registered user can REQEST INFORMATION.Otherwise, when it is clicked on REQEUST BUTTON, the guest should get login page or just be informed that he should login. Thanks Edited April 16, 2008 by pageyu Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted April 16, 2008 Author Share Posted April 16, 2008 You probably need to install the Login for Prices contribution. Jack Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
nicky-osc Posted June 23, 2008 Share Posted June 23, 2008 Hi Jack, first of all great contribution, perfect for what I needed well nearly, All works after fixing as per previous posts, Only problem i have when we go to the request-product-info.php page I get the word Array ( in the Name input field ) The script works, emails all details etc, just unsure how to fix the input value. Using Latest PHP and MYSQL. Any help appreciated, obviously i need to blank the value just dont know how ? Nicky Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted June 23, 2008 Author Share Posted June 23, 2008 Which version are you using? I only support my versions and, as far as I know, it works fine. Jack Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
Bdevil Posted August 5, 2008 Share Posted August 5, 2008 I've Post , the Fix for the Bug that IF NAME ecc FIELD is NULL , Script does not print ERROR (This bug is in the EDIT of Automatic NAME IF User is LOG IN by DRUMCENTRAL http://www.oscommerce.com/forums/index.php?sho...t&p=1182470 ) At LINE 117 FIND <?php if ($messageStack->size('request_info') > 0) { ?> <?php } else { if (tep_session_is_registered('customer_id')) { $account_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'"); $account = tep_db_fetch_array($account_query); $name = $account['customers_firstname'] . ' ' . $account['customers_lastname']; $email = $account['customers_email_address']; } ?> <tr> <td><?php echo $messageStack->output('request_info'); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'success')) { AND REPLACE IT WITH <?php if ($messageStack->size('request_info') > 0) { ?> <tr> <td><?php echo $messageStack->output('request_info'); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } else { if (tep_session_is_registered('customer_id')) { $account_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'"); $account = tep_db_fetch_array($account_query); $name = $account['customers_firstname'] . ' ' . $account['customers_lastname']; $email = $account['customers_email_address']; } } if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'success')) { Quote Link to comment Share on other sites More sharing options...
kjvision Posted August 8, 2008 Share Posted August 8, 2008 I've Post , the Fix for the Bug that IF NAME ecc FIELD is NULL , Script does not print ERROR (This bug is in the EDIT of Automatic NAME IF User is LOG IN by DRUMCENTRAL http://www.oscommerce.com/forums/index.php?sho...t&p=1182470 ) At LINE 117 FIND <?php if ($messageStack->size('request_info') > 0) { ?> <?php } else { if (tep_session_is_registered('customer_id')) { $account_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'"); $account = tep_db_fetch_array($account_query); $name = $account['customers_firstname'] . ' ' . $account['customers_lastname']; $email = $account['customers_email_address']; } ?> <tr> <td><?php echo $messageStack->output('request_info'); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'success')) { AND REPLACE IT WITH <?php if ($messageStack->size('request_info') > 0) { ?> <tr> <td><?php echo $messageStack->output('request_info'); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } else { if (tep_session_is_registered('customer_id')) { $account_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'"); $account = tep_db_fetch_array($account_query); $name = $account['customers_firstname'] . ' ' . $account['customers_lastname']; $email = $account['customers_email_address']; } } if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'success')) { hey your fix doesnt work by me @Jack_mcs so my problem is like most peole i get the mail from customer but there is no deatils about product or ID i get all the deails from customer but not from produtcs like that ---------------------------------------------------------------------------------------- kjvision has asked for information about the following product(s): ID PRODUCT Here is the contact information for kjvision Phone: 01778888889999 Email Address: kjvision@kjvision.de Mailing Address: kjvision ----------------------------------------------------------- It is only in product.info in shopping card it work great i have the newest oscommerce .2.2.rc2 and php 5 and newest sql can you help me ? best wisches from germany kjvision Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.