Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Request Product Info


Jack_mcs

Recommended Posts

  • Replies 84
  • Created
  • Last Reply

Top Posters In This Topic

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

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

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.....

--------------------------------------------------------------------------------------------------

Link to comment
Share on other sites

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

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

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.

--------------------------------------------------------------------------------------------------

Link to comment
Share on other sites

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!)

--------------------------------------------------------------------------------------------------

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

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

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

Link to comment
Share on other sites

  • 2 weeks later...

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!

Link to comment
Share on other sites

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

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

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

Link to comment
Share on other sites

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 by stephano6
Link to comment
Share on other sites

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

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

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

Link to comment
Share on other sites

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: [email protected]

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

Link to comment
Share on other sites

  • 1 month later...

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: [email protected]

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

Link to comment
Share on other sites

  • 4 weeks later...

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 by pageyu
Link to comment
Share on other sites

  • 2 months later...

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

Link to comment
Share on other sites

  • 1 month later...

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')) {

Link to comment
Share on other sites

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: [email protected]

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...