コード例 #1
0
ファイル: index.php プロジェクト: TrevorMW/SoftServer2.0
    ?>

      <div class="wrap main-body">
        <a href="#" data-flyout-trigger data-async-content="load_cart_count"><i class="fa fa-fw fa-shopping-cart"></i><?php 
    $cart->cart_item_count_string();
    ?>
</a>
        <div class="table" data-loader><div class="table-cell"><i class="fa fa-spin fa-cog"></i></div></div>
        <div class="wrapper table">
          <div class="table-cell">
            <header><h1>SoftServer</h1></header>
            <div class="active fadein" data-main-content data-updateable-content="order-form">
              <form data-ajax-form data-action="choose_product_type" data-target="order-form">
                <select data-ajax-select name="product_type">
                  <?php 
    echo Form_Helper::build_select_options($product_type->types, 'What can I get ya?');
    ?>
                </select>
              </form>
            </div>
          </div>
        </div>
      </div>
      <div class="wrap cart" data-flyout >
        <div class="wrapper cart-header">
          <h3>Your Cart</h3>
          <a href="#" data-destroy-flyout><i class="fa fa-fw fa-times"></i></a>
        </div>
        <div class="wrapper cart-body" data-async-content="load_cart_data" data-load-when="deferred" data-target="cart-contents">
          <?php 
    echo $cart->get_cart_contents();
コード例 #2
0
 /**
  * get_product_form_fields function.
  *
  * @access public
  * @param Product_Type $product_type
  * @return void
  */
 public function get_product_form_fields(Product_Type $product_type)
 {
     $fields = '';
     $ingredient = new Ingredient();
     if ($product_type->product_type_slug != null) {
         $ingredient->get_ingredients_by_type(1);
         switch ($product_type->product_type_slug) {
             case 'cone':
                 $ingredients = $ingredient->get_ingredients_by_type(4);
                 unset($ingredients[18]);
                 $fields .= '<input type="hidden" name="product_type" value="' . $product_type->product_type_id . '" />
                   <li>
                     <select name="ingredients[container]">
                     ' . Form_Helper::build_select_options($ingredients, 'Select a Cone Type') . '
                     </select>
                   </li>
                   <li>
                     <label>Scoop #1</label>
                     <select name="ingredients[ice_cream][]">
                     ' . Form_Helper::build_select_options($ingredient->get_ingredients_by_type(1), 'Select 1st Ice Cream Flavor') . '
                     </select>
                   </li>
                   <li>
                     <label>Scoop #2</label>
                     <select name="ingredients[ice_cream][]">
                     ' . Form_Helper::build_select_options($ingredient->get_ingredients_by_type(1), 'Select 2nd Ice Cream Flavor') . '
                     </select>
                   </li>';
                 //<li class="submit"><a href="#" data-ajax-get data-action="add_field" data-extra-data="ice_cream">Add Another Flavor!</a></li>
                 break;
             case 'milkshake':
                 $fields .= '<input type="hidden" name="product_type" value="' . $product_type->product_type_id . '" />
                   <li>
                     <h4>Use Promo Code DOLLAROFF for a discount!</h4>
                     <input type="hidden" name="ingredients[container]" value="18" />
                   </li>
                   <li>
                     <select name="ingredients[ice_cream]">
                     ' . Form_Helper::build_select_options($ingredient->get_ingredients_by_type(1), 'Select an Ice Cream Flavor') . '
                     </select>
                   </li>
                   <li>
                     <select name="ingredients[milk][]">
                     ' . Form_Helper::build_select_options($ingredient->get_ingredients_by_type(3), 'Select Milk Type') . '
                     </select>
                   </li>';
                 break;
             case 'float':
                 $fields .= '<input type="hidden" name="product_type" value="' . $product_type->product_type_id . '" />
                   <li>
                     <h4>Use Promo Code DOLLAROFF for a discount!</h4>
                     <input type="hidden" name="ingredients[container]" value="18" />
                   </li>
                   <li>
                     <select name="ingredients[soda][]">
                     ' . Form_Helper::build_select_options($ingredient->get_ingredients_by_type(2), 'Select a Soda') . '
                     </select>
                   </li>
                   <li>
                     <label>Scoop #1</label>
                     <select name="ingredients[ice_cream][]">
                     ' . Form_Helper::build_select_options($ingredient->get_ingredients_by_type(1), 'Select an Ice Cream Flavor') . '
                     </select>
                   </li>
                   <li class="submit"><a href="#" data-ajax-get data-action="add_field" data-extra-data="ice_cream">Add Another Flavor!</a></li>';
                 break;
         }
     }
     return $fields;
 }