armancs's avatar

CSS not works in controller method

i used html in my controller method all css and bootstrap works fine with normal blade page but not works in function method.

  <form class="addtocart-form">';
                                if (Session::has('uniqueid')) {
                                    $res .= '<input type="hidden" name="uniqueid" value="' . Session::get('uniqueid') . '">';
                                } else {
                                    $res .= '<input type="hidden" name="uniqueid" value="' . str_random(7) . '">';
                                }

                                $res .= '
                                        <input name="title" value="' . $product->title . '" type="hidden">
                                        <input name="product" value="' . $product->id . '" type="hidden">
                                        <input id="cost" name="cost" value="' . Product::Cost($product->id) . '" type="hidden">
                                        <input id="quantity" name="quantity" value="1" type="hidden">';
                                if ($product->stock != 0){
                                    $res .='<button type="button" onclick="toCart(this)" class="addTo-cart to-cart"><i class="fa fa-cart-plus"></i><span>'.$language->add_to_cart.'</span></button>';
                                }else{
                                    $res .='<button type="button" class="out-of-stock to-cart" disabled><i class="fa fa-cart-plus"></i>'.$language->out_of_stock.'</button>';
                                }
                                $res .=' 
                                        
                                    </form>
0 likes
5 replies
Sykr's avatar

Which exactly not work? Which error occurs?

Vilfago's avatar

And we need to see the view and the controller, and how you pass data from one to another.

armancs's avatar

bootstrap classes and external css classes not works. @sy

armancs's avatar

Check this vie file @vi VIew File:

    @if(count($products) > 0)
                        <div class="row">
                            <div class="col-md-12 text-center">
                                <img id="load" src="{{url('/assets/images/default.gif')}}" style="display: none;width: 80px;">
                            </div>
                            <div class="col-md-12 text-center">
                                <input type="hidden" id="page" value="2">
                                <a href="javascript:;" id="load-more" class="product-filter-loadMore-btn">load more</a>
                            </div>
                        </div>
                        @endif

Please or to participate in this conversation.