This component allows users write direct whatsapp messages. You can set image logo, telephone number, message and button size. The button has a fixed position on the bottom.
Access the VTEX IO basic setup guide and follow all the given steps.
By the end of the setup, you should have the VTEX command line interface (Toolbelt) installed along with a developer workspace you can work in.
Clone this repository to your local files to be able to effectively start working on it.
Then, access the repository's directory using your terminal.
Go to the manifest.json file and change the following values:
- Vendor
- Name
- Version (If it's different than example)
- Title
- Description
{
"vendor": "CHANGE_ME",
"name": "CHANGE_ME",
"version": "0.0.1",
"title": "YOUR TITLE",
"description": "YOUR DESCRIPTION",
"builders": {
"react": "3.x",
"messages": "1.x",
"docs": "0.x",
"store": "0.x"
}
}
We need to access the terminal and go to react
folder. Now we have to run Yarn
and install all required dependencies for this component.
Then time has come to upload all the changes you made in your local files to the platform. For that, use the vtex link
command.
If the process runs without any errors, the following message will be displayed: Sending local change event
.
This will enable you to see the applied changes in real time, through the account and workspace in which you are working.
- Adding the app as a theme dependency in the
manifest.json
file;
"dependencies": {
"itgloberspartnercl.whatsapp-button": "0.x"
}
- Declaring the app's main block in a given theme template or inside another block from the theme.
{
"responsive-layout.desktop#home__wp-button": {
"title": "Whatsapp Button",
"children": ["whatsapp-button"]
},
"whatsapp-button": {
"props": {
"logo": "assets/img/wp-icon.png",
"phone": "777777777",
"message": "VTEX ES LO MEJOR",
"width": 70,
"height": 70
}
}
}
By running vtex list
, you can verify if the app is linked. On your Linked Apps you must have
itgloberspartnercl.whatsapp-button 0.0.1
No CSS Handles are available yet for the app customization.
Thanks goes to these wonderful people:
- Hevert David Gelis Diaz