Skip to content

Commit

Permalink
Init (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
BobWez98 authored Nov 15, 2022
1 parent 7e2031a commit 26415f7
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.phpunit.result.cache
/node_modules
/public
/vendor
composer.lock
phpunit.dusk.xml
phpunit.xml
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Rapidez Order comments
Implementation of the order comments in the Rapidez checkout.

## Installation
```
composer require rapidez/boldcommerce-order-comments
```

And include the javascript in `resources/js/app.js`:
```
require('Vendor/rapidez/order-comments/resources/js/order-comments')
```

Add the a textarea to your views in the checkout:
```
<x-rapidez::textarea
v-model="checkout.comment"
class="border-border"
name="comment"
{{ $attributes }}
/>
```

To display the order comment, usually in the checkout, you can use:
```
@{{ $root.checkout.comment }}
```
12 changes: 12 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "rapidez/boldcommerce-order-comments",
"require": {
"php": "^8.0.2"
},
"authors": [
{
"name": "Bob",
"email": "[email protected]"
}
]
}
11 changes: 11 additions & 0 deletions resources/js/order-comments.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
document.addEventListener('turbolinks:load', () => {
Vue.set(window.app.checkout, 'comment', '')

window.app.$on('checkout-credentials-saved', (e) => {
window.app.magentoCart('put', 'set-order-comment', {
orderComment: {
comment: window.app.checkout.comment
}
})
})
})

0 comments on commit 26415f7

Please sign in to comment.