Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Add text field to product_info


digilee

Recommended Posts

I need to add a text filed to products_info and have it's manually added content carried through the order.

I can add a text field to the product_info but it's contents are not carried through.

 

Obvious thing to do is simply copy the 'comments' field in checkout_payment.

 

These are the 2 pieces I copied over from checkout_payment to product_info:

 

In the document head (above the doctype):

 

if (!tep_session_is_registered('comments')) tep_session_register('comments');
 if (isset($HTTP_POST_VARS['comments']) && tep_not_null($HTTP_POST_VARS['comments'])) {
$comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);
 }

?>

 

and

 

For the field:

<?php echo tep_draw_textarea_field('comments', 'soft', '60', '5', $comments); ?>

 

The field shows but it's contents are not carried through to the basket/ the checkout.

(The field and it's contents work fine on the checkout payment page.)

 

Much appreciated if anyone can help as I have spent the last 2 days trying this and trawling through the contributions.

SolarFrenzy

Solar powered gadgets at down to earth prices.

 

CheekyNaughty

Promoting British Design

Link to comment
Share on other sites

Thanks Leslie, but I installed that contrib thinking it would work but it only inserted actual content, no text field.

I think the title of it is slightly misleading.

SolarFrenzy

Solar powered gadgets at down to earth prices.

 

CheekyNaughty

Promoting British Design

Link to comment
Share on other sites

Thanks Leslie, but I installed that contrib thinking it would work but it only inserted actual content, no text field.

I think the title of it is slightly misleading.

OK, have you tried calling comments something else like comments2? Just a shot in the dark, since comments are already used.

Link to comment
Share on other sites

Yup, I renamed it to something completely different (where ever it said comments, I changed it).

 

This is the header part of product_info:

 

<?php
/*
 $Id: product_info.php 1739 2007-12-20 00:52:16Z hpdl $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

 //BEGIN Cat, Prod name in page title
require('includes/metaqueries.php');
//END Cat, Prod name in page title

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);

 $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
 $product_check = tep_db_fetch_array($product_check_query);

  require(DIR_WS_CLASSES . 'order.php');
 $order = new order;  

 if (!tep_session_is_registered('monogram')) tep_session_register('monogram');
 if (isset($HTTP_POST_VARS['monogram']) && tep_not_null($HTTP_POST_VARS['monogram'])) {
$monogram = tep_db_prepare_input($HTTP_POST_VARS['monogram']);
 }

?>

 

and this is the text area code:

 

<?php echo tep_draw_input_field('monogram', '', 'maxlength="10", size="30"', $monogram); ?>

 

The only thing I can think of is that there is no 'monogram' field in the database in orders_status_history BUT I originally left 'monogram' as 'comments' and still it didn't work.

 

Edit - Added 'monogram' field to orders_status_history in database but still nothing.

SolarFrenzy

Solar powered gadgets at down to earth prices.

 

CheekyNaughty

Promoting British Design

Link to comment
Share on other sites

There is definitely a contribution that can do this, as I have used it on at least a few sites. I can't remember the name of the contribution but I do remember it's a b---- to install.

Link to comment
Share on other sites

I tried to install 'product_attributes_option_type' contrib but a lot of the code, that it instructed to change, didn't match mine so I had to give up.

SolarFrenzy

Solar powered gadgets at down to earth prices.

 

CheekyNaughty

Promoting British Design

Link to comment
Share on other sites

Tried that one as well now and still having problems with it. Got to the point of having a text field on product_info and the details showing in shopping basket but there are some serious problems, like not clearing the cache when removing from basket.

 

Right now I'm just trying to make sense of the updates!

SolarFrenzy

Solar powered gadgets at down to earth prices.

 

CheekyNaughty

Promoting British Design

Link to comment
Share on other sites

  • 3 weeks later...

Lee,

 

Did you get this working? If so, could you let me know what/how. I have a similar need to get an item associated with each product in the order (potentially). I also have to be able to tell when to show the extra field or not, some items cant be monogrammed, but may have to work that out and post back for all since i have not seen anything that does that.

 

Thanks,

 

David

Link to comment
Share on other sites

  • 5 months later...

Has anyone found a solution to this? I will pay someone to do this. I really need the monogramming letters to be typed into the order as an attribute in the merchandise page.

 

thank you!!

Candace

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...