This is a discussion on Variable Help!! within the osCMax v2 Customization/Mods forums, part of the osCMax v2.0 Forums category; Hi, I'm new with osCMax and could use a bit of help. My customer wanted a field when he was ...
| |||||||
| Register | FAQ | Donate | Members List | Calendar | Mark Forums Read |
|
#1
| |||
| |||
| Hi, I'm new with osCMax and could use a bit of help. My customer wanted a field when he was adding new products that would indicate by what measure they were being sold (ex - by box, by pound, by kilogram, by the dozen, etc). I have successful added a new form field to the admin page categories.php and I have it saving the data to a new field in the database. So far so good! However, I can NOT get the new information to display on the front end by editing product_info.tpl.php I am using a piece of code identical to this: <?php echo $products_format; ?> I believe the data isn't being initialized / captured / loaded as a variable I can display. HELP!! |
|
#2
| ||||
| ||||
| You need to retrieve the data, along with everything else, in the select statement.
__________________ Hosting plans with installation, configuration, contributions, support and maintenance. |
|
#3
| |||
| |||
| if you have your new field added to products table: Code: $product_info_query = tep_db_query("select p.products_format,p.products_id, pd.products_name, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id 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_info = tep_db_fetch_array($product_info_query);
Code: $product_info_query = tep_db_query("select pd.products_format,p.products_id, pd.products_name, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id 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_info = tep_db_fetch_array($product_info_query);
|
|
#4
| |||
| |||
| Thanks for the responses. It's in the products table. I have added the code as wowsaver suggested -- still nothing! |
|
#5
| ||||
| ||||
| If you read the post again you will notice. Quote:
Just change the select to be p.products_format not pd.products_format Regards,
__________________ pgmarshall _______________________________ Test Site: www.cottonbarn.info Want to say thank you if I helped you out? Help me block this waste incinerator plan (www.nywag.org) in North Yorkshire, UK. Sign the petition here (only takes 1 minute). Thanks. |
|
#6
| |||
| |||
| The product_info_query uses p.products_format. No luck. On the product_info.tpl.php page I've tried: <?php echo $products_price; ?> -- nothing; <?php echo $p.products_price; ?> -- prints the term "products_price" <?php echo $products_info['products_format']; ?> -- nothing; |
|
#7
| |||
| |||
| let's say your new field is in products table with the field name products_format Use this statement in your product_info.tpl.php (replace the one at about line 33) Code: $product_info_query = tep_db_query("select p.products_format,p.products_id, pd.products_name, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id 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_info = tep_db_fetch_array($product_info_query);
Code: <?php $product_info['products_format']; ?> check in your database that you actually have the field products_format in your products table and see if you have any value for this field. |
| The Following User Says Thank You to wowsaver For This Useful Post: | ||
aking1001 (03-15-2010) | ||
|
#8
| |||
| |||
| Wowsaver, you are a lifesaver! It finally worked! Thanks very much!! |
|
#9
| ||||
| ||||
| Glad to hear you got it to work ... Don't forget to click the Regards,
__________________ pgmarshall _______________________________ Test Site: www.cottonbarn.info Want to say thank you if I helped you out? Help me block this waste incinerator plan (www.nywag.org) in North Yorkshire, UK. Sign the petition here (only takes 1 minute). Thanks. |
| The Following User Says Thank You to pgmarshall For This Useful Post: | ||
aking1001 (03-15-2010) | ||
![]() |
| Tags |
| variables |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PHP Help Needed - How to get the value of a variable | ASasek | osCommerce 2.2 Modification Help | 1 | 05-19-2006 05:08 AM |
| variable shipping based on weight and price | darren777 | osCommerce 2.2 Modification Help | 0 | 11-01-2005 08:16 AM |
| variable free shipping rate per country | mattkern | osCMax v1.7 General Mods Discussion | 1 | 12-17-2004 03:26 PM |
| Increasing Session Variable sizes? | ryanmhubbard | osCMax v1.7 Discussion | 0 | 09-30-2004 08:35 AM |
| Heavy problems with passed variable and member function | Markus | osCommerce 2.2 Installation Help | 2 | 09-15-2003 06:24 AM |