Add order number to purchase confirmation

  • Posts: 35
  • Thank you received: 0
8 years 9 months ago #230103

-- url of the page with the problem -- : www.continuitylenses.com/en/
-- HikaShop version -- : 2.6.0
-- Joomla version -- : 3.4.6
-- PHP version -- : 5.5.30
-- Browser(s) name and version -- : Google Chrome 47.0.2526.106

Hello,

Once a customer has placed an order, they receive a system message thanking them for their purchase.

We would like to include the order number in this message. We have already created a language override (THANK_YOU_FOR_PURCHASE), adding in extra information to say the customer will receive a confirmation email shortly.

Our question is can we include the order number in the language override? If so, how do we do this?

Thanks,
Richard

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 9 months ago #230210

Hi,

You need to edit the file "after_end" via the menu Display>Views.
There, you can easily display the order number with the code:
$app->enqueueMessage( JText::sprintf('THANK_YOU_FOR_PURCHASE',$this->order->order_number) );

Then you can add a %s in the translation override of that message.

Please Log in or Create an account to join the conversation.

  • Posts: 35
  • Thank you received: 0
8 years 9 months ago #230496

Hello Nicolas,

We've followed your guidance below (see screenshots - After_End PHP and Language Override).

Unfortunately, the override is not working (see screenshot language override - frontend) as we still see the %s (not the order number) in the message. Does everything look OK in the screenshots to you?

Interestingly, the THANK_YOU_FOR_PURCHASE override displays above the top bar which we do not want. We're not sure why this appears here and not in the main body of the page? Do you have any thoughts why this is happening?

Thanks
Richard

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 9 months ago #230498

Hi,

Then it means that you've edited the "after_end" view file for another template than the template you're using on your frontend.

Please Log in or Create an account to join the conversation.

  • Posts: 35
  • Thank you received: 0
8 years 9 months ago #230567

Hello,

We are using the JV All in one template for the site, but I am pretty sure we haven't modified anything else and even on that we haven't modified any php files unless necessary and nothing after_end related. Do you know how we can track down what might have been modified or might be causing the problem?

Thanks.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 9 months ago #230580

Hi,

No, I mean that when you go in the menu Display>Views, you can edit the view files for each template of your website. And I'm thinking that you might have edited the view file for another template than the one you're using, and thus that would explain why you don't see any change on your frontend.

Please Log in or Create an account to join the conversation.

  • Posts: 35
  • Thank you received: 0
8 years 9 months ago #230620

Hello Nicolas,

We're pretty confident the changes have been made to the correct PHP file (see attached).

I have just processed a transaction but unfortunately the override is not working and the confirmation message appears above the main navigation (as per screenshot from previous message).

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 9 months ago #230627

Hi,

I see but I don't see any other reason.
The JText::sprintf function if a Joomla function that is used all over the place and it works.
The override of the translation has been done properly too in the Joomla language manager as far I can see.
So the only reason I can see is that the file that is edited is not the correct one.

Try to remove everything from the view file. If you don't see any message anymore at the end of the checkout, you're in the good file. If you still see the same thing as before, it's definitely not the correct view file you're editing.

Please Log in or Create an account to join the conversation.

  • Posts: 35
  • Thank you received: 0
8 years 8 months ago #231129

Hello Nicolas,

I've removed the customisation from the custom view file and deleted the language overrides.

I have processed an order and the THANK_YOU_FOR_PURCHASE message has changed so we know we're working in the correct file.

However, the message itself is still appearing outside of the template. Any thoughts on why this is happening?

Thanks,
Richard

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 35
  • Thank you received: 0
8 years 8 months ago #231184

I have just noticed this in the PHP error log at the same time though:
[24-Feb-2016 21:55:14 Europe/London] PHP Warning: Cannot modify header information - headers already sent by (output started at ...\libraries\legacy\view\legacy.php:216) in ...\plugins\system\jvframework\framework\extensions\layout\layout.php on line 42
Is that related?

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
8 years 8 months ago #231214

Hi,

Yes that seems to be related on your jv template. It is integrating a framework modifying the header of the page.
So you should try with the default Joomla template, if no issues with the default one we recommend to contact your template provider for more information about that error.

Please Log in or Create an account to join the conversation.

Time to create page: 0.092 seconds
Powered by Kunena Forum