Jump to content

Virtual product download email


be_tnt

Recommended Posts

Hello!

 

I have added a virtual product to my shop; I have seen that in mail folder, there is a download_products template. I have added the virtual product in my cart and paied for it but I did not receive the email with the link to download it. The link is only available in the customer area (which is not practical).

 

Is there something to do to be sure this mail with the link will be sent?

  • Like 1
Link to comment
Share on other sites

PS 1.5.3.1

 

Bug ...

 

Open and Edit file ../classes/order/OrderHistory.php

 

Replace :

            if ($virtual_products && (!$last_order_state || !$last_order_state->logable) && $new_order_state && $new_order_state->logable)

 

With :

            if ($virtual_products && (!$last_order_state || !$last_order_state->logable || ($last_order_state->id == $new_order_state->id) && $new_order_state && $new_order_state->logable))

Link to comment
Share on other sites

Bug ...

 

Open and Edit file ../classes/order/OrderHistory.php

 

Replace :

			if ($virtual_products && (!$last_order_state || !$last_order_state->logable) && $new_order_state && $new_order_state->logable)

 

With :

			if ($virtual_products && (!$last_order_state || !$last_order_state->logable || ($last_order_state->id == $new_order_state->id) && $new_order_state && $new_order_state->logable))

 

it kind of worked...

now when customer buys the product he gets the link before payment - that is not good

  • Like 1
Link to comment
Share on other sites

hmmm ... then this should be work but the status "Payment Accepted" should have id = 2

 

if ($virtual_products && ($last_order_state->id == 2))

 

AND Yes, you should overriden the function addWithemail.

 

Just add the new function addWithemail (the modified one)

OR

download the attached file and upload

into /override/classes/order/OrderHistory.php

OrderHistory.php

  • Like 1
Link to comment
Share on other sites

It did more terrible dmage to the rest of the shop I had to reinstall it.

http://www.prestashop.com/forums/topic/225400-white-screen-after-purchase/

 

When customer does the check out he get's the white screen. I used it ( http://www.prestashop.com/forums/topic/224525-how-to-get-debug-information-for-500-error-or-blank-page/page__p__1104709#entry1104709 ) to get the error description

[PrestaShopException]

Property OrderDetail->id_warehouse is empty
at line 837 in file classes/ObjectModel.php
831.
832. $message = $this->validateField($field, $this->$field);
833. if ($message !== true)
834. {
835. if ($die)
836. throw new PrestaShopException($message);
837. return $error_return ? $message : false;
838. }
839. }
840.
841. return true;
ObjectModelCore->validateFields - [line 264 - classes/ObjectModel.php] - [0 Argument]
ObjectModelCore->getFields - [line 464 - classes/ObjectModel.php] - [0 Argument]
ObjectModelCore->add - [line 426 - classes/ObjectModel.php] - [2 Arguments]
ObjectModelCore->save - [line 579 - classes/order/OrderDetail.php] - [0 Argument]
OrderDetailCore->create - [line 603 - classes/order/OrderDetail.php] - [7 Arguments]
OrderDetailCore->createList - [line 283 - classes/PaymentModule.php] - [7 Arguments]
PaymentModuleCore->validateOrder - [line 64 - modules/bankwire/controllers/front/validation.php] - [9 Arguments]
BankwireValidationModuleFrontController->postProcess - [line 158 - classes/controller/Controller.php] - [0 Argument]
ControllerCore->run - [line 348 - classes/Dispatcher.php] - [0 Argument]
DispatcherCore->dispatch - [line 28 - index.php] - [0 Argument]

order was placed but no email sent to the buyer

After accepting the payment the buyer gets mail 'Payment accepted' but no email with link.

 

So I decided to implement your fix again

download the attached file and upload

into /override/classes/order/OrderHistory.php

you file has only 100 line and one function and tried my best to replace lines in my order.php with yours.

 

Created another virtual product, bought it after confirmation of order the buyer saw:

[PrestaShopException]

