Forums / Setting Up Categories, Products, Attributes / How-To: Add new Properties to your Products

How-To: Add new Properties to your Products

Views: 144,144

Results 121 to 140 of 272
8 Nov 2008, 5:24 PM
#121
lumpylumpy avatar

lumpylumpy

New Zenner

Join Date:
Feb 2008
Posts:
27
Plugin Contributions:
0

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

<!--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

16 Nov 2008, 4:37 AM
#122
delights avatar

delights

Zen Follower

Join Date:
May 2006
Location:
Queensland, Australia
Posts:
254
Plugin Contributions:
0

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/store/index.php?main_page=product_info&cPath=0&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

19 Nov 2008, 4:21 AM
#123
stevecollins avatar

stevecollins

New Zenner

Join Date:
Aug 2005
Location:
Southampton
Posts:
80
Plugin Contributions:
0

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?

5 Dec 2008, 2:44 PM
#124
bigbadboy avatar

bigbadboy

Totally Zenned

Join Date:
Apr 2008
Location:
London
Posts:
557
Plugin Contributions:
0

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!

11 Dec 2008, 6:42 PM
#125
hovsepations avatar

hovsepations

New Zenner

Join Date:
Sep 2008
Location:
Toronto
Posts:
35
Plugin Contributions:
0

Re: How-To: Add new Properties to your Products

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/index.php?main_page=index&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/index.php?main_page=index&cPath=3_67_71
it's exactly what i'm looking for, if you can help me i would realy appreciate it.

thanks

12 Dec 2008, 2:19 PM
#126
zskiman avatar

zskiman

New Zenner

Join Date:
Mar 2005
Posts:
69
Plugin Contributions:
0

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.

Never be afraid to try something new, remember that amateurs built the ark, professionals built the Titanic

14 Dec 2008, 6:14 AM
#127
hovsepations avatar

hovsepations

New Zenner

Join Date:
Sep 2008
Location:
Toronto
Posts:
35
Plugin Contributions:
0

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.

15 Dec 2008, 1:00 PM
#128
zskiman avatar

zskiman

New Zenner

Join Date:
Mar 2005
Posts:
69
Plugin Contributions:
0

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 !!!!

Never be afraid to try something new, remember that amateurs built the ark, professionals built the Titanic

22 Dec 2008, 6:43 PM
#129
hovsepations avatar

hovsepations

New Zenner

Join Date:
Sep 2008
Location:
Toronto
Posts:
35
Plugin Contributions:
0

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.

23 Dec 2008, 2:10 PM
#130
zskiman avatar

zskiman

New Zenner

Join Date:
Mar 2005
Posts:
69
Plugin Contributions:
0

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>';
};

Never be afraid to try something new, remember that amateurs built the ark, professionals built the Titanic

22 Jan 2009, 12:25 AM
#132
lilleypadgifts avatar

lilleypadgifts

Totally Zenned

Join Date:
Jan 2007
Location:
Southern California
Posts:
550
Plugin Contributions:
0

Re: How-To: Add new Properties to your Products

I'm still reading over all of the posts here, but I need to go to church (please God forgive me for the words that pass thru my lips as I work on PHP code :censored:) and hoping someone might be able to answer my questions so I can finish this up tonight when I get home.

I have followed the steps to add fields. I added 5.
All went well, and I can see them when adding or editing a product... BUT ... after preview (which doesn't show the info) I update or insert and the info disappears from Admin and never does show from the customer's view.

Is this happening because I installed EP this morning? Does this work at all with EP? I'm only up to page 7 of the thread here and what I've seen so far says it doesn't work with EP (which I didn't know until after the fact), but now I'm hoping that in the million posts to follow it was decided that it could work with it! That is my MAIN FOCUS ... to take a exported file of comics from a website that I have some of my comics loaded into and with a bit of reworking the file, I can then use to EP the site....we have over 30,000 comics, so we NEED easy :lookaroun.

Any hope?:unsure:
Thanks!

22 Jan 2009, 6:41 AM
#133
lilleypadgifts avatar

lilleypadgifts

Totally Zenned

Join Date:
Jan 2007
Location:
Southern California
Posts:
550
Plugin Contributions:
0

Re: How-To: Add new Properties to your Products

Would just like to add that I found a post in this thread that mentioned to add the correct tpl_product_info_display.php edits to the one in your custom template for it to work...so I edited the file in
/includes/templates/darkness/templates because I'm using the darkness template.
Still doesn't work :no:.
I can see the fields in Admin add/edit a product.
I can enter info into the fields.
Once I click on Update/Insert it all disappears and nothing EVER shows in the customer view :cry:

HELP!!!! :Flush:

22 Jan 2009, 1:00 PM
#134
hovsepations avatar

hovsepations

New Zenner

Join Date:
Sep 2008
Location:
Toronto
Posts:
35
Plugin Contributions:
0

Re: How-To: Add new Properties to your Products

i had the same problem, when i added the extra fields on the admin area, and when i enter some info there it is showing on the product info page, but not on the product listing page where it shows all the products under one sub-category.

