Routing

Vanilo Cloud offers a few typical routes out of the box, ie URLs that retrieve specific data and render certain views from your Shop Repository.

List of Routes

URL Path Example URLs HTTP Method Route Name View
/ myshop.com GET shop.home home{.blade.php | twig}
Account
/u/account myshop.com/u/account GET shop.account.overview account/overview{.blade.php | twig}
/u/address myshop.com/u/address GET shop.account.address.index account/address/index{.blade.php | twig}
/u/address myshop.com/u/address POST shop.account.address.store redirects to the account/address/index
/u/address/create?type= myshop.com/u/address/create?type=billing
u/address/create?type=shipping
GET shop.account.address.create account/address/create{.blade.php | twig}
/u/address/{address} myshop.com/u/address/1 GET shop.account.address.show account/address/show{.blade.php | twig}
/u/address/{address} myshop.com/u/address/1 PUT shop.account.address.update redirects to the account/address/index
/u/address/{address} myshop.com/u/address/1 DELETE shop.account.address.destroy redirects to the account/address/index
/u/address/{id}/edit myshop.com/u/address/1/edit GET shop.account.address.edit account/address/edit{.blade.php | twig}
/u/orders myshop.com/u/orders GET shop.account.orders account/orders{.blade.php | twig}
/u/orders/{order} myshop.com/u/orders/{id} GET shop.account.order.show account/order{.blade.php | twig}
/u/security myshop.com/u/security GET shop.account.security account/security{.blade.php | twig}
Auth
/u/register myshop.com/u/register GET shop.register auth/register{.blade.php | twig}
/u/register myshop.com/u/register POST shop.register.submit redirects to the account/overview
/u/login myshop.com/u/login GET shop.login auth/login{.blade.php | twig}
/u/login myshop.com/u/login POST shop.login.submit redirects to the account/overview
/u/logout myshop.com/u/logout POST shop.logout redirects to home
/u/password/forgot myshop.com/u/password/forgot GET shop.password.forgot.show auth/forgot_password{.blade.php | twig}
/u/password/reset/{token} myshop.com/u/password/reset/{token} GET shop.password.reset.show auth/reset_password{.blade.php | twig}
/u/email/verification myshop.com/u/email/verification GET shop.password.verification.show auth/verify{.blade.php | twig}
/u/email/verification/send myshop.com/u/email/verification POST shop.password.verification.send returns back with a message
/u/email/verification/{id}/{hash} myshop.com/u/email/verification/1/{token} GET shop.password.verification.verify auth/verify{.blade.php | twig}
Cart
/cart myshop.com/cart GET shop.cart.show cart/show{.blade.php | twig}
/cart/update/{cartItem} myshop.com/cart POST shop.cart.update redirects to the cart/show
/cart/v/{masterProductVariant} myshop.com/cart/v/3 POST shop.cart.add-variant redirects to the cart/show
/cart/{product} myshop.com/cart/1 POST shop.cart.add redirects to the cart/show
/remove/{cartItem} myshop.com/cart POST shop.cart.delete redirects to the cart/show
Checkout
/checkout myshop.com/checkout GET shop.checkout.show checkout/show{.blade.php | twig}
/checkout myshop.com/checkout POST shop.checkout.submit checkout/thankyou{.blade.php | twig} (success)
/checkout myshop.com/checkout POST shop.checkout.submit checkout/failed{.blade.php | twig} (error)
Info
/info/{slug} myshop.com/info/terms-and-conditions
myshop.com/info/return-policy
GET info info/$slug{.blade.php | twig}
Products
/p myshop.com/p
myshop.com/p?color=red&doors=2
GET shop.product.index product/index{.blade.php | twig}
/p/{slug} myshop.com/p/ducati-monster-2021 GET shop.product.show product/show{.blade.php | twig}
/s myshop.com/s?q=samsung GET shop.search search/result{.blade.php | twig}
Taxon
/c/{taxonomy}/{parent}/{taxon} myshop.com/c/category/phones/feature
myshop.com/c/regions/bordeaux/st-julien
GET shop.taxon.show.with-parent taxon/show{.blade.php | twig}
/c/{taxonomy}/{taxon} myshop.com/c/category/phones
myshop.com/c/brand/samsung
GET shop.taxon.show taxon/show{.blade.php | twig}
Taxonomy
/t myshop.com/t GET shop.taxonomy.index taxonomy/index{.blade.php | twig}
/t/{taxonomy} myshop.com/t/categories
myshop.com/t/wine-regions
GET shop.taxonomy.show taxonomy/show{.blade.php | twig}
Payments
_vnlpay/mollie/return/{paymentId} myshop.com/_vnlpay/mollie/return/{paymentId} GET payment.mollie.return payment/gateway_return{.blade.php | twig}
_vnlpay/mollie/webhook POST payment.mollie.webhook
_vnlpay/netopia/return myshop.com/_vnlpay/netopia/return GET payment.netopia.return payment/gateway_return{.blade.php | twig}
_vnlpay/netopia/confirm POST payment.netopia.confirm

