Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Passing Product info to Contact Us


Guest

Recommended Posts

Im trying to add the product details to the contact for when someone clicks on request request quotation.

 

I have added a piece of code in the product info page as the following:

 

<td align="center" valign="middle" class="pricing">From $regularpricestrike 
             $specialprice</span><br><?php echo '<a href="' . tep_href_link(FILENAME_CONTACT_US, 'enquiry=Price Inquiry%0D%0A%0D%0AProduct Id: ' . $listing_values['products_id'] . '%0D%0AProduct Name: ' . $listing_values['products_name'] . '%0D%0AProduct Url: ' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing_values['products_id'] .'%0D%0A%0D%0A') . '') . '"  class="pricing">Request Quotation</a>';?></td>

 

This will show a link below the price that will pass the product id, product name and product url to the contact form. The problem is that only the following is passed:

 

Price Inquiry

 

Product Id:

Product Name:

Product Url: http://www.bluelightuk.co.uk/product_info.php?products_id=

And none of the actual product information.

 

Can anyone tell me where Im going wrong, and possible how to add the product price too?

 

Any help would be much appreciated.

 

Thanks :thumbsup:

Link to comment
Share on other sites

Ok

 

I've changed the code to the following:

 

<?php echo '<a href="' . tep_href_link(FILENAME_CONTACT_US, 'enquiry=Price Inquiry%0D%0A%0D%0AProduct Id: ' . $HTTP_GET_VARS['products_id'] . '%0D%0AProduct Name: ' . $HTTP_GET_VARS['products_name'] . '%0D%0AProduct Url: ' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id'] .'%0D%0A%0D%0A') . '') . '"  class="pricing">Request Quotation</a>';?>

 

This is now passing the product id and the correct url but not the product name :( Anyone give us a hand here??

 

Please :thumbsup:

Link to comment
Share on other sites

Ok

 

I've changed the code to the following:

 

<?php echo '<a href="' . tep_href_link(FILENAME_CONTACT_US, 'enquiry=Price Inquiry%0D%0A%0D%0AProduct Id: ' . $HTTP_GET_VARS['products_id'] . '%0D%0AProduct Name: ' . $HTTP_GET_VARS['products_name'] . '%0D%0AProduct Url: ' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id'] .'%0D%0A%0D%0A') . '') . '" ?class="pricing">Request Quotation</a>';?>

 

This is now passing the product id and the correct url but not the product name :( Anyone give us a hand here??

 

Please  :thumbsup:

 

between 2 parameters in the url, you need a & letter

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

I've changed the code again to the following and it seems to be pasiing everything correctly:

 

<td><?php echo '<a href="' . tep_href_link(FILENAME_CONTACT_US, 'enquiry=Price Inquiry%0D%0A%0D%0AProduct Id: ' . $HTTP_GET_VARS['products_id'] . '%0D%0AProduct Url: ' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id'] . '%0D%0APrice From: ?' . $product_info['products_price'] . '%0D%0AProduct Name: ' . $product_info['products_name'] .'%0D%0A%0D%0A') . '') . '"  class="pricing">Request Quotation</a>';?></td>

 

The URL passed seems to work fine, it passes it like Product Url: http://www.bluelightuk.co.uk/product_info.php?products_id=5

 

Oh and I'm also passing the price now too, although for some reason its sending 4 decimal palces???? how would I stop that? As the prices aren't displayed like that on the site.

 

 

So the contact form field now looks like this:

Price Inquiry

 

Product Id: 5

Product Url: http://www.bluelightuk.co.uk/product_info.php?products_id=5

Price From: ?9000.0000

Product Name: Ford Transit UVG Premia A

 

If someone could just give the code a once ove just to check I'm not going to break anything :rolleyes:

Link to comment
Share on other sites

Decided to remove the buy now button on my product listing page and replace it with the same code.

 

In modules/product_listing.php Ive altered the case 'product_list_buy_now' to:

 

case 'PRODUCT_LIST_BUY_NOW':
           $lc_align = 'center';
           $lc_text = '<a href="' . tep_href_link(FILENAME_CONTACT_US, 'enquiry=Price Inquiry%0D%0A%0D%0AProduct Id: ' . $HTTP_GET_VARS['products_id'] . '%0D%0AProduct Url: ' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id'] . '%0D%0APrice From: ?' . $product_info['products_price'] . '%0D%0AProduct Name: ' . $product_info['products_name'] .'%0D%0A%0D%0A') . '') . '"  class="pricing">Request Quotation</a>';
           break;

 

But it dosn't work in the same way as my product info. It dosn't pass the product details, only the text, i.e

 

Price Inquiry

 

Product Id:

Product Url: http://www.bluelightuk.co.uk/product_info.php?products_id=

Price From: ?

Product Name:

 

Anyone knwo where I'm going wrong now?

 

Could do with some help here, I've come to the end of my php noob guessing.

Link to comment
Share on other sites

Ah Ha

 

Forgot to change the $'s from product_info to listing

 

I've changed the code to:

 

case 'PRODUCT_LIST_BUY_NOW':
           $lc_align = 'center';
           $lc_text = '<a href="' . tep_href_link(FILENAME_CONTACT_US, 'enquiry=Price Inquiry%0D%0A%0D%0AProduct Id: ' . $$listing['products_id'] . '%0D%0AProduct Url: ' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $$listing['products_id'] . '%0D%0APrice From: ?' . $listing['products_price'] . '%0D%0AProduct Name: ' . $listing['products_name'] .'%0D%0A%0D%0A') . '') . '"  class="pricing">Request Quotation</a>';
           break;

 

But it's not passing id at the moment just the following:

 

Price Inquiry

 

Product Id:

Product Url: http://www.bluelightuk.co.uk/product_info.php?products_id=

Price From: ?9000.0000

Product Name: Ford Transit UVG Premia A

 

Feel free to join in at anytime and help me people ;)

Link to comment
Share on other sites

What a dope :blink:

 

I had two $$ together

 

Ok the code should look like the following:

 

case 'PRODUCT_LIST_BUY_NOW':
           $lc_align = 'center';
           $lc_text = '<a href="' . tep_href_link(FILENAME_CONTACT_US, 'enquiry=Price Inquiry%0D%0A%0D%0AProduct Id: ' . $listing['products_id'] . '%0D%0AProduct Url: ' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing['products_id'] . '%0D%0APrice From: ?' . $listing['products_price'] . '%0D%0AProduct Name: ' . $listing['products_name'] .'%0D%0A%0D%0A') . '') . '"  class="pricing">Request<br>Quotation</a>';
           break;

 

So now my links in both product info and product listing work, and pass over the product info to contact us.

 

Only problem left to solve is the 4 decimal places on the price.

 

Hope this is helping someone else if they feel like doing something similar B)

Link to comment
Share on other sites

What a dope  :blink:

 

I had two $$ together

 

Ok the code should look like the following:

 

case 'PRODUCT_LIST_BUY_NOW':
? ? ? ? ? ?$lc_align = 'center';
? ? ? ? ? ?$lc_text = '<a href="' . tep_href_link(FILENAME_CONTACT_US, 'enquiry=Price Inquiry%0D%0A%0D%0AProduct Id: ' . $listing['products_id'] . '%0D%0AProduct Url: ' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing['products_id'] . '%0D%0APrice From: ?' . $listing['products_price'] . '%0D%0AProduct Name: ' . $listing['products_name'] .'%0D%0A%0D%0A') . '') . '" ?class="pricing">Request<br>Quotation</a>';
? ? ? ? ? ?break;

 

So now my links in both product info and product listing work, and pass over the product info to contact us.

 

Only problem left to solve is the 4 decimal places on the price.

 

Hope this is helping someone else if they feel like doing something similar  B)

 

 

