0

I'm developing an e-commerce website.

I have 3 tables

  1. Products (id, name, subcategory_id)
  2. colors_products(id, color_id, product_id)
  3. Colors (id, name)

in my add product form (add.ctp):

<?php echo $this->Form->input('Color', array('multiple'=>'checkbox'));?>

I want the checkbox list in horizontal, not vertical. someone please help.

batrisya
  • 7
  • 1
  • 7
  • You answered your own question - you want a HABTM relationship. The doco is here: http://book.cakephp.org/2.0/en/models/associations-linking-models-together.html#hasandbelongstomany-habtm Try that out, then if you have issues, come back with the specific problems you're having, and how you've tried to resolve them. – joshua.paling Oct 21 '13 at 06:56
  • in add.ctp, I want it to automatically shows attribute that related to that subcategory only (ex: S, M, L. XL - shirt size) when i choose subcategoriy - Women Shirt (from dropdown list). Now, it showing all the attributes (including the shoe size, book author) – batrisya Oct 21 '13 at 07:26
  • Post a screenshot of what you've got so far – joshua.paling Oct 21 '13 at 08:40

0 Answers0