marketedsites Posted May 28, 2008 Posted May 28, 2008 Sorry if it's been discussed, I have spent 2 days searching and haven't found my solution yet. I would like to add more fields for my products such as finish, sku, etc. I can access my database through mySQL and am open to ANY help!
rs2k Posted May 29, 2008 Posted May 29, 2008 Sorry if it's been discussed, I have spent 2 days searching and haven't found my solution yet. I would like to add more fields for my products such as finish, sku, etc. I can access my database through mySQL and am open to ANY help! I know a little bit about it. I am still trying to figure out how to add the extra fields I have to my emails and invoices. Here is what I have done so far: You have to add the field to the products table using phpMyAdmin. Then you have to modify what ever page your want them to appear on. For example, I added the field products_mfgmn to my products table and then I changed the model field on product_info.php to mfgmn. Here's what I did: I added "p.products_mfgmn, " to the sql query in product_info.php. I then changed: <span class="smallText">[' . $product_info['products_model'] . ']</span> to read: <span class="smallText">[' . $product_info['products_mfgmn'] . ']</span> So, pretty much all you have to do is add the field to the table. Then, make sure the php gets the information from the field and then place that information where you want it on the page you want it to be displayed on. Below is the part of my product_info.php that was changed. } else { $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_mfgmn, 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); tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'"); if ($new_price = tep_get_products_special_price($product_info['products_id'])) { $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>'; } else { $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])); } if (tep_not_null($product_info['products_mfgmn'])) { $products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_mfgmn'] . ']</span>'; } else { $products_name = $product_info['products_name']; }
Recommended Posts
Archived
This topic is now archived and is closed to further replies.