how to insert new columns in the products table?

  • Posts: 17
  • Thank you received: 0
13 years 5 months ago #17425

Hi,

I read a lot around the forum but I didn't find what I need.

I'd like to insert new columns in this table:


www.spizzicando.com/index.php?option=com_hikashop&ctrl=category&task=listing&cid=10&name=vini&Itemid=160



I want to insert a region where a product come from, the category of the products and a link to the manufacturer. So 3 new columns editable from backend.

I created a custom field of the table "product" via the menu Display->Custom fields. But this added just the new fields in the product details page.


How can I do what I wish?




Thanks


HikaShop Essential 1.5.0

Please Log in or Create an account to join the conversation.

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
13 years 5 months ago #17426

You need to go in the menu Display->Views and edit the file listing_table of the view product. There, you will be able to add new columns and echo the data of your products custom fields in these columns.

Please Log in or Create an account to join the conversation.

  • Posts: 17
  • Thank you received: 0
13 years 5 months ago #17482

Thanks for the tip.

My knowledge of php and html is really poor. I tried to insert a new column (named "categoria"), writing this lines:

<?php } ?>
<th class="hikashop_product_categoria" align="center">
<?php echo JText::_(CATEGORIA);?>
</th>

what is wrong with that?


Thanks


HikaShop Essential 1.5.0

Please Log in or Create an account to join the conversation.

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
13 years 5 months ago #17484

You should not add the line <?php } ?>
Also, that will just display the column header.
You also need to add some code few lines below in the foreach in order to display the data of that column for each product:
<td class="hikashop_product_categoria_row">
<?php echo $this->row->categoria; ?>
</td>

Please Log in or Create an account to join the conversation.

  • Posts: 17
  • Thank you received: 0
13 years 5 months ago #17488

It works! (obiousvly)

Thanks a lot for the mini html lesson nicolas! :P

Please Log in or Create an account to join the conversation.

Time to create page: 0.063 seconds
Powered by Kunena Forum