Skip to content

Commit d56c256

Browse files
committed
Docs: Document cart tag parameters
1 parent 51181c3 commit d56c256

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

docs/frontend/tags/cart.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,19 @@ When possible, Cargo will automatically inject a hidden `product` input when it
163163
<input type="hidden" name="product" value="{{ page:id }}">
164164
```
165165

166+
### Parameters
167+
This tag supports the following parameters:
168+
169+
@blade
170+
<x-tag-parameters
171+
:parameters="[
172+
['key' => 'redirect', 'type' => 'string', 'description' => 'The URL the user will be taken to after submitting the form. If left blank, the user will stay on the same page.'],
173+
['key' => 'error_redirect', 'type' => 'string', 'description' => 'The URL the user will be taken to after a failed form submission. If left blank, the user will stay on the same page.'],
174+
['key' => 'request', 'type' => 'string', 'description' => 'The name or fully qualified classname of the [form request](https://laravel.com/docs/master/validation#creating-form-requests) that should be used to validate the form submission. For example: `AddToCartRequest` will map to `App\Http\Requests\AddToCartRequest`.'],
175+
]"
176+
/>
177+
@endblade
178+
166179
### Fields
167180
This form supports the following fields:
168181

@@ -213,6 +226,21 @@ This tag allows you to update a line item in the customer's cart. You can either
213226

214227
Inside the `{{ cart:update_line_item }}` tag, you have access to the line item's data, allowing you to pre-fill values.
215228

229+
### Parameters
230+
This tag supports the following parameters:
231+
232+
@blade
233+
<x-tag-parameters
234+
:parameters="[
235+
['key' => 'product', 'type' => 'string', 'required' => true, 'description' => 'The ID of the product you wish to update. Required when `line_item` isn\'t present.'],
236+
['key' => 'line_item', 'type' => 'string', 'required' => true, 'description' => 'The ID of the line item you wish to update. Required when `product` isn\'t present.'],
237+
['key' => 'redirect', 'type' => 'string', 'description' => 'The URL the user will be taken to after submitting the form. If left blank, the user will stay on the same page.'],
238+
['key' => 'error_redirect', 'type' => 'string', 'description' => 'The URL the user will be taken to after a failed form submission. If left blank, the user will stay on the same page.'],
239+
['key' => 'request', 'type' => 'string', 'description' => 'The name or fully qualified classname of the [form request](https://laravel.com/docs/master/validation#creating-form-requests) that should be used to validate the form submission. For example: `AddToCartRequest` will map to `App\Http\Requests\AddToCartRequest`.'],
240+
]"
241+
/>
242+
@endblade
243+
216244
### Fields
217245
This form supports the following fields:
218246

@@ -300,6 +328,19 @@ This tag allows you to update the customer's cart. Allowing you to update everyt
300328

301329
Inside the `{{ cart:update }}` tag, you have access to the cart's data, allowing you to pre-fill values.
302330

331+
### Parameters
332+
This tag supports the following parameters:
333+
334+
@blade
335+
<x-tag-parameters
336+
:parameters="[
337+
['key' => 'redirect', 'type' => 'string', 'description' => 'The URL the user will be taken to after submitting the form. If left blank, the user will stay on the same page.'],
338+
['key' => 'error_redirect', 'type' => 'string', 'description' => 'The URL the user will be taken to after a failed form submission. If left blank, the user will stay on the same page.'],
339+
['key' => 'request', 'type' => 'string', 'description' => 'The name or fully qualified classname of the [form request](https://laravel.com/docs/master/validation#creating-form-requests) that should be used to validate the form submission. For example: `AddToCartRequest` will map to `App\Http\Requests\AddToCartRequest`.'],
340+
]"
341+
/>
342+
@endblade
343+
303344
### Fields
304345
This form supports the following fields:
305346

0 commit comments

Comments
 (0)