Add features to the product details

Hello. Ηow I can add some features (such as weight, color, size) under the stock? Can someone help me? Thank you

Logged in as Admin in the Admin Panel.



Then go to >> Catalog >> Global Options >>> and then you can add Clor, Size or other things.

But I do not want to appear as text fields such as quantity (where you can write there), but as the stock.

is there an option in admin to do this or should i add some code?

I guess it really depends on exactly what you want to add. Something like the product weight is pretty simple, but I’m not sure about features like color, manufacturer, etc.



This is how I added the weight:







I did this by changing:



skins/your-skin/customer/views/products/components/buy_now.tpl



I added:


{$lang.weight}: {$product.weight} {$lang.lbs}





After:


```php {if $show_sku}

{$lang.sku}: {$product.product_code}


{/if} ```

I am sure you can do this with other things, you would probably just need to play around with it a bit.

I hope this helps though,

Brandon

Thank you very much for your help.



Εxcept the weight, I would like to display some other product characteristics such as dimensions.



In the photo you attach an example from the demo that is in



[URL=“Instant Demo - CS-Cart Multi-Vendor Demo Try Free for 15 days”]Instant Demo - CS-Cart Multi-Vendor Demo Try Free for 15 days .







Can this be done by admin or will be added new fields in database?



Thanks

This can be done, but it does require a few steps. I’ll show you by an example of what I did and hopefully you can change what you need to make what I did work for you.



What I did is added an input so that I can put my cost of an item into the database. Obviously I don’t want to display this data to the customer, but you would just use the example above to show your data.



Here is what I did. There might be a better way, but this worked for me.



First I ran this SQL command:


ALTER TABLE cscart_products ADD cost decimal(5, 2);



What this did is add a row into the products table of my database named “cost”.



Once the database was done I then changed:



skins/basic/admin/views/products/update.tpl



I added:


```php



{$lang.cost} ({$currencies.$primary_currency.symbol}) :


```

After:

```php

{$lang.price} ({$currencies.$primary_currency.symbol}) :

```

This allows me to add the cost of the item into the database.

I also want to export and import this field as a csv file so I changed:

schemas/exim/products.php

I added:

```php 'Cost' => array (
'#db_field' => 'cost',
), ```

After:

```php 'Price' => array (
'#table' => 'product_prices',
'#db_field' => 'price',
), ```

Now in your case you want to display the information to the customer so you would change:

skins/your-skin/customer/views/products/components/buy_now.tpl

You would add:

```php

{$lang.cost}: ({$currencies.$primary_currency.symbol}){$product.cost}

```

Before:

```php {if $hide_add_to_cart_button != "Y"}
{if !$simple && $product.product_options}
{include file="views/products/components/product_options.tpl" id=$obj_id product_options=$product.product_options name="product_data"}
{/if} ```

Like I said this is for adding the product cost to the database so you would have to do some modifications to make it work for you.

I hope this helps anyway,

Brandon

Sorry to bump this topic…



I just wanted to say thank you very very much to the post just above detailing the method of adding an extra field. Absolutely perfect - worked fantastically.



THANK YOU!