Route Input & Output

Each specific route accepts specific input (parameters, queries or HTTP payload) and offers a specific output like rendering a view with variables injected or redirecting to another URL.

Account

The account includes several pages that are only accessible for logged in shoppers. This area is intended for the shopper to maintain their data and see the list of their orders.

Create Address

This route handles storing a new address for the authenticated user. It creates an address using the provided data, and then redirects to the address index page.

Route Path: /u/address
HTTP Method: POST
Route Name: shop.account.address.store
Payload - Form Data

The rules for creating or updating an address are the same.
The endpoint accepts x-www-form-urlencoded payloads

Name Rules Required Accepts NULL Description
name required_without:firstname | string | max:255 ? Required if firstname is not present. Must be a string with max 255 characters
firstname required_without:name | string | max:255 ? Required if name is not present. Must be a string with max 255 characters
lastname string | max:255 Must be a string with max 255 characters
company_name string | max:255 Must be a string with max 255 characters
email email | max:255 Must be a valid email address with max 255 characters
phone string | max:255 Must be a string with max 255 characters
tax_nr max:255 Must have a max length of 255 characters
registration_nr string | max:255 Must be a string with max 255 characters
country_id required | string | size:2 | exists:countries,id * Must be a string with exactly 2 characters that exists in the countries
province_id integer | exists:provinces,id The value must be an integer that matches an ID present in the provinces data set.
type required * Must be one of the specified values (BILLING or SHIPPING)
city string | max:255 Must be a string with max 255 characters
postalcode string | max:12 Must be a string with max 12 characters
address required | string | max:255 * Must be a string with max 255 characters
address2 string | max:255 Must be a string with max 255 characters
access_code string | max:255 Must be a string with max 255 characters

Auth

The auth area consists of several pages that are available for non-authenticated shoppers, for registration, login and password reset.

User Registration

This route handles the registration of a new user. It collects and validates user information, and creates a new user account.

URL Path: /u/register
HTTP Method: POST
Route Name: shop.register.submit
Payload - Form Data

Note: Rules that can be overridden may be customized in your shop's configuration.

Name Rules Required Accepts NULL Description Overridable
name string | min:5 | max:255 * Must be a string between 5 and 255 characters long. yes
email string | email | max:255 | unique:users * Must be a string that is a valid email address, up to 255 characters long, and unique among users. yes
code nullable Can be omitted or set to null. yes
password string | min:6 | confirmed * Must be a string at least 6 characters long and another field named password_confirmation must be submitted with the same value. yes

User Login

This route manages user login. It collects and validates user credentials, such as email and password, to authenticate the user. Upon successful authentication, it establishes a session for the user and redirects them to a designated page or dashboard.

See the Redirect URLs for more details

URL Path: /u/login
HTTP Method: POST
Route Name: shop.login.submit
Payload - Form Data
Name Rules Required Description
email email * Must be a valid email address.
password string * Must be a string, typically used for user authentication.

Cart

This route displays the contents of the user's shopping cart. It provides a view where users can see the items they have added, adjust quantities, and view the cart summary.

Show Cart

This page is available at the GET /cart URL. If the cart is empty a warning message will be shown saying that products need to be added to the cart.

URL Path: /cart
HTTP Method: GET
Route Name: shop.cart.show
View: cart/show{.blade.php|twig}

Add Product to Cart

This route allows users to add a product to their shopping cart. The route parameter {product} represents the ID of the product.

URL Path: /cart/{product}
HTTP Method: POST
Route Name: shop.cart.add
Payload - Form Data
Name Rules Accepts NULL Description Default
qty int The quantity of the selected product 1
configuration array | min:0 An optional array containing the configuration of the item null

Update Cart Item

The Update Cart Item route allows users to modify the quantity of an item that is already in their cart. The route parameter {cartItem} represents the ID of the item.

URL Path: /cart/update/{cartItem}
HTTP Method: POST
Route Name: shop.cart.update   
Payload - Form Data
Name Rules Description Default
qty int The quantity of the selected item 1

