gcartバリエーション機能

problems

  • 特定のアクションで画面真っ白問題発生

done

  • モデルにHABTMの指定を複数書くときは配列でつなげる <ちょっとはまったりしてorz
    var $hasAndBelongsToMany = array(
        'Category' => array(
            'className' => 'Category',
            'joinTable' => 'categories_products',
            'foreignKey' => 'product_id',
            'associationForeignKey' => 'category_id'),
        
        'Variation' => array(
            'className' => 'Variation',
            'joinTable' => 'products_variations',
            'foreignKey' => 'product_id',
            'associationForeignKey' => 'variation_id'));

todo

  • products/editに以下のオペレーションを仕込む
    • 商品編集画面内で2種類のバリエーション入力欄がある
    • optionsは改行区切りのテキスト
    • 保存時にはsave内容をうまく作り込む
      • scaffoldのコードを読み解くのは時間がかかるからやめとく
  • keihin(...)/viewに以下のオペレーションを仕込む
    • 選ばれたバリエーション情報をセッション保存
  • basketコントローラーの決済時に選ばれたバリエーションを出力する
  • Variationsの中身を編集することはほとんどないのでscaffoldでよいことにする

spec