Re: How-To: Add new Properties to your Products
I've followed solution to add another product field, but in a separate table. Everything was fine unless I try to add new products via Easy Populate. However EP populates products to db but my additional table that holds custom field is not updated with new product_id. So if I go to a new product (inserted via EP) the page doesnt show any data because main query in main_template_vars.php breaks when trying to read product_id that doesnt exist in additional table.
I have ended creating trigger after insert which adds new product_id to the custom table, which is not elegant solution.
2 Attachment(s)
Re: How-To: Add new Properties to your Products
Hi everyone, i really interesting with this tips and I've finally finish that 8 steps. I success made 2 field and it appear on admin.
1.But when I finish add a new product, the new page appear and it says:
1054 Unknown column 'products_stock_lama' in 'field list'
in:
[insert into zen_products (products_quantity, products_type, products_model, products_price, products_date_available, products_weight, products_status, products_virtual, products_tax_class_id, manufacturers_id, products_quantity_order_min, products_quantity_order_units, products_priced_by_attribute, product_is_free, product_is_call, products_quantity_mixed, product_is_always_free_shipping, products_qty_box_status, products_quantity_order_max, products_sort_order, products_discount_type, products_discount_type_from, products_price_sorter, products_stock_lama, products_stock_baru, products_image, products_date_added, master_categories_id) values ('0', '1', '', '0', '2011-08-12', '0', '1', '0', '0', '0', '1', '1', '0', '0', '0', '1', '0', '1', '0', '0', '0', '0', '0', '15116129', '15116129', 'aaaaddd3.jpg', now(), '6')]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.
2.when i click the edit button for my product, the new page appear and :
1054 Unknown column 'p.products_stock_lama' in 'field list'
in:
[select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_virtual, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id, p.products_quantity_order_min, p.products_quantity_order_units, p.products_priced_by_attribute, p.product_is_free, p.product_is_call, p.products_quantity_mixed, p.product_is_always_free_shipping, p.products_qty_box_status, p.products_quantity_order_max, p.products_sort_order, p.products_discount_type, p.products_discount_type_from, p.products_price_sorter, p.master_categories_id, p.products_stock_lama, p.products_stock_baru from zen_products p, zen_products_description pd where p.products_id = '6' and p.products_id = pd.products_id and pd.language_id = '1']
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.
http://3.bp.########################...0/s1600/11.JPG
http://2.bp.########################...k/s1600/12.JPG
anyone, please help me . . . :cry:
Re: How-To: Add new Properties to your Products
I followed the instructions in the first post and was able to add several fields to my collect_info page and am able to display them on my site. No problems there.
Instead of the text entry fields on the collect_info page, I would like to use fckeditor. I got as far as getting the editor to display the correct info from the database but I can't get it to write to the database.
Does any one have any experience with this?
Thanks!
Re: How-To: Add new Properties to your Products
Here's the code related the the previous post:
************** this is the text field that reads and writes to the database. this works *******************
<td class="main"><?php echo Specifications; ?></td>
<td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '10') . ' ' .
zen_draw_input_field('products_specifications', $pInfo->products_specifications, 'size="100"', zen_set_field_length(TABLE_PRODUCTS, 'products_specifications')); ?></td>
</tr>
************** this is the fckeditor code that reads from the database, but won't update the database with any changes typed into it *******************
<tr>
<td class="main" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_SPECIFICATIONS; ?></td>
<td colspan="2"><table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="main" width="25" valign="top"><?php echo zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?> </td>
<td class="main" width="100%">
<?php if ($_SESSION['html_editor_preference_status']=="FCKEDITOR") {
$oFCKeditor = new FCKeditor('products_specifications[' . $languages[$i]['id'] . ']') ;
$oFCKeditor->Value = (isset($products_specifications[$languages[$i]['id']])) ? stripslashes($products_specifications[$languages[$i]['id']]) : zen_get_products_specifications($pInfo->products_id, $languages[$i]['id']);
$oFCKeditor->Width = '99%' ;
$oFCKeditor->Height = '350' ;
// $oFCKeditor->Config['ToolbarLocation'] = 'Out:xToolbar' ;
// $oFCKeditor->Create() ;
$output = $oFCKeditor->CreateHtml() ; echo $output;
} else { // using HTMLAREA or just raw "source"
echo zen_draw_textarea_field('products_specifications[' . $languages[$i]['id'] . ']', 'soft', '100%', '30', (isset($products_specifications[$languages[$i]['id']])) ? htmlspecialchars(stripslashes($products_specifications[$languages[$i]['id']]), ENT_COMPAT, CHARSET, TRUE) : htmlspecialchars(zen_get_products_specifications($pInfo->products_id, $languages[$i]['id']), ENT_COMPAT, CHARSET, TRUE)); //,'id="'.'products_specifications' . $languages[$i]['id'] . '"');
} ?>
</td>
Re: How-To: Add new Properties to your Products
One other thing. I'd like to have 5 instances of fckeditor on the collect_info page.
Thanks!
Re: How-To: Add new Properties to your Products
Quote:
Originally Posted by
molywerks
Gillian -
My custom data is now running through Tabbed Products Pro, but from an old tpl_product_info_display.php file I found this line of code which shows the title in bold and the data in plain via my CSS file:
[FONT="Courier New"]
<?php if (!empty($product_info->fields['init_upc'])) echo '<tr><td class="detail-head">UPC » </td><td class="detail-copy">' . $product_info->fields['init_upc'] . '</td></tr>'; ?>[/FONT]
where init_upc is my custom data field, and I am 99% positive this did not show UPC » when there was no data value.
FWIW, in TPP, I have the following bit of PHP, which definitely does not show the title when there is no data value:
[FONT="Courier New"]
$fmtDOT .= (($flag_show_product_info_init_upc == 1 and !empty($init_upc)) ? '<li style="list-style:none;margin-left:-2.25em"><strong>upc</strong> ' . $init_upc . '</li>' : '') . "\n";[/FONT]
In the above example, like too many bits of hard-coded style values on my site, I have not yet converted it into CSS.
Hi All,
I am now on this thread as I picked up on the above link, I have tried to implement this but while my custom fields will show on product display page using the above code, they will not behave in the same manner when using TPP, has anybody else had this, I'm spending so much time on this and just seem to be going around in circles???:wacko:
Re: How-To: Add new Properties to your Products
Hi All just to let ye know in case anyone comes across the same problem that I have got this sorted by using the following code allowed me to call in my custom fields for TPP:
$fmtDOT .= '<li>' .TEXT_PRODUCT_COUNT . $products_count .($product_info->fields['products_count']). "\n";
$fmtDOT .= '<li>' .TEXT_PRODUCT_UNIT_COST . $products_unit_cost .($product_info->fields['products_unit_cost']). "\n";
Sooo Happy, might have been a walk in the park for some but a mountain climbed for me!!!!:clap::clap::clap::clap::clap:
Re: How-To: Add new Properties to your Products
I have tried it and it works ~~~
But can anyone tell me how to add those new field and show in Product listing column and sort?
Re: How-To: Add new Properties to your Products
I have created quite a few fields which works perfectly, Thanks for this.
What I would like to do is put a couple of these entered fields into my product listings page.
Would I put the $product_info->fields['products_guarantee'] in my common/columnar_display file or my templates/product_listings page or some other page?
And if so where would I need to add SELECT p.products_guarantee... part in?
Any help would be appreciated.
Jay
Re: How-To: Add new Properties to your Products
Ok, so far I am think I need to add what I want in modules/product_listing.php but from what I have learnt in the past is that the modules files can be a little sensitive...
...so before I start to play around (obviously with a backup done:)) if anyone could save me a bit of time and point me in the right direction, that would greatly be appreciated.