WooCommerce ESW: differenze tra le versioni
| Riga 53: | Riga 53: | ||
# Copy xdebug.ini to /usr/local/etc/php/conf.d/ | # Copy xdebug.ini to /usr/local/etc/php/conf.d/ | ||
COPY ./*.ini /usr/local/etc/php/conf.d/ | COPY ./*.ini /usr/local/etc/php/conf.d/ | ||
</syntaxhighlight> | |||
Ecco il '''devcontainer.json''' | |||
<syntaxighlight lang="json"> | |||
{ | |||
"name": "Designbest Commerce ESW", | |||
// Update the 'dockerComposeFile' list if you have more compose files or use different names. | |||
// The .devcontainer/docker-compose.yml file contains any overrides you need/want to make. | |||
"dockerComposeFile": [ | |||
"../docker-compose.yml" | |||
], | |||
// The 'service' property is the name of the service for the container that VS Code should | |||
// use. Update this value and .devcontainer/docker-compose.yml to the real service name. | |||
"service": "wordpress", | |||
// The optional 'workspaceFolder' property is the path VS Code should open by default when | |||
// connected. This is typically a file mount in .devcontainer/docker-compose.yml | |||
"workspaceFolder": "/var/www/html", | |||
// Add the IDs of extensions you want installed when the container is created. | |||
"extensions": ["xdebug.php-pack", "xdebug.php-debug", "bmewburn.vscode-intelephense-client"], | |||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | |||
"forwardPorts": [8000] | |||
} | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Versione delle 15:21, 23 giu 2022
WooCommerce ESW
Il progetto prevede la creazione di un mini-sito con commerce integrato con Easy Store Web.
Ambiente di lavoro
Container
Abbiamo optato per un docker container così strutturato
docker-compose.yml
version: '3.9'
services:
db:
image: mysql:5.7
ports:
- 3306:3306
environment:
MYSQL_DATABASE: webmobili
MYSQL_USER: webmobili
MYSQL_PASSWORD: w3bm0b1l1
MYSQL_ROOT_PASSWORD: w3bm0b1l1
volumes:
- db:/var/lib/mysql
wordpress:
depends_on:
- db
build:
context: ./
ports:
- 8000:80
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: webmobili
WORDPRESS_DB_PASSWORD: w3bm0b1l1
WORDPRESS_DB_NAME: webmobili
WORDPRESS_DEBUG: 1
TZ: "Europe/Rome"
volumes:
- wordpress:/var/www/html
volumes:
db:
wordpress:
Punta al seguente Dockerfile che si occupa di configurare xdebug per PHP.
FROM wordpress:6.0.0-php7.4-apache
RUN apt-get update && \
pecl install xdebug \
&& docker-php-ext-enable xdebug
# Copy xdebug.ini to /usr/local/etc/php/conf.d/
COPY ./*.ini /usr/local/etc/php/conf.d/
Ecco il devcontainer.json <syntaxighlight lang="json"> { "name": "Designbest Commerce ESW",
// Update the 'dockerComposeFile' list if you have more compose files or use different names. // The .devcontainer/docker-compose.yml file contains any overrides you need/want to make. "dockerComposeFile": [ "../docker-compose.yml" ],
// The 'service' property is the name of the service for the container that VS Code should // use. Update this value and .devcontainer/docker-compose.yml to the real service name. "service": "wordpress",
// The optional 'workspaceFolder' property is the path VS Code should open by default when // connected. This is typically a file mount in .devcontainer/docker-compose.yml "workspaceFolder": "/var/www/html",
// Add the IDs of extensions you want installed when the container is created. "extensions": ["xdebug.php-pack", "xdebug.php-debug", "bmewburn.vscode-intelephense-client"],
// Use 'forwardPorts' to make a list of ports inside the container available locally. "forwardPorts": [8000] } </syntaxhighlight>
Visual Studio
Cliccare sul pulsante Run & Debug e farsi creare in automatico il file .vscode/laung.json per abilitare xdebug.
Wordpress Admin
- Aggiornare l'aggiornabile
- Installare il plugin WooCommerce
- Installare il tema Astra
- Aspetto => Opzioni Astra => spalla dx => Installa Plugin Importatore
- Da questa pagina installare il template (scegliendo Elementor) Custom Printing con tutti i suoi contenuti
- Installare il plugin Classic Widget