If this is your first visit, check our documentation. To post, register or login.

How-To: Add new Properties to your Products

Started by crazy_chris on 8 Feb 2007, 7:05 PM · Views: 144,237

Results 161 to 180 of 272
7 Oct 2009, 11:14 PM
#161
kismetdesign avatar

kismetdesign

Zen Follower

Join Date:
May 2009
Location:
Junction City, Oregon
Posts:
315
Plugin Contributions:
0

Post #161 by kismetdesign

It was in the collect info.php file. Thank you! :smile:

9 Oct 2009, 3:28 AM
#162
cawill24 avatar

cawill24

New Zenner

Join Date:
Jul 2009
Posts:
13
Plugin Contributions:
0

Post #162 by cawill24

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

11 Oct 2009, 3:08 PM
#163
stitchnkitty avatar

stitchnkitty

Totally Zenned

Join Date:
Jun 2009
Location:
Des Moines, Iowa USA
Posts:
618
Plugin Contributions:
0

Post #163 by stitchnkitty

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?

12 Oct 2009, 10:39 AM
#164
bikeforce avatar

bikeforce

New Zenner

Join Date:
Sep 2009
Posts:
73
Plugin Contributions:
0

Post #164 by 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.

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.

5 Nov 2009, 6:00 AM
#165
lavanya avatar

lavanya

New Zenner

Join Date:
Oct 2009
Posts:
9
Plugin Contributions:
0

Post #165 by lavanya

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?

23 Nov 2009, 12:17 PM
#166
smoke133 avatar

smoke133

Zen Follower

Join Date:
Jul 2007
Location:
Roseville, Michigan
Posts:
188
Plugin Contributions:
0

Post #166 by smoke133

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

8 Dec 2009, 5:57 AM
#167
yisou avatar

yisou

New Zenner

Join Date:
May 2009
Posts:
36
Plugin Contributions:
0

Post #167 by yisou

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

4 Jan 2010, 3:13 AM
#168
idtags avatar

idtags

Zen Follower

Join Date:
Aug 2005
Posts:
315
Plugin Contributions:
0

Post #168 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

9 Jan 2010, 5:53 PM
#169
lindasdd avatar

lindasdd

Zen Follower

Join Date:
Jun 2007
Posts:
474
Plugin Contributions:
0

Post #169 by lindasdd

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

9 Jan 2010, 5:54 PM
#170
lindasdd avatar

lindasdd

Zen Follower

Join Date:
Jun 2007
Posts:
474
Plugin Contributions:
0

Post #170 by lindasdd

yisou:

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

You may want to repost your question. I don't think anyone knows what you are asking. What are multilines?

-lindasdd

9 Jan 2010, 5:56 PM
#171
lindasdd avatar

lindasdd

Zen Follower

Join Date:
Jun 2007
Posts:
474
Plugin Contributions:
0

Post #171 by lindasdd

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

9 Jan 2010, 5:57 PM
#172
lindasdd avatar

lindasdd

Zen Follower

Join Date:
Jun 2007
Posts:
474
Plugin Contributions:
0

Post #172 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

12 Jan 2010, 10:12 AM
#173
bikeforce avatar

bikeforce

New Zenner

Join Date:
Sep 2009
Posts:
73
Plugin Contributions:
0

Post #173 by bikeforce

yisou:

<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 -
12 Jan 2010, 10:14 AM
#174
bikeforce avatar

bikeforce

New Zenner

Join Date:
Sep 2009
Posts:
73
Plugin Contributions:
0

Post #174 by bikeforce

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

12 Jan 2010, 10:32 AM
#175
bikeforce avatar

bikeforce

New Zenner

Join Date:
Sep 2009
Posts:
73
Plugin Contributions:
0

Post #175 by bikeforce

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!

21 Jan 2010, 2:43 PM
#176
techiescot avatar

techiescot

New Zenner

Join Date:
Nov 2009
Posts:
59
Plugin Contributions:
0

Post #176 by techiescot

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

21 Jan 2010, 3:00 PM
#177
hovsepations avatar

hovsepations

New Zenner

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

Post #177 by hovsepations

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.

22 Jan 2010, 12:24 AM
#178
molywerks avatar

molywerks

Zen Follower

Join Date:
Aug 2006
Posts:
136
Plugin Contributions:
0

Post #178 by molywerks

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.

23 Jan 2010, 4:58 PM
#179
techiescot avatar

techiescot

New Zenner

Join Date:
Nov 2009
Posts:
59
Plugin Contributions:
0

Post #179 by techiescot

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 -->
23 Jan 2010, 11:44 PM
#180
molywerks avatar

molywerks

Zen Follower

Join Date:
Aug 2006
Posts:
136
Plugin Contributions:
0

Post #180 by molywerks

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.