Jump to content

Recommended Posts

I'm trying to add to the PDF Delivery Slip the Message that a customer send during checkout.

Table `ps_message` field `message` selecting the message for that `id_order` with the earliest date.

 

The query look like the second code here, but I dont know how to make it into a usable variable for the pdf:

$order = new Order(intval($_GET["id_order"]));

SELECT `ps_message`.`message`, MIN(`ps_message`.`date_add`) AS DateTime
FROM ps_message
WHERE `ps_message`.`id_order` =$order

 

Any clues?

Share this post


Link to post
Share on other sites

I would use the Message class. The following will return all the public messages for the supplied order, in date descending order.

 

$result = Message::getMessagesByOrderId($order->id)

 

So you would just have to take the last order returned in $result

Share this post


Link to post
Share on other sites

It makes sense but I'm biting more than I can chew on this one. I counld not do it, I don't even know where to start. I'm new to php.

Share this post


Link to post
Share on other sites

if this is something you would like me to create for you, just send me a PM with the version of Prestashop that you use, as well as a sample PDF document showing where you would like the message to appear.

 

I do charge for my services, so we can discuss that in the PM.

Share this post


Link to post
Share on other sites

that module adds ALL of the customer messages. the requirement is to add the first one.

Share this post


Link to post
Share on other sites

Well done! I can work with this module, thanks Andrej Stas, the community is going to love this contribution.

 

Only issue so far is that the messages are showing the html entity &quot instead of the punctuation sign "

Share this post


Link to post
Share on other sites

I'm glad that my module helped.

So do you find useful to have checkbox "The first customer's message only"?

Share this post


Link to post
Share on other sites

Yes that checkbox would be very useful. The first message carries the specific instructions for the order. The rest of the customer message history is usually not very relevant to preparing the package.

 

Since you are asking about additional features, May I suggest adding a checkbox to display customer messages only on the "Delivery Slip" The reason being is that an Invoice is an accounting instrument and should not display these messages, but the messages on the "Delivery Slip" will help in preparing the package.

 

Is there a way I can manually hook the messages ONLY to the Delivery Slip and not the invoice?

Share this post


Link to post
Share on other sites

I would like to show the customer message on the Shopping Cart Summary Page (shopping-cart.tpl)?

 

Is there a Smarty variable that I can expose in the template?

 

I tried

 

{if isset($oldMessage)}{$oldMessage}{/if}

 

But didnt work.

Edited by TWDesign (see edit history)

Share this post


Link to post
Share on other sites

I would like to show the customer message on the Shopping Cart Summary Page (shopping-cart.tpl)?

 

Is there a Smarty variable that I can expose in the template?

 

I tried

 

{if isset($oldMessage)}{$oldMessage}{/if}

 

But didnt work.

 

Sorry, it doesn't work that way. It hooks only into PDFs

 

Your idea could be a subject of a new module.

Share this post


Link to post
Share on other sites

I would like to show the customer message on the Shopping Cart Summary Page (shopping-cart.tpl)?

 

Is there a Smarty variable that I can expose in the template?

 

I tried

 

{if isset($oldMessage)}{$oldMessage}{/if}

 

But didnt work.

 

The ParentOrderController.php does this, so you could probably add this or something similar to CartController.php so that your template change would work

 

   	 if ($oldMessage = Message::getMessageByCartId((int)(self::$cart->id)))
           self::$smarty->assign('oldMessage', $oldMessage['message']);

Share this post


Link to post
Share on other sites

Is there a way to add the customer message to the order confirmation email?

I am using the message text box as a way for customers to add information about their prefered delivery

times so it would be useful to have that on the order confirmation also.

 

Is there a smarty variable like {message} that can be simply added to the email templates?

Share this post


Link to post
Share on other sites

Hello,

 

the module hooks only into PDF and it's not possible to add any variable to the order confirmation email.

Share this post


Link to post
Share on other sites

Just bought this module, and it doesn't work!!!

Module is installed, configurated, but PDFs are not affected.

Prestashop 1.4.8.2

Share this post


Link to post
Share on other sites

Just bought this module, and it doesn't work!!!

Module is installed, configurated, but PDFs are not affected.

Prestashop 1.4.8.2

 

Did you fill in the "Title of the delivery slip in your language(s):" fields in the configuration?

Share this post


Link to post
Share on other sites

Did you fill in the "Title of the delivery slip in your language(s):" fields in the configuration?

 

Yes i did

Share this post


Link to post
Share on other sites

Just bought this module, and it doesn't work!!!

Module is installed, configurated, but PDFs are not affected.

Prestashop 1.4.8.2

 

Thanks, was about to buy this. will wait to make sure it works. :P

Share this post


Link to post
Share on other sites

This modules has only satisfied customers so far.

 

I contacted enagen to detect the problem.

 

Yes I already like all your products :) I'm sure you'll get the bug fixed and then I'll download asap

 

The theme maker i'm looking forward to cause I could use it on a site I'm working on now!

Share this post


Link to post
Share on other sites

Thanks Andrej!! Works perfect now! Prestashop 1.4.8.2

I wish to know what was the problem, please email me or post it! :)

Thanks a lot!! very nice support service!

Share this post


Link to post
Share on other sites

Thanks Andrej!! Works perfect now! Prestashop 1.4.8.2

I wish to know what was the problem, please email me or post it! :)

Thanks a lot!! very nice support service!

 

The problem was in the main titles:

Title of the delivery slip in your language(s):

 

Title of the invoice in your language(s):

 

 

They were not filled out correctly - it is described in the documentation which is included in the ZIP

Edited by Andrej Stas (see edit history)

Share this post


Link to post
Share on other sites

Yes I already like all your products :) I'm sure you'll get the bug fixed and then I'll download asap

 

The theme maker i'm looking forward to cause I could use it on a site I'm working on now!

 

Thank you! :) As for the theme maker, you may visit the FB page

Share this post


Link to post
Share on other sites

Thanks a lot!!! I did not understand that the titles should be that way and with accents! never think about that!

Thanks for response and support!

Regards

Share this post


Link to post
Share on other sites

It works with v1.5.x though special characters (accents...) aren't properly decoded anymore with v1.5.5.0.

Share this post


Link to post
Share on other sites

Sure, it is not free, but the module is able to do many other things. I am sure that you will get quick return on investment.

Share this post


Link to post
Share on other sites

Sorry, it doesn't work that way. It hooks only into PDFs

 

Your idea could be a subject of a new module.

Do you have module for latest version of PS i,e 1.6.1.5 ? aso will it allow to add custom message by shop owner? on invoice and delivery slips?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More