Zen Follower
- Join Date:
- May 2009
- Location:
- Junction City, Oregon
- Posts:
- 315
- Plugin Contributions:
- 0
How-To: Add new Properties to your Products
It was in the collect info.php file. Thank you! :smile:
Views: 144,144
Zen Follower
It was in the collect info.php file. Thank you! :smile:
New Zenner
Hello Everyone!
I've searched the thread and just can't seem to find the solution here. Does anyone know how to implement what Crazy Chris showed us here with Easy Populate. I've done all the steps in the first post and uploaded the files where everything appears successful but the new information I was hoping to see is not showing up. Thanks to you all for such a great thread!
http://makemyhousegreen.com/index.php?main_page=product_info&cPath=15_56_58&products_id=9364
Thats a link to one of my products which should display the new information
Thanks again everyone
Totally Zenned
Ok - I think I am almost there -
but I niow have this errors mess in my products table
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\xampplite\htdocs\snfcart\admin\includes\modules\product\collect_info.php on line 47
here is my line in that file:
if (isset($_GET['pID']) && empty($_POST)) {
$product = $db->Execute("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, pdex.products_skilltype'
from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd,".
TABLE_PRODUCTS_SKILLTYPE . " pdex
where p.products_id = '" . (int)$_GET['pID'] . "'
and p.products_id = pd.products_id and p.products_id = pdex.products_id
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'");
Ideas please?
New Zenner
Hi with regard to this - it is very useful - thank you. However I am using tabbed products, I actually want these added fields showing up on the details tab. I have tried playing around with the tpl_products_info_display but can't get it to work.
Website is https://www.bike-force.co.uk which I have been working on for a couple of weeks - first time using zen cart. Also My lite box has stopped working.... Any help would be appreciated - thanks.
You will see I have done a basic if statement that displays item delivery time if out of stock taking this value from the newly created field. It will display "standard delivery time" if it is in stock. But I would like to place this data next to the stock field - but can not do this simply by placing code next to it in product_info_display.
New Zenner
Hi,
i have read the thread and couldnt't find anything about language support. Is it also possible to add properties for different languages as with attributes? And if how?
Zen Follower
Bikeforce:
Hi with regard to this - it is very useful - thank you. However I am using tabbed products, I actually want these added fields showing up on the details tab. I have tried playing around with the tpl_products_info_display but can't get it to work.
Did you ever get this to work. I'm trying to do the same thing.
https://www.jhelectronics.com
Using Zencart 1.3.9h
New Zenner
<td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_input_field('products_guarantee', $pInfo->products_guarantee, zen_set_field_length(TABLE_PRODUCTS, 'products_guarantee')); ?></td>
I need multi lines, how to do?
Zen Follower
Can somebody explain how technicaly to"open the table "products" in your zencart-database"?
Where "table products" is located and what editor have to be used?
Thanks
Zen Follower
Bikeforce:
Hi with regard to this - it is very useful - thank you. However I am using tabbed products, I actually want these added fields showing up on the details tab. I have tried playing around with the tpl_products_info_display but can't get it to work.
Bikeforce,
I'm pretty certain your question should really be directed at the author of the tabbed mod since this is something funky with how that mod works.
I use the tabbed mod as well and just gave up on trying to get the details in a tab.
-lindasdd
Zen Follower
<td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_input_field('products_guarantee', $pInfo->products_guarantee, zen_set_field_length(TABLE_PRODUCTS, 'products_guarantee')); ?></td> ```I need multi lines, how to do?yisou:
You may want to repost your question. I don't think anyone knows what you are asking. What are multilines?
-lindasdd
Zen Follower
idtags:
Can somebody explain how technicaly to"open the table "products" in your zencart-database"?
Where "table products" is located and what editor have to be used?
Thanks
idtags,
You do this in your database tables. Probably in your hosting account via MySQL controls.
If you have no idea what any of that means you should probably contact your web host for assistance. I would hate to provide instructions because when dealing directly with the table you can really fudge things up.
-lindasdd
Zen Follower
Anyone think they can make this work so different product details appear on the product listing page(in columns) based on category?
-lindasdd
New Zenner
<td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_input_field('products_guarantee', $pInfo->products_guarantee, zen_set_field_length(TABLE_PRODUCTS, 'products_guarantee')); ?></td> ``` > > I need multi lines, how to do? No I ended up taking the turning that tab off and just using css -yisou:
New Zenner
smoke133:
Did you ever get this to work. I'm trying to do the same thing.
sorry it quoted the wrong thing! No I turned the details tabs off and used CSS
New Zenner
lindasdd:
Anyone think they can make this work so different product details appear on the product listing page(in columns) based on category?
-lindasdd
lindasdd:
Bikeforce,
I'm pretty certain your question should really be directed at the author of the tabbed mod since this is something funky with how that mod works.I use the tabbed mod as well and just gave up on trying to get the details in a tab.
-lindasdd
Quite chirpy on this thread arent you Linda! Yes but the question related to this thread also as the newly created custom fields werent showing up in the details tabbs when the originals were - never mind I just settled with taking them out of the tabs.
With your second question I remember dabbling around with the product_listing.php in the modules folder of your template I added some custom fields to be displayed (displaying text related to stock quantity) but I think you want the next step and create a whole column - I think you just need to mimic the code that is there not entirely certian and i havent had time to test it but think you would need to add a new case statement:
case 'PRODUCT_LIST_PRICE':
$lc_text = TABLE_HEADING_PRICE;
like that and go through copying the format in a similar way to the beggining of this threads method - so do control f for price and work out whats happening for that column etc......some of the code is a bit funky so good luck - that's all I can tell you!
New Zenner
I have managed to add new peoprties to my products using the ideas in this thread ... thank you all sooooo much! And the field now appears in the product info page.
Now, I would like to take this a step further and add a title or heading to the field where it appears in the product info page.
Field Title: field value
so that it is more obvious to the customer what it is (e.g. Height: 50cm).
I used a version of this snippet of code .... to ensure it doesn't appear if there is nothing in the table for that field.
<?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>'; ?>but do I need to add some code elsewhere ... the field value is working but how do I get the **Field Title **to appear (in a colour and as a heading)?
Thanks
Gillian
Gillian Duff
Garden Furniture Scotland Ltd
The Home and Garden Company
New Zenner
once you are done, can you share the total steps and the code, because i couldn't get to show the extra fields in the product listing page, i was able to show it in the admin area and the product info page only.
thanks.
Zen Follower
Techiescot:
...but do I need to add some code elsewhere ... the field value is working but how do I get the **Field Title **to appear (in a colour and as a heading)?
Gillian,
Unless you're querying one data field and supplying data from another field, then you have a mismatch between $product_info->fields['custom1_planets'] and $product_info->fields['products_custom1'].
Also, if "Planetary Body" is not the field title, which requires CSS for for color and heading specification, then I'm not sure what you are asking.
New Zenner
Hi
Thanks ...
I have used the following code to have the new product additional fields appear when they are filled in and disappear when there is no value for it ... but it isn't working.
Help!
The FIELD TITLE is still appearing whether there is a value for it or not.
Also, can someone help me to format the FIELD TITLES in Bold but not the values. I would like it to look like this ...
Measurements: 30 x 50
**Materials: ** Glass and Aluminium
**Maintenance: **No Maintenance required
I am getting there slowly .... a case of trial and error ... but if someone could speed things up for me, I would be most grateful.
THANKS
Gillian
<!--bof Product New Properties --> <div class="productaddfields"> <?php if(isset($products_measurements)) { echo TEXT_PRODUCTS_MEASUREMENTS .$products_measurements ; }?><br /> <?php if(isset($products_materials)) { echo TEXT_PRODUCTS_MATERIALS .$products_materials ; }?><br /> <?php if(isset($products_maintenance)) { echo TEXT_PRODUCTS_MAINTENANCE .$products_maintenance ; }?><br /> </div> <!--eof Product New Properties -->Gillian Duff
Garden Furniture Scotland Ltd
The Home and Garden Company
Zen Follower
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:
<?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>'; ?>
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:
$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";
In the above example, like too many bits of hard-coded style values on my site, I have not yet converted it into CSS.
Tell staff why this post should be reviewed.