woocommerce-pagarme
woocommerce-pagarme copied to clipboard
Bug when using dotenv
Hello, I would like to report a possible bug when using dotenv
in our projects.
How to simulate
Install dotenv(composer require vlucas/phpdotenv) in the WordPress project root, and in the wp-config.php file add the following line :point_down:
// wp-config.php
<?php
...
require_once(__DIR__ . '/../vendor/autoload.php');
...
How to fix
In the woo-pagarme-payments.php
file the following change worked
// .../pagarme-payments-for-woocommerce/woo-pagarme-payments.php line 71
function _wcmp_load_instances()
{
// before require_once 'vendor/autoload.php';
require_once __DIR__ . '/vendor/autoload.php';