so i donno if anyone found a solution for this, i'v been asking about hints for a long time, but no one seems to know or care i guess.

23 Jan 2009, 7:46 AM
#135
lilleypadgifts avatar

lilleypadgifts

Totally Zenned

Join Date:
Jan 2007
Location:
Southern California
Posts:
550
Plugin Contributions:
0

Re: How-To: Add new Properties to your Products

hovsepations:

i had the same problem, when i added the extra fields on the admin area, and when i enter some info there it is showing on the product info page, but not on the product listing page where it shows all the products under one sub-category.

so i donno if anyone found a solution for this, i'v been asking about hints for a long time, but no one seems to know or care i guess.

Well, I can't seem to get it to show anywhere! It won't stick in the fields.
PLEASE somebody help!!!!!
I have tried to work my site without it, but I need this info!
Is it because of EP? Can adding fields work with EP? Is there another thread that lets you add fields to EP AND to Admin?
PLEASE PLEASE PLEASE... someone let us know how to get this to work or where we've made errors that are causing the info to not stick! I sitll have 5 more stores to finish :wacko:

23 Jan 2009, 8:16 AM
#136
jmelwak avatar

jmelwak

New Zenner

Join Date:
Jul 2007
Posts:
64
Plugin Contributions:
0

Re: How-To: Add new Properties to your Products

i have followed this to a T, but im getting this error

1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition = 'new', products_image = '11275698.jpg', products_last_modified = now' at line 1
in:
[update products set products_quantity = '95', products_type = '1', products_model = '', products_price = '69.9900', products_price_w = '0', products_date_available = null, products_weight = '2', products_status = '1', products_virtual = '0', products_tax_class_id = '1', manufacturers_id = '0', products_quantity_order_min = '1', products_quantity_order_units = '1', products_priced_by_attribute = '0', product_is_free = '0', product_is_call = '0', products_quantity_mixed = '1', product_is_always_free_shipping = '0', products_qty_box_status = '1', products_quantity_order_max = '0', products_sort_order = '0', products_discount_type = '0', products_discount_type_from = '0', products_price_sorter = '69.9900', manufacturer_country = 'usa', condition = 'new', products_image = '11275698.jpg', products_last_modified = now(), master_categories_id = '113' where products_id = '204']
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.

any ideas what this could be?

10 Mar 2009, 12:21 AM
#137
rgoins avatar

rgoins

New Zenner

Join Date:
Mar 2009
Posts:
6
Plugin Contributions:
0

Re: How-To: Add new Properties to your Products

I am receiving the same exact "1064 You have an error in your SQL syntax" message. I followed the same instructions as well but when I try to insert, or update, a product, I get the error. I have NO idea where to begin to try and resolve this...

11 Mar 2009, 5:03 AM
#138
rgoins avatar

rgoins

New Zenner

Join Date:
Mar 2009
Posts:
6
Plugin Contributions:
0

Re: How-To: Add new Properties to your Products

I believe I have found the solution to the "1064...error". When I added my new fields to the products table I used "pattern_style, condition, mark".

I kept getting the 1064 error regardless of what I tried...including uninstalling, reinstalling, manually installing, and on, and on, and on...

I ended up changing my new fields to "products_pattern_style, products_condition, products_mark", and of course made the same changes to the php files that were referenced on the 1st page and that was it. No more 1064 error! Hopefully this will help someone else out. I'm still not sure why I needed the prefix "products_" in the table and am curious to know why. So if you know why...please fill me in!

13 Mar 2009, 1:42 PM
#139
dropbop avatar

dropbop

Zen Follower

Join Date:
Apr 2008
Location:
Athlone, Ireland
Posts:
177
Plugin Contributions:
1

Re: How-To: Add new Properties to your Products

Firstly, Thanks for this - The step by step guide was great. But I did fond one or two things that might need adding to it, and may be the reason why others are having problems

Here is one quick example:

p.products_price_sorter, p.master_categories_id,

  							  p.products_lining

                          from "

Notice the "," after p.master_categories_id - You need to put that "," in there if your putting the new line of code after. p.master_caterories_id was the last line so it didnt need the "," at the end, but now it is not last and you need to add the ","

Other than that - I was wondering if there is a way to add the field to an EP file.

Any ideas, or even where to go looking.

I will have a search around to see if firstly, its possible and secondly, how to do it. But if anyone does know can they post it here or pm me. Ill drop by again later..

Cheers, and thanks again for this step by step guide :)
Its made things so much simplier for me - I hate using atribute so this is perfect.

Chow for now

DB

16 Mar 2009, 8:28 AM
#140
yakbuttertea avatar

yakbuttertea

New Zenner

Join Date:
Feb 2009
Posts:
31
Plugin Contributions:
0

Re: How-To: Add new Properties to your Products

Try to use the info in that thread but nothing works...:frusty:I was able to add my fields in the data base but can't seem to display them...:frusty:Can someone tell which file to modify to change the products display when listing a category?Many Thanks