add the format funtion used in product info to format the price to 2 decimals

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

add the format funtion used in product info to format the price to 2 decimals

 

Good thinking Batgirl

 

So changed my modules/product_listing.php

 

. '%0D%0APrice From: ?' . $listing['products_price'] .

 

to

 

. '%0D%0APrice From: ' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) .

 

That works great :)

 

And my product_info.php code from:

 

. '%0D%0APrice From: ?' . $product_info['products_price'] .

 

to

 

. '%0D%0APrice From: ' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .

 

Yippee

 

I can now display my prices but also allow my customers to click on the request quotation links and use the information passed to ask for a quote on say they want 20 items or they want it modified etc.

 

Thanks monika for that last little nugget.

Link to comment
Share on other sites

  • 5 years later...

I know this is an old thread but this code is just what I wanted but it's not working correctly. This is the code that I am using:-

 

<?php

echo '<a href="' . tep_href_link(FILENAME_CONTACT_US, 'enquiry=Price Inquiry%0D%0A%0D%0AProduct Name: ' . $product_info['products_name'] . '%0D%0AProduct Id: ' . $HTTP_GET_VARS['products_id'] . '%0D%0APrice From: ?' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) .'%0D%0A%0D%0A') . '' . '" class="pricing">Request Quotation</a>';

?>

 

Everything is appearing fine except special characters such as : at the end of Product Name, Product ID, Price From, etc and the £ sign in the price. If I remove the ? replace it with £, it doesn't show either.

Does anyone know why this is? Also, I cannot get the code to work to get the product url to work no matter where I put it. The Order I want is Title, ID, Price and URL.

 

Thanks

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...