Re: How-To: Add new Properties to your Products
ok, but doesn't using attributes on the user side? Meaning, when a user is say looking a tshirt, and they wantr to order it and they select their size. Isn't tht how the attributes work? That NOT what I need. Since the clothes being sold are always just one set size by the admin.
Shopping by size doesn't have to be part of the category menu I guess, I could just make it a pull down menu or other type just below the category menu in a sidebox.
Re: How-To: Add new Properties to your Products
Quote:
Originally Posted by
magneteye
ok, but doesn't using attributes on the user side? Meaning, when a user is say looking a tshirt, and they wantr to order it and they select their size. Isn't tht how the attributes work? That NOT what I need. Since the clothes being sold are always just one set size by the admin.
Fair enough. Then attributes won't be your solution. My other comments still apply.
Re: How-To: Add new Properties to your Products
Just for the record, re: post 19 (product details list and not getting your new field to display by itself), before the output <ul> section there is an if() test which only displays the list if one of its elements has a value or is set to display.
Add your field to that test and it will trigger the list to show.
Re: How-To: Add new Properties to your Products
Has anyone been able to add additional product fields using a separate table? Can you provide an easy 'how-to' for us with little knowledge such as the one shown here?
Not sure if this has been posted on the wish-list, but this, along with the ability to add additional customer info fields, is essential to any growing business and probalby should be a standard feature of ZenCart.
Re: How-To: Add new Properties to your Products
Quote:
Originally Posted by
crazy_chris
Guarantee:
<?php if (!empty($product_info->fields['products_guarantee'])) echo $product_info->fields['products_guarantee']; ?>
This is supposedly only going to output if something exists, but it am placing my items in a list and can't seem to figure out how to make it NOT show the list bullets (and list title) when it is empty. Can anyone help?
EDIT:
I figured it out on my own:
<?php if (!empty($product_info->fields['products_guarantee'])) echo '<li>' . $product_info->fields['products_guarantee'] . '</li>'; ?>
BUT, I can't figure out how to hide the list title if nothing exists in any of my 4 new fields that create the list.
Here's the code as is, and obviously the "Product Features" is always there at this point:
Quote:
<p><strong>Product Features:</strong></p>
<ul>
<?php if (!empty($product_info->fields['products_feature1'])) echo '<li>' . $product_info->fields['products_feature1'] . '</li>'; ?>
<?php if (!empty($product_info->fields['products_feature2'])) echo '<li>' . $product_info->fields['products_feature2'] . '</li>'; ?>
<?php if (!empty($product_info->fields['products_feature3'])) echo '<li>' . $product_info->fields['products_feature3'] . '</li>'; ?>
<?php if (!empty($product_info->fields['products_feature4'])) echo '<li>' . $product_info->fields['products_feature4'] . '</li>'; ?>
</ul>
Re: How-To: Add new Properties to your Products
Quote:
Originally Posted by
gjh42
Just for the record, re: post 19 (product details list and not getting your new field to display by itself), before the output <ul> section there is an if() test which only displays the list if one of its elements has a value or is set to display.
Add your field to that test and it will trigger the list to show.
I'm working on a product type;however it really only is adding one field to the products table for that product type. I'm having the same issue - getting the field to display on the products detail page. I've done this before, in an older version with no problems - but for some reason its giving me fits this time (I'm upgrading).
The admin side works perfectly - all data is collected and displayed properly.
I did as you stated above and listed the field in the test - Here is the code from that section (product_candle is the product type - burn_time is the field - )
Code:
<!--bof Product details list -->
<?php if ( (($flag_show_product_candle_info_model == 1 and $products_model != '') or <?php if ( (($flag_show_product_candle_info_burn_time == 1 and $products_burn_time != '') or ($flag_show_product_candle_info_weight == 1 and $products_weight !=0) or ($flag_show_product_candle_info_quantity == 1) or ($flag_show_product_candle_info_manufacturer == 1 and !empty($manufacturers_name))) ) { ?>
<ul id="productDetailsList" class="floatingBox back">
<?php echo (($flag_show_product_candle_info_model == 1 and $products_model !='') ? '<li>' . TEXT_PRODUCT_MODEL . $products_model . '</li>' : '') . "\n"; ?>
<?php echo (($flag_show_product_candle_info_burn_time == 1 and $products_burn_time !='') ? '<li>' . TEXT_PRODUCT_BURNTIME . $products_burn_time . '</li>' : '') . "\n"; ?>
<?php echo (($flag_show_product_candle_info_weight == 1 and $products_weight !=0) ? '<li>' . TEXT_PRODUCT_WEIGHT . $products_weight . TEXT_PRODUCT_WEIGHT_UNIT . '</li>' : '') . "\n"; ?>
<?php echo (($flag_show_product_candle_info_quantity == 1) ? '<li>' . $products_quantity . TEXT_PRODUCT_QUANTITY . '</li>' : '') . "\n"; ?>
<?php echo (($flag_show_product_candle_info_manufacturer == 1 and !empty($manufacturers_name)) ? '<li>' . TEXT_PRODUCT_MANUFACTURER . $manufacturers_name . '</li>' : '') . "\n"; ?>
</ul>
Any suggestions?:blink:
Re: How-To: Add new Properties to your Products
Hey this is a great tutorial thanks,
I have a question, I want to use textarea instead of the input field, I looked to see how the description field was coded so I copied and replaced “zen_draw_input_field” with “zen_draw_textarea_field” and Zen Cart did not like that at all, how can I change the input field to a textarea?
Code:
Warning: Missing argument 4 for zen_draw_textarea_field()
Re: How-To: Add new Properties to your Products
Ok I got it to work using the following code, I hope others find this useful
Code:
<?php echo zen_draw_textarea_field('products_YOUR-FIELD-NAME[' . $languages[$i]['id'] . ']', 'soft', '100%', '10', $pInfo->products_YOUR-FIELD-NAME, zen_set_field_length(TABLE_PRODUCTS, 'products_YOUR-FIELD-NAME')); ?>
Re: How-To: Add new Properties to your Products
Hi,
this issue is really bothering me as well. I will soon go insane on this!
I also needs extra fields to choose from in admin. Some of them should be textfields, some would be dropdown with values and some would need checkboxes.
In other carts I worked with this was not usually a problem and with Zencart that is bright and good on everything else I cant understand why this have to be such an issue.
For my needs It would be enough to be able to create attributes in normal way but then only use them for adminpart. No customers should be able to choose anything (like magneticeyes needs)
I really need to get this issue fixed somehow. If someone feels like they could fix this i´m willing to pay him/her to do it.
Best regards,
Ola
Re: How-To: Add new Properties to your Products
Quote:
Originally Posted by
jagge
I really need to get this issue fixed somehow. If someone feels like they could fix this i´m willing to pay him/her to do it.
There is a message board in this forum for hiring custom coding work. I've done that very successfully, worked with a developer in another country, in fact, who was familiar enough with ZC and he was able to deliver what I needed very nicely, at a fair price. What you describe is trivial for an experienced developer who knows ZC, but if you're not handy with PHP and SQL, adding extra product attribute fields is not a simple thing. It would be lovely to automate custom fields in some future edition of ZC, it would make creating custom product types a breeze, wouldn't it! The custom code will need to be nested inside several files according to the current code structure. This creates future maintenance chores for you, as you must manually merge and update files for each future ZC release. Just some things to think about.
---Diana