M
M
marikm12019-02-21 01:19:44
PHP
marikm1, 2019-02-21 01:19:44

WooCommerce order status completed, but the client is not granted the rights to download the product?

I have a problem with the Wookomers plugin. I have a virtual download store.
Orders after payment by the client go to the status "Completed", and the rights to download along with the status "Completed" are not always provided. Therefore, no email is sent to the client with a download link.
For clarity, I shot a short video https://yadi.sk/i/2HhwgT8MleCRRA
The hoster writes that the problem is in the Wookomers plugin itself, and that there are no problems on their part.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
entermix, 2016-09-07
@Beefeater

Banned on google?
www.php.net/manual/ru/function.json-decode.php
UPD: Something like this:

$array = json_decode($src, true); // Декодируем

if (count($array['url']) > 0) {
    foreach ($array['url'] as $url) {
        if (file_exists($url['url'])) {
            
            $text = file_get_contents($url['url']); // Получаем файл в строку
            
            if (count($array['change']) > 0){
                foreach ($array['change'] as $change){
                    $text = str_replace($change['from'], $change['to'], $text); // Производим замену
                }
            }
            file_put_contents($url['url'], $new_text); // Записываем обратно в файл
            
        } else {
            echo 'File ' . $url['url'] . ' Not Found';
        }
    }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question