将以下代码放入控制器后出现错误

时间:2018-05-28 15:27:57

标签: php opencart opencart2.x opencart-module opencart-3

我正在尝试在Opencart中创建多卖家模块...一切都很好但是当我试图回应这个类别时我得到了空白页... 模型看起来很完美但是,我在控制器文件中确实没什么混乱......我只是粘贴了控制器下面的代码。

$seller_product_total = $this->model_sellerprofile_sellerprofile->getTotalProducts();

    $results = $this->model_sellerprofile_sellerprofile->getSellerGroups($filter_data);

    foreach ($results as $result) {
        $data['seller_groups'][] = array(
            'seller_group_id' => $result['seller_group_id'],
            'seller_categories' => $this->model_sellerproduct_category->getCategories(''),
            'name' => $result['name'],
            'sort_order' => $result['sort_order'],
            'description' => $result['description'],
            'product_limit' => ($result['product_limit'] != "0") ? $result['product_limit'] :  $this->language->get('text_unlimited') ,
            'text_subscription_duration' => sprintf($this->language->get('text_subscription_duration'), $result['subscription_duration']),
            'subscription_price' => $this->currency->format($result['subscription_price'], $this->session->data['currency']),
            'subscription_duration' => $result['subscription_duration'],
            'commission' => $this->currency->format($result['commission'], $this->session->data['currency']).' + '.$result['fee']."%",
            'categories' => $this->model_sellerproduct_category->getsellergroupCategoriesByGroupId($result['seller_group_id']),



            );
    }

和twig文件如下

<td class="left">
    <div id="seller-group-category" class="well well-sm" style="height: 150px; overflow: auto;">
     {% if seller_group.categories is not empty %}
          {% for category in seller_group.seller_categories %}
               {% if category.category_id in seller_group.categories %}
                    <div><i class="fa fa-check"></i> {{ category.name }}</div>
                {% endif %}
           {% endfor %}
        {% else %}
           <div><i class="fa fa-check"></i>{{ entry_all_categories }}</div>
        {% endif %}
   </div>
</td>
<td class="left">
    {% if seller_group.categories is not empty %}
       <div class="scrollbox scrollbox{{ '-' .  seller_group.seller_group_id }}" style="border: 1px solid #CCCCCC; width: 350px; height: 150px; background: #FFFFFF; overflow-y: scroll;">
            {% for category in seller_group.seller_categories %}
                <div class="checkbox">
                     <label>
                        {% if category.category_id in seller_group.categories %}
                     <input type="checkbox" name="seller_category[]" value="{{ category.category_id }}" checked="checked" />
                            {{ category.name }}
                          {% else %}
                            <input type="checkbox" name="seller_category[]" value="{{ category.category_id }}" />
                            {{ category.name }}
                            {% endif %}
                          </label>
                        </div>
                  {% endfor %}
              </div>
         {% endif %}
    </td>

0 个答案:

没有答案