Delete Cart Item

The Delete Cart Item route allows users to remove a specific item from their shopping cart.

The route parameter {cartItem} represents the ID of the item.

URL Path: /remove/{cartItem}
HTTP Method: POST
Route Name: shop.cart.delete

Categorization

Routes for managing and displaying product categories, taxonomies, and their associated products.

Show Taxon

This route displays the products associated with a specific taxon (category or brand). It shows a list of products, the taxon name, and an optional banner image if available.

URL Path: /c/{taxonomy-slug}/{taxon-slug}
HTTP Method: GET
Route Name: shop.taxon.show
View: taxon/show{.blade.php|twig}

It is possible to filter the list of products within taxon using their properties. Each property has a unique slug (e.g., color, size, brand). The filter values are passed as an array for each property.
To filter based on properties pass query parameters to the URL in format: /c/taxonomy/taxon?propertySlug[]=value1&propertySlug[]=value2

Example: /c/categories/smarpthones?color[]=red&color[]=blue&size[]=medium&brand[]=nike

Show Taxon with Parent

This route is similar to "Show Taxon" but includes a parent taxon in the URL path. This is useful for nested taxonomies.

URL Path: /c/{taxonomy-slug}/{parent-taxon-slug}/{taxon-slug}
HTTP Method: GET
Route Name: shop.taxon.show.with-parent
View: taxon/show{.blade.php|twig}

It is possible to filter the list of products within taxonomy using their properties. Each property has a unique slug (e.g., color, size, brand). The filter values are passed as an array for each property.
To filter based on properties pass query parameters to the URL in format: /c/taxonomy/parent/taxon?propertySlug[]=value1&propertySlug[]=value2

Example: /c/categories/smartphones/ios?color[]=red&color[]=blue&size[]=medium&brand[]=nike

List of Taxonomies

This route displays a list of all available taxonomies. Taxonomies are categories or classification systems used to organize products on the site.

URL Path: /t
HTTP Method: GET
Route Name: shop.taxonomy.index
View: taxonomy/index{.blade.php|twig}

Show a Single Taxonomy

This route displays a specific taxonomy and provides an interface to manage its taxons (categories within the taxonomy). Users with the necessary permissions can view, add, or delete taxons in the taxonomy tree. The page also includes media management for the taxonomy.

URL Path: /t/{taxonomy-slug}
HTTP Method: GET
Route Name: shop.taxonomy.show
View: taxonomy/show{.blade.php|twig}

Checkout

The checkout consists of several pages, for data collection and validation, successful and failed checkout pages.

Show Checkout

The Show Checkout route displays the order details and the checkout form where users can enter their billing information and review their cart before completing the purchase.

URL Path: /checkout
HTTP Method: GET
Route Name: shop.checkout.show
View: checkout/show{.blade.php|twig}

Submit Checkout

The Submit Checkout functionality handles the completion of the checkout process. Users either receive a confirmation of their order or are informed of issues that prevent the order from being processed.

Route Path: /checkout
HTTP Method: POST
Route Name: shop.checkout.submit
View: checkout/thankyou{.blade.php|twig}
      checkout/failed{.blade.php|twig}
Payload - Form Data

Note: Rules that can be overridden may be customized in your shop's configuration.

Name Rules Required Accepts NULL Description Overridable
billpayer.email email * must be a valid email address yes
billpayer.phone min:4 | max:22 If present, must be between 4 and 22 characters long yes
billpayer.firstname min:2 | max:255 * must be between 2 and 255 characters long. yes
billpayer.lastname min:2 | max:255 * must be between 2 and 255 characters long. yes
billpayer.company_name min:5 ? Required only if billpayer.is_organization is true and must be at least 5 characters long if present. yes
billpayer.tax_nr min:5 If present, must be at least 5 characters long. yes
billpayer.address.address min:12 | max:384 * must be between 12 and 384 characters long. yes
billpayer.address.address2 max:255 If present, must be up to 255 characters long. no
billpayer.address.postalcode min:4 | max:12 If present, must be between 4 and 12 characters long. yes
billpayer.address.city min:2 | max:255 If present, must be between 2 and 255 characters long. yes
billpayer.address.country_id alpha:ascii | size:2 * must be a 2-character country code and pass the BillingCountryRule validation. no
shippingAddress.address string ? Required field unless no_shipping or ship_to_billing_address is true. yes
shippingAddress.address2 max:255 If present, must be up to 255 characters long. no
shippingAddress.postalcode min:4 | max:12 If present, must be between 4 and 12 characters long. yes
shippingAddress.city min:2 | max:255 If present, must be between 2 and 255 characters long. yes
shippingAddress.country_id alpha:ascii | size:2 ? Required field unless ship_to_billing_address is true. Must be a 2 char country code and passs the ShippingCountryRule validation. no
payment_method_id integer | exists:payment_methods,id If present, it must be the id of an existing payment method. yes
shipping_method_id integer | exists:shipping_methods,id If present, it must be the id of an existing shipping method. yes
channel alpha_dash:ascii | max:255 | exists:channels,slug If present, must be the slug of an existing channel; alphanumeric string with dashes, up to 255 characters. no
ship_to_billing_address boolean If present, must be a boolean. As a result, the billing address will be used as the shipping address. no
no_shipping boolean If present, must be a boolean value. As a result the order will be created without a shipping address and features. no
should_register boolean If present, must be a boolean value. As a result, a shopper user will be created from the checkout data. no
password string If should_register is true, this field is required and another field named password_confirmation must be submitted with the same value. no
BillingCountryRule

