Level 10
Which exactly not work? Which error occurs?
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>
Please or to participate in this conversation.