attributes.blade.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. @if(!$productAttributes->isEmpty())
  2. <p class="alert alert-info">You can only set 1 default combination</p>
  3. <ul class="list-unstyled">
  4. <li>
  5. <table class="table">
  6. <thead>
  7. <tr>
  8. <th>ID</th>
  9. <th>Quantity</th>
  10. <th>Price</th>
  11. <th>Sale Price</th>
  12. <th>Attributes</th>
  13. <th>Is default?</th>
  14. <th>Remove</th>
  15. </tr>
  16. </thead>
  17. <tbody>
  18. @foreach($productAttributes as $pa)
  19. <tr>
  20. <td>{{ $pa->id }}</td>
  21. <td>{{ $pa->quantity }}</td>
  22. <td>{{ $pa->price }}</td>
  23. <td>{{ $pa->sale_price }}</td>
  24. <td>
  25. <ul class="list-unstyled">
  26. @foreach($pa->attributesValues as $item)
  27. <li>{{ $item->attribute->name }} : {{ $item->value }}</li>
  28. @endforeach
  29. </ul>
  30. </td>
  31. <td>
  32. @if($pa->default == 1)
  33. <button class="btn btn-success"><i class="fa fa-check"></i></button>
  34. @else
  35. <button class="btn btn-danger"><i class="fa fa-remove"></i></button>
  36. @endif
  37. </td>
  38. <td class="btn-group">
  39. <a
  40. onclick="return confirm('Are you sure?')"
  41. href="{{ route('admin.products.edit', [$product->id, 'combination' => 1, 'delete' => 1, 'pa' => $pa->id]) }}"
  42. class="btn btn-sm btn-danger">
  43. <i class="fa fa-trash"></i> Delete
  44. </a>
  45. </td>
  46. </tr>
  47. @endforeach
  48. </tbody>
  49. </table>
  50. </li>
  51. </ul>
  52. @else
  53. <p class="alert alert-warning">No combination yet.</p>
  54. @endif