Post by walterring » Thu Nov 23, 2017 6:11 pm

When customer looks at his order information, he gets this:
Order ID: #%s #2
Shouldn't that resolve to the invoice prefix? What is this %s, is that a variable that should have been resolved?

Newbie

Posts

Joined
Thu Nov 23, 2017 5:08 pm

Post by straightlight » Thu Nov 23, 2017 10:07 pm

You did not posted your OC version. Any extensions installed? From which page and event do you notice these results? More information would be needed in order to assist you with your inquiry.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by walterring » Fri Nov 24, 2017 4:57 am

Running Version 3.0.2.0, basically out of the box.
Only German Language extension installed.
When customers goes to Account, Order History, Order Information this is shown:
Account
Order details
Order ID: #%s #10
Date Added: 23/11/2017

Newbie

Posts

Joined
Thu Nov 23, 2017 5:08 pm

Post by straightlight » Fri Nov 24, 2017 5:13 am

In catalog/language/<your_language_code>/extension/total/credit.php file,

find:

Code: Select all

$_['text_order_id'] = 'Order ID: #%s';
replace with:

Code: Select all

$_['text_order_id'] = 'Order ID: # %s';
Do the same process in your catalog/language/<your_language>/extension/total/reward.php file.

It won't fix the issue for your past orders but should fix the issue for future orders.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by walterring » Fri Nov 24, 2017 6:04 am

Changed both, credit.php and reward.php, created a new order, now it looks like this:

Order Details
Order ID: # %s #11
Date Added: 23/11/2017

Where does that additional %s come from?

Here is the code line:

Code: Select all

$_['text_order_id'] = 'Order ID: # %s';

Newbie

Posts

Joined
Thu Nov 23, 2017 5:08 pm

Post by straightlight » Fri Nov 24, 2017 6:09 am

The additional %s is a defined variable that PHP replaces with a function in order to output the true value defined with the key language in this case.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by walterring » Fri Nov 24, 2017 6:17 am

OK, I had to completely remove the %s, now the Order ID ist shown correclty:

Order Details
Order ID: #11
Date Added: 23/11/2017

Code: Select all

$_['text_order_id'] = 'Order ID:';
Thanks for your help, problem resolved.

Newbie

Posts

Joined
Thu Nov 23, 2017 5:08 pm

Post by straightlight » Fri Nov 24, 2017 6:18 am

By removing the %s , the number won't be shown on your next orders.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by walterring » Fri Nov 24, 2017 6:26 am

They ARE shown, created a new order, and its working as you can see:

Order Details
Order ID: #13
Date Added: 23/11/2017

And after changing the credit.php and reward.php also older orders are now shown correctly! The old ones are dynamically updated!

Newbie

Posts

Joined
Thu Nov 23, 2017 5:08 pm

Post by straightlight » Fri Nov 24, 2017 6:29 am

In this case, this may be a bug since the text_order_id language field definition only originates from the credit.php and reward.php file ...

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by walterring » Fri Nov 24, 2017 6:30 am

Looks to me as if #%s is hardcoded and therefore not needed in credit.php

Newbie

Posts

Joined
Thu Nov 23, 2017 5:08 pm

Post by straightlight » Fri Nov 24, 2017 6:32 am

That is correct, which is why it is a bug. I have created a topic in the bug reports section of the forum about it pointing to this direction in order for future users who reports this issue to follow the steps. Thanks for reporting this bug.

Continued instructions on this topic from / on the 2nd post: viewtopic.php?f=201&t=199919

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by CSR » Sat Dec 23, 2017 12:55 am

Thanks for this. I had today just noticed the same issue (OC 3.0.2.0), but this has resolved it.

(Edit: Not sure why it is in OC 2.0 Support! ??? )

CSR
Newbie

Posts

Joined
Sun Mar 19, 2017 3:12 am

Post by straightlight » Sat Dec 23, 2017 1:03 am

Thanks for the feedback regarding this fix.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by mrtexas » Sun Apr 21, 2019 8:32 am

Actually, I see %s in many areas of opencart, including in a href in the language files -- i.e. <a href="%s">%s</a>

It is all throughout opencart as much as % alone.

It does correct past order id's as well...

Newbie

Posts

Joined
Mon Apr 15, 2019 2:32 pm

Post by Start Open Cart » Tue Jul 16, 2019 10:36 pm

That happend becouse on language files have wrong code (#%s) need just set # (%s) on all files where have that code and that is all.

Image
info@startopencart.info
www.startopencart.info


User avatar

Posts

Joined
Sat Jun 08, 2019 4:40 am
Who is online

Users browsing this forum: No registered users and 295 guests