19 August 2019

Buy Now Buution in opencart by category id display

//          Controller         //

if (!isset($this->request->get['path'])) {
    $cat_id = $this->model_catalog_product->getCategory($product_id);
   // print_r($cat_id);
    $data['CatID'] = $cat_id['category_id'];
    $category_id=$cat_id['category_id'];
    $main_cat_id = $this->model_catalog_product->getMainCategory($category_id);
   // $data['main_cat_id']=$main_cat_id['parent_id'];
}

//          View        //

  {% if CatID == 80 %}
                                        <button type="button" onclick="login()" id="button-cart-1" data-loading-text="{{ text_loading }}" class="btn_cart by-nw">Buy Now</button>
                                        {% endif %}