# WOO COMMERCE

LayUp payment gateway plugin for woo-commerce

### Build

This is a php project and does not currently have a build process.

### Unit Tests

No test suite exists currently.

### Local Stack

This guide uses docker. You can optionally try wplocal.

1. Start up wordpress and mysql: `docker compose up -d`
2. Open http://localhost:8000 and complete config steps
3. Search, install and enable `WooCommerce` plugin first
4. Make sure `WooCommerce` plugin is enabled before you enable `WooCommerce LayUp Payment Gateway` plugin

#### Troubleshooting

Make sure "Permalink structure" is set to "Post name" instead of "Plain".


### Deploy Manually

1. Add this section to your `~/.ssh/config` file
```
    Host woo-commerce
    HostName 34.246.176.246
    User ubuntu
    Port 22
    IdentityFile ~/.ssh/id_rsa
```
2. login to server via ssh `ssh woo-commerce`
3. use the root user `sudo -i`
4. go to the monorepo source folder `cd ~/layup/`
5. pull the monorepo `git pull`
6. sync the woo-commerce folders `rsync -avz --delete plugins/woo-commerce/ /var/www/html/woocommerce.layup.co.za/wp-content/plugins/woo-layup-payment-gateway/`
7. check that the deploy location, make sure your files deployed `cd /var/www/html/woocommerce.layup.co.za/wp-content/plugins/woo-layup-payment-gateway/`
8. check that the version number has increased on [layup woo-commerce](https://wordpress.org/plugins/woo-layup-payment-gateway/)

### Deploy

1. Increment the plugin version in the following files `readme.txt`, `layup-gateway.php` and `.github/workflows/deploy-woo-commerce.yml`
2. Make a new git tag that matches the version in the previous step

This plugin is deployed via a github action. This action pushes the code in this folder to `wordpress.org`.
After the deploy has completed, check [layup woo-commerce](https://wordpress.org/plugins/woo-layup-payment-gateway/)` and check if the version number has increased.