Skip to content

ealvarezdetoledo/ti-ext-tables

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Add table selection

Enables service to tables by adding a table endpoint and adding the value to a new order field.

Table url

Once installed a new location url is available in the format "$location/table/$id", e.g. /default/table/22. You should direct customers to this through the use of a QR code or visible URL on the table.

This information will be stored the session under the key "thoughtco.tables", which you can access within your templates as follows:

$tableData = Session::get('thoughtco.tables');
// ['location' => xxx, 'id' => xxx]

Amend templates

Edit your theme/partials/checkout/form.php file to include the table number, for example:

<?php if (($tableData = Session::get('thoughtco.tables')) && ($tableData['location'] == $location->getId()) && $order->isCollectionType()){ ?>
<input type="hidden" name="table_number" value="<?= $tableData['table'] ?>" />
<?php } ?>

This will populate the table_number field on a order, when it is present.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages