Re: How-To: Add new Properties to your Products
Quote:
Originally Posted by
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
Re: How-To: Add new Properties to your Products
Anyone think they can make this work so different product details appear on the product listing page(in columns) based on category?
-lindasdd
Re: How-To: Add new Properties to your Products
Quote:
Originally Posted by
yisou
Code:
<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 -
Re: How-To: Add new Properties to your Products
Quote:
Originally Posted by
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
Re: How-To: Add new Properties to your Products
Quote:
Originally Posted by
lindasdd
Anyone think they can make this work so different product details appear on the product listing page(in columns) based on category?
-lindasdd
Quote:
Originally Posted by
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!
Re: How-To: Add new Properties to your Products
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
Re: How-To: Add new Properties to your Products
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.
Re: How-To: Add new Properties to your Products
Quote:
Originally Posted by
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.
Re: How-To: Add new Properties to your Products
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 -->
Re: How-To: Add new Properties to your Products
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.