Re: How-To: Add new Properties to your Products
Hi all. I have a quick question on this procedure if someone would be kind enough to help me out.
I've followed this procedure exactly as outlined in the first post, and have successfully added six custom properties to my general products. THANKS SO MUCH crazy_chris!!!
I decided it would be nice to add similar custom properties for the Document - General "product" type as well. I set up the custom fields in the products table exactly as before, and made the same modifications to collect_info and preview_info, EXCEPT...
...in admin/modules/document_general
instead of admin/modules/product
The input fields are there, just as expected, when I go to create or update a Document - General product.
However, looking at the newly-created product in the database (via PHPAdmin) the values entered into the custom fields aren't being inserted into the database.
There's only one update_product file for all product types, and I did add the new custom properties to the SQL array right below where I added the previous ones.
I do notice that a little farther down in the update_product code, there are two sections:
///////////////////////////////////////////////////////
//// INSERT PRODUCT-TYPE-SPECIFIC *INSERTS* HERE //////
//// *END OF PRODUCT-TYPE-SPECIFIC INSERTS* ////////
///////////////////////////////////////////////////////
///////////////////////////////////////////////////////
//// INSERT PRODUCT-TYPE-SPECIFIC *UPDATES* HERE //////
//// *END OF PRODUCT-TYPE-SPECIFIC UPDATES* ////////
///////////////////////////////////////////////////////
...but if I need to put something there, what needs to be put there unfortunately is a bit over my head.
Anybody care to share some thoughts on what I'm missing to insert these values?
Re: How-To: Add new Properties to your Products
Update: I have manually populated the new fields through PHPAdmin, and:
1. tpl_document_general_info_display shows the custom properties just fine
2. document_general/collect_info pre-populates the fields with the new, manually-entered info when I view the product in ZC admin.
I haven't yet tried to "update" the product through ZC admin, because I'm afraid it'll reset the fields in the database to NULL :)
Seems everything works great except the insert. I really think it has something to do with product-type being 3 (Document - General) in update_product. But for the life of me, I can't seem to figure out why.
Re: How-To: Add new Properties to your Products
Hello,
I have two question:
firstly, I went through all the steps, but I cannot see the textboxes to put my information in from the New Product admin control.
Secondly, is it possible to have a checklist of things: I have a car dealership. I would like to check off all of the features that the car has. Is that possible?
Thanks!
Re: How-To: Add new Properties to your Products
Wish I could help someone out here cuz I am stumped with my problem.
This install how-to worked great for me! But for some reason the 20+ new fields are not getting searched. Anybody else having this problem? Did I miss something?
I've inserted hoobajonesfieldname in each new field of a test product (where fieldname is substituted by the, uh, field name), so I know the data is there, but when I search for each variation, no luck.
Ahhh, troubleshooting on a Friday night.
Re: How-To: Add new Properties to your Products
Three and a half hours later less dinner and a dog walk, here is an answer to enhanced custom search.
Re: How-To: Add new Properties to your Products
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.
Re: How-To: Add new Properties to your Products
Open includes\index_filters\default_filter.php and includes\modules\pages\advanced_search_result\header_php.php.
Look at the areas surrounding the following fields and see how it is coded.
PRODUCT_LIST_MODEL
PRODUCT_LIST_MANUFACTURER
PRODUCT_LIST_QUANTITY
PRODUCT_LIST_IMAGE
PRODUCT_LIST_WEIGHT
I imagine if you follow the established code and do some cut-n-paste to add your fields in the same format that it ought to work or at least get you on the right track. That'd be my guess since I just edited those two files to handle the search for 20+ custom fields. And in the code notes, it mentions setting "the default sort order" before the fields I listed above.
Re: How-To: Add new Properties to your Products
Many Many Thanks didn't expect it will be so easy
Re: How-To: Add new Properties to your Products
I got another question regarding product extra fields. Let say we got extra sizes A, B, C, D ...
Products in category 1 got sizes A, B, C
Products in category 2 got only sizes A, C
How to make if you leave blank size B for category 2 that is automaticly no visible
in product overview for category 2 so only sizes A and C are visible and there is no
empty space between them.
thanks in advance
Re: How-To: Add new Properties to your Products
<?php if (!empty($product_info->fields['custom1_planets'])) echo '<tr><td class="custom-head">Planetary Body:</td><td class="custom-body">' . $product_info->fields['products_custom1'] . '</td></tr>'; ?>
When the custom1_planets field has an entry, e.g. Saturn, then the above snippet of code will display (depending upon CSS, of course):
Planetary Body: Saturn
If the custom1_planets field is empty, then nothing is displayed, including the "Planetary Body:" portion. Mind your spaces, periods and single quotes.