Re: How-To: Add new Properties to your Products
I had some time today and i managed to solve my problem:
not to show on all my products the new field that i have added to products_description table.I managed that by checking another new field from table products_description, if set to 0 not to show new field and if set to 1 show the new field on product info display page.
this is the code i used
PHP Code:
<!--bof Product fit-->
<?php if ($product_info->fields['products_fiton'] != "1") {
} else { ?>
<div id="productDescription">
<a href="javascript:animatedcollapse.toggle('jason')"><h1 id="productName" class="productGeneral">Arata toate modelele la care se potriveste</h1></a>
<div id="jason" style="background: #FFFFCC; display:none">
<?php if (!empty($product_info->fields['products_fit'])) echo $product_info->fields['products_fit']; ?>
</div>
<?php } ?>
<!--eof Product fit -->
Best regards Zoli
Re: How-To: Add new Properties to your Products
Greetings,
I have followed the direction over and over and over and still can't get it to work..
Everything works, except it dosnt show the value on the product view on the site, in Admin everything is working fine, the vaules even come up in PHPAdmin and i can change them in Admin as much as i want, it just won't show the vaule on the product view.
Here is what i am talking about;
http://www.agelessartifacts.com/stor...&products_id=1
Here is a copy of the coding, it is combine with the Austpost shipping model.
http://www.agelessartifacts.com/private/catalog.rar
Re: How-To: Add new Properties to your Products
Anyone have any ideas on how to add the new field to product listing. I have added delivery info to my product info. What I need is for my customers to be able to see this in my product list also. I have successfully added it to product info page but still puzzling away trying to get it in product listing. Any ideas anyone?
Re: How-To: Add new Properties to your Products
Just wondering if anyone has managed to get this working using google maps on a product info page.
As far as I see you could add as instructed in this thread and then, possibly, use the relevant co-ordinates to produce the map - in theory anyway!
Re: How-To: Add new Properties to your Products
Quote:
Originally Posted by
janekbar5
Hi
I follow this post and managed to add 2 extra fields (Size A and size B). But on the product overview they can't be sortable (like quantity or weight). Is anybody know wher the problem can be?. The example is on :
http://www.zancart137.may.com.pl/ind...dex&cPath=3_10
Thanks in advance.
Hi janekbar5, thanks for the great information that you provided, i tried everything, but i can't seem to some the added information on the product listing page.
i went through every single posting on this thread, there is something missing i can find it, i checked this website that you posted http://www.zancart137.may.com.pl/ind...&cPath=3_67_71
it's exactly what i'm looking for, if you can help me i would realy appreciate it.
thanks
Re: How-To: Add new Properties to your Products
This has really been a great post and has helped a tons, so let me start by saying thanks !!
i have figured out how to get my new fields to a new table and have also gotten my products_model to write to multiple tables, but the big problem im having is getting the Products_name to write to my `products` table as well as the `product_description` table?? i have gotten it to write, but when i check, the field only shows 'Array' any suggestions would be greatly appreciated. also if anyone is still looking for help on how to write to a new table, let me know and ill try to help.
Re: How-To: Add new Properties to your Products
janekbar5, i really want to know how you did that table view with the extra fields.
thanks.
Re: How-To: Add new Properties to your Products
ok heres what i did
created a new table called zen_bisac, then added the table in the includes/database_tables.php
define('TABLE_BISAC', DB_PREFIX . 'bisac');
on both collect_info.php and preview_info.php i added the following
################################################################################################################################################################
from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
################################################################################################################################################################ __
from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_BISAC . " bs
i also added my extra fields above that
################################################################################################################################################################ ___
$product = $db->Execute("select pd.products_name, pd.products_description, pd.products_url,
################################################################################################################################################################ ___
$product = $db->Execute("select pd.products_name, pd.products_description, pd.products_url,bs.products_model,bs.pages,bs.month,bs.year,bs.dewey,
on collect info i made sure to add the datafields that will display on page
<tr>
<td class="main"><?php echo 'Pages '; ?></td>
<td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '13') . ' ' . zen_draw_input_field('pages', $pInfo->pages, zen_set_field_length(TABLE_BISAC, 'pages')); ?></td>
</tr>
<tr>
<td class="main"><?php echo 'Pub Month '; ?></td>
<td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '13') . ' ' . zen_draw_input_field('month', $pInfo->month, zen_set_field_length(TABLE_BISAC, 'month')); ?></td>
</tr>
<tr>
<td class="main"><?php echo 'Pub Year '; ?></td>
<td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '13') . ' ' . zen_draw_input_field('year', $pInfo->year, zen_set_field_length(TABLE_BISAC, 'year')); ?></td>
</tr>
<tr>
<td class="main"><?php echo 'Dewey '; ?></td>
<td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '13') . ' ' . zen_draw_input_field('dewey', $pInfo->dewey, zen_set_field_length(TABLE_BISAC, 'dewey')); ?></td>
</tr>
on collect_info.php i added the following lines
$tmp_value = zen_db_prepare_input($_POST['pages']);
$pages = (!zen_not_null($tmp_value) || $tmp_value=='' || $tmp_value == 0) ? 0 : $tmp_value;
$tmp_value = zen_db_prepare_input($_POST['month']);
$month = (!zen_not_null($tmp_value) || $tmp_value=='' || $tmp_value == 0) ? 0 : $tmp_value;
$tmp_value = zen_db_prepare_input($_POST['year']);
$year = (!zen_not_null($tmp_value) || $tmp_value=='' || $tmp_value == 0) ? 0 : $tmp_value;
$tmp_value = zen_db_prepare_input($_POST['dewey']);
$dewey = (!zen_not_null($tmp_value) || $tmp_value=='' || $tmp_value == 0) ? 0 : $tmp_value;
$tmp_value = zen_db_prepare_input($_POST['products_model']);
around line 100 or so add the query
$db->Execute("insert into " . TABLE_BISAC . "
(products_id, products_model, pages, month,year,dewey)
values ('" . (int)$products_id . "', '" . $_POST['products_model'] . "', '" . $pages . "', '" . $month . "', '" . $year . "', '" . $dewey . "')");
that should pretty much do it !!!!
Re: How-To: Add new Properties to your Products
Hi zskiman,
i followed your posting step by step, everything worked fine, the new fields show on the admin area when adding a new product, but it doesn't show on the product description and product listing pages, is there something i'm missing here, can you please help.
thank you.
Re: How-To: Add new Properties to your Products
this may not be the best way, or there may be a better way to query from zen, but this is how i add to tpl_products_display.php
at the top of page
############################################################
// ***SQL Statement***:
$prod_run= "SELECT * FROM zen_bisac WHERE products_model='$products_model'";
$query_result = mysql_query($prod_run) or die(mysql_error());
while($row = mysql_fetch_assoc($query_result)) {
$month = $row[month];
$year = $row[year];
$dewey = $row[dewey];
$pages = $row[pages];
};
########################################################################################################################
then wherever you want to display the variables just echo them
echo 'Publication Date: ' . $month . '/' . $year . '<br>';
and so on...
you can also use some if statements to make sure they dont show if they are empty!!
if ($month != ''){
echo 'Publication Date: ' . $month . '/' . $year . '<br>';
};