Hi Jerome,
Again I need your help and advice.
I try implement call-system as you name it.
- into product I have added file "#hikaserial:valentina:licenses.zip"
- and I was able to see letter with LINK
- then I click it and get trigger onBeforeSerialDownloadFile() called.
- then our code produces correct license file after parsing of our pseudo-serial, I see it on disk
But final step -- return that file to HikaShop so download start -- NOT WORKS
This is simplified a little code of function which I try ...
as you can see in comment, my function returns full path to generated file.
I assign it into $filename. I have try to assign it into $file->file_path also ...
But I still get page "Brand Listing" with message FILE NOT FOUND.
May be problem comes from Mac OS X?
I develop this under Mac OS X and MAMP....
Main site will be on Linux ...
public function onBeforeSerialDownloadFile( &$filename, &$do, &$file, &$serials )
{
// We take serial and split it:
$serial = $serials[0];
$parts = explode( ";", $serial->serial_data );
$filename = create_license_for_vserver_free( $parts, $file );
// now $filename is "/tmp/Ruslan Zasukhin/license_win_4430337204584841"
// Also I have try to add this:
$file->file_path = $filename;
$file->file_name = $fileName; // full path or only file name. Both tested.
}
Here in docs
www.hikashop.com/support/documentation/6...onBeforeDownloadFile
it is said that
onBeforeDownloadFile(&$filename,&$do,&$file)
This function will be triggered by HikaShop before a file download. $filename is the path to the file, you can change it's value. $do allows you to cancel the download if you set it to false, and $file is an object containing the information about the file.
** So I guess that it is okay that I change original license.zip to generated name license_win_4430337204584841 ?
** Also I wonder. In plugin AttachSerial I did not find line of code, which changes $filename. I see only code which attaches image to letter...
** Also I wonder ... in such call-system, assume it works ...
I return file, download starts ... WHO later and how will trash this file from disk?