Skip to content

Instantly share code, notes, and snippets.

View YitziG's full-sized avatar
💾
Hi!

Yitzi G YitziG

💾
Hi!
View GitHub Profile
// To debug this code, open wixDefaultCustomElement.js in Developer Tools.
const IMAGE_URL = 'https://wix.to/vUBXBKU';
const H2_TEXT = 'This is a Custom Element';
const H3_1_TEXT = 'View its code by clicking the Settings button and pasting the Server URL into a new browser tab.';
const H3_2_TEXT = 'Explore this code and use it as a reference to create your own element.';
const DEBUG_TEXT = 'Loading the code for Custom Element \'wix-default-custom-element\'. To debug this code, open wixDefaultCustomElement.js in Developer Tools.';
const createImage = () => {
const imageElement = document.createElement('img');

Wix Headless in action: A WhatsApp chatbot

To demonstrate how the Wix Headless API can be used, I've developed a WhatsApp chatbot that integrates with a Wix store, allowing customers to browse products, add items to their cart, and proceed to checkout - all within WhatsApp.

The chatbot uses the Wix Headless API, to communicate with the Wix store to fetch product information, manage the shopping cart, and handle the checkout process. Any changes made to the store, such as adding new products or adjusting prices, are automatically reflected in the chatbot.

The code for the chatbot can be found at https://github.com/YitziG/wa-store.

Key Components

#include <FastLED.h>
#define NUM_LEDS 10
#define DATA_PIN 2
CRGB leds[NUM_LEDS];
void setup() {
Serial.begin(9600);
FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
@YitziG
YitziG / MainActivity.java
Created March 19, 2018 16:05
improved app
package com.example.yitzi.mathapp;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;
public class MainActivity extends AppCompatActivity {
@YitziG
YitziG / MainActivity.java
Created March 16, 2018 07:40
Code for session 3
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@YitziG
YitziG / MainAtivity.java
Created March 12, 2018 19:59
the xml layout and Java code for our app
package com.example.yitzi.myapplication;
import android.content.Context;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;