If the billing is unrestricted then the field is optional and defaults to the default country set in admin at Settings or at the Channel.
If submitted, then the value must be a valid 2-letter ISO country code e.g.: "US".
If the billing is restricted then the backend will only accept one of the allowed country IDs, 2-letter ISO format, e.g. "NL"

ShippingCountryRule

The shipping country field is mandatory unless the ship_to_billing_address field is true, in that case the billing country will be validated. If submitted, then the value must be a valid 2-letter ISO country code e.g.: "US".
If shipping is restricted then the country must be one of the allowed shipping countries.

Info Pages (Custom Content)

This page allows you to display static content that can be customized by creating template files in the resources/views/info/ (blade) or in the resources/twig/info (twig) folder. Each template file corresponds to a different info page and is accessible via a URL path based on the file name. For example, the about-us.blade.php file would be accessible at /info/about-us, or the return-policy.twig is accessible at the /info/return-policy URL.

URL Path: /info/{slug}
HTTP Method: GET
Route Name: info
View: info/$slug{.blade.php|twig}

Payment

The payment routes processes the payment information and displays the appropriate view indicating the result of the payment.

Mollie

This route handles the return of a payment from Mollie.

URL Path: _vnlpay/mollie/return/{paymentId}
HTTP Method: GET
Route Name: payment.mollie.return
View: payment/gateway_return{.blade.php|twig}

Netopia

This route handles the return of a payment from Netopia.

URL Path: _vnlpay/netopia/return?orderId=xyz123
HTTP Method: GET
Route Name: payment.netopia.return
View: payment/gateway_return{.blade.php|twig}

Products

The product-related routes offer an overview of the products and include options to add new products or master products.

List of Products

This route displays a list of products available in the shop. Pagination is included for better navigation through the product list.

This route displays all the active products in your shop, therefore it is seldom used. It makes sense for shops with a few products, but if there's no product/index template defined in your shop, then this route will return 404, ie. it can be disabled.

URL Path: /p
HTTP Method: GET
Route Name: shop.product.index
View: product/index{.blade.php|twig}

It is possible to filter the list of products using their properties. Each property has a unique slug (e.g., color, size, brand). The filter values are passed as an array for each property.
To filter based on properties pass query parameters to the URL in format: /p?propertySlug[]=value1&propertySlug[]=value2

Example: /p?color[]=red&color[]=blue&size[]=medium&brand[]=nike

Show a Single Product

This route displays detailed information about a specific product, including its status, SKU, sales data, associated categories and properties, as well as media and links related to the product.

URL Path: /p/{slug}
HTTP Method: GET
Route Name: shop.product.show
View: product/show{.blade.php|twig}

Search Products

The search page allows shoppers to search the products of the shop.

To pass the search term entered by the users, it can be passed with the q query parameter, eg.: my.shop/?q=red+dog+food+plates

The return result will display the products matching the user's query along with the total number of results found. It also includes filter options to further refine the displayed products based on various attributes.

Route Path: /s?q=the+search+term
HTTP Method: GET
Route Name: shop.search
View: search/result{.blade.php|twig}

To filter the search results, pass properties and values as query parameters.

Each property has a unique slug (e.g., color, size, brand). The filter values are passed as an array for each property.
To filter based on properties pass query parameters to the URL in format: /s?q=search-tearm&propertySlug[]=value1&propertySlug[]=value2

Example: /s?q=iphone+11&color[]=red&color[]=blue&size[]=medium