Property OrderDetail->id_warehouse is empty
at line 837 in file classes/ObjectModel.php
831.
832. $message = $this->validateField($field, $this->$field);
833. if ($message !== true)
834. {
835. if ($die)
836. throw new PrestaShopException($message);
837. return $error_return ? $message : false;
838. }
839. }
840.
841. return true;
ObjectModelCore->validateFields - [line 264 - classes/ObjectModel.php] - [0 Argument]
ObjectModelCore->getFields - [line 464 - classes/ObjectModel.php] - [0 Argument]
ObjectModelCore->add - [line 426 - classes/ObjectModel.php] - [2 Arguments]
ObjectModelCore->save - [line 579 - classes/order/OrderDetail.php] - [0 Argument]
OrderDetailCore->create - [line 603 - classes/order/OrderDetail.php] - [7 Arguments]
OrderDetailCore->createList - [line 283 - classes/PaymentModule.php] - [7 Arguments]
PaymentModuleCore->validateOrder - [line 64 - modules/bankwire/controllers/front/validation.php] - [9 Arguments]
BankwireValidationModuleFrontController->postProcess - [line 158 - classes/controller/Controller.php] - [0 Argument]
ControllerCore->run - [line 348 - classes/Dispatcher.php] - [0 Argument]
DispatcherCore->dispatch - [line 28 - index.php] - [0 Argument]

But order was made and I see it in BO

Payment accepted , 'payment accepted' mail received, no mail with link.. pleasehelp...

Link to comment
Share on other sites

Hello,

Still not working correctly, after Your fix when I click Payment accepted by myself then it's working but if the other payment processor is sending this commend the mail with download link is not sending :S

 

what is the payment module that you've used?

i'm just testing it with bank wire payment module where the status order "payment accepted" should be set manually

Link to comment
Share on other sites

Hi PrestaShop Addict,

 

thank you for your advice. Now I get all four mail's in next order (bank wire - waiting for payment, Order details, Download product, Payment excepted)

 

I would like that order of mails costumer get is (bank wire - waiting for payment, Order details, Payment excepted, Download product)

 

Please how that could be done. I already try to change the number in this line:

 

if ($virtual_products && ($last_order_state->id == 2))

 

 

but then I don't get the Download product mail.

 

Best regards

 

David

Edited by WooF (see edit history)
Link to comment
Share on other sites

  • 1 month later...

Bug ...

 

Open and Edit file ../classes/order/OrderHistory.php

 

Replace :

			if ($virtual_products && (!$last_order_state || !$last_order_state->logable) && $new_order_state && $new_order_state->logable)

 

With :

			if ($virtual_products && (!$last_order_state || !$last_order_state->logable || ($last_order_state->id == $new_order_state->id) && $new_order_state && $new_order_state->logable))

 

worked for me! thanks a lot!

 

the problem now is that I can't download large files from prestashop, also not possible from backoffice, download stops after 60-80Mb. When downloading the file directly from server, it's ok.

Link to comment
Share on other sites

Hi,

 

We're having the same issue, customer is not receiving a download email for virtual products. I applied the above code change, but it doesn't seem to be making any difference. We've tried purchasing using Pay by Check and using a voucher with the same results. We get all other emails, but not the download email.

 

Apparently the fix above worked for everyone else, is there something I missed in this thread besides the single line code change in OrderHistory.php?

 

PrestaShop 1.5.3.1

 

Thanks...

Link to comment
Share on other sites

@WooF

Please read my post #11 again

 

@cyberdinu

Please check ../controller/GetFileController.php line-281 ,

and try to increasing the fgets "maximum line length" value (default = 16384)

echo fgets($fp, 16384);

 

@CodeDog

Please try it first with default bankwire payment module and disable the others payment module especially payment module from 3rd party

Link to comment
Share on other sites

Thanks, gonebdg, but it didn't make any difference. Disabled all other payment options and tried bank wire, but got the same thing.

 

What did work was creating an Order Status using the template "download_product", but only when using a payment method that requires approval in the back office so we can choose that Status.

 

Now all I need to know is how to make virtual products use that status when customers use an automated payment method like PayPal, and we'll be all set...

Edited by CodeDog (see edit history)
Link to comment
Share on other sites

  • 1 month later...

Hello, someone could resolve this problem? I have Prestashop 1.5.4.1 version and I have the same problem. The examples in this forum is for old version, any idea how to resolve?

thanks!

Link to comment
Share on other sites

  • 11 months later...

Hmmm... I just tested mine... I registered as a customer, bought something, payed via Paypal... got the email but there is no download link for the product I bought... not in the email and not in the My Account area... only thing I can download is the invoice...

does anyone got an answer for me????

Link to comment
Share on other sites

  • 4 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...