Author Topic: Order Status Not Displaying Correctly in Sent Email  (Read 205 times)

CDCG

  • Beginner
  • *
  • Posts: 14
Order Status Not Displaying Correctly in Sent Email
« on: November 09, 2018, 14:42:09 pm »
Hi, we have created additional order statuses, but they don't display properly in email.  This is what is sent:

COM_VIRTUEMART_MAIL_SUBJ_SHOPPER_O

Instead of: Processing Order

Tried to adjust files, but no success.

How can this be corrected?  Thanks in advance.

StefanSTS

  • Global Moderator
  • Jr. Member
  • *
  • Posts: 215
  • VirtueMart Version: VM 4.2 on Joomla 4.5
Re: Order Status Not Displaying Correctly in Sent Email
« Reply #1 on: November 09, 2018, 14:54:41 pm »
Please make a Joomla language override for COM_VIRTUEMART_MAIL_SUBJ_SHOPPER_O and others.

Do it for all languages and do it for Administrator AND Site. In Administrator is a checkbox to achieve that.

Cheers
Stefan

--
Stefan Schumacher
www.jooglies.com - VirtueMart Invoice Layouts

CDCG

  • Beginner
  • *
  • Posts: 14
Re: Order Status Not Displaying Correctly in Sent Email
« Reply #2 on: November 09, 2018, 16:10:42 pm »
Thanks for the quick reply.  Why doesn't VM automatically update when you create a new order status?  I manually updated this file:

/public_html/components/com_virtuemart/language/en-GB/en-GB.com_virtuemart_orders.ini

and it now works.  I'll create as you recommended also.

StefanSTS

  • Global Moderator
  • Jr. Member
  • *
  • Posts: 215
  • VirtueMart Version: VM 4.2 on Joomla 4.5
Re: Order Status Not Displaying Correctly in Sent Email
« Reply #3 on: November 09, 2018, 16:35:39 pm »
Hi,

if you have language variables for every possible case, a user could customize VirtueMart, there were a hundred thousand more language variables that fill your server memory.

So if you go out of the ordinary, it's better to add your small amount of language variables. And how should VirtueMart know what you think is a good language string for status O or L or W? Everyone has probably an own idea about it.

You should use the language overrides in Joomla - Extensions - Language, because your changed language file will be overridden on update.

Stefan
--
Stefan Schumacher
www.jooglies.com - VirtueMart Invoice Layouts

CDCG

  • Beginner
  • *
  • Posts: 14
Re: Order Status Not Displaying Correctly in Sent Email
« Reply #4 on: November 09, 2018, 16:43:59 pm »
Sorry for the confusion, but let me clarify my last post.  Via VM we created several new Order Status Codes.  VM shows these new codes in its admin panel.  It created this new variable:  COM_VIRTUEMART_MAIL_SUBJ_SHOPPER_O as one example plus others.  How would a VM shop owner know such a variable was created as VM did this.  The only way we became aware is when we saw the variable in an email header to a customer.  Since VM lets you create new Order Codes it should manage their associated variables across VM.  Does this clarify my last post?  Thanks.

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2811
  • VirtueMart Version: 3.4
Re: Order Status Not Displaying Correctly in Sent Email
« Reply #5 on: November 09, 2018, 17:20:26 pm »
Yes that does clarify your expectation.

Quote
Since VM lets you create new Order Codes it should manage their associated variables across VM.

Although it would be nice if VM did such a thing - it currently does not. As has been explained, this is currently a manual process.

Maybe the team could add a "message of warning that email variables may need to be created"






regards
A

Joomla 3.8.13
php 7.1

CDCG

  • Beginner
  • *
  • Posts: 14
Re: Order Status Not Displaying Correctly in Sent Email
« Reply #6 on: November 09, 2018, 17:34:45 pm »
Yes any time VM allows you to create a new variable and doesn't automatically add then a task should be created telling the shop owner that they have to manually create the variables.  Thanks.

StefanSTS

  • Global Moderator
  • Jr. Member
  • *
  • Posts: 215
  • VirtueMart Version: VM 4.2 on Joomla 4.5
Re: Order Status Not Displaying Correctly in Sent Email
« Reply #7 on: November 09, 2018, 17:36:14 pm »
Wonderful idea that VirtueMart would create a custom language file that would be only in an individual installation and not overridden by a standard language file.
Then it could have a nice interface for editing the custom language strings by just calling a VM Menu Item.
Probably possible but I guess it's a bit too much work for a feature that is on the nice-to-have list, and not on the urgent-changes or urgent-feature list.

I am quite sure, in a few years from now, some Artificial Intelligence will do all that for us.
Until then, we gotta do some hard work. ;-)

Stefan
--
Stefan Schumacher
www.jooglies.com - VirtueMart Invoice Layouts

CDCG

  • Beginner
  • *
  • Posts: 14
Re: Order Status Not Displaying Correctly in Sent Email
« Reply #8 on: November 09, 2018, 18:54:07 pm »
Sorry, but I'm confused by your response.  No artificial intelligence is required for this.  VM currently allows the shop owner to create additional Order Statuses.  The owner enters the following data:

Order Status Name    
Stock handling    
Order Status Color    
Order Status Code
Description
Vendor
Ordering

This data is stored in the table: orderstates.  It's interesting that the order_status_code is stored in the order_histories table and not the orderstate_id in case the shop owner would want to change a status code they created.  This could create a data integrity issue (unless the system prevents this - I didn't check).

Once created, this new status can be used system wide in VM.  The shop owner can select these codes as the order is being processed and can email the customer with an update.  The codes work properly across the system except when emailing the customer with the update.  This is where the issue is (the email subject line).  The customer receives the updated status email with the variable name and not the actual status as the email subject line.  The system has several preconfigured statuses that are properly displayed when sent to the customer.  If the system creates the actual variable (not the shop owner) the system should update all associated variables when sending an email.

If this isn't currently possible for VM to send correct status to the customer then the possible solutions:

1.  Don't let the shop owner create additional Order Statuses
2.  Check to make sure variable has valid text; if not send generic subject line
3.  Change the email subject line to a generic title (not preferred)

I can understand from your perspective that this is trivial, but for the shop owner it has an impact.  It creates customer confusion when they receive an email with this subject line:
COM_VIRTUEMART_MAIL_SUBJ_SHOPPER_O

Instead of:
[order number], Processing Order by [store name], total $x.xx

Thanks for your time in this matter.

StefanSTS

  • Global Moderator
  • Jr. Member
  • *
  • Posts: 215
  • VirtueMart Version: VM 4.2 on Joomla 4.5
Re: Order Status Not Displaying Correctly in Sent Email
« Reply #9 on: November 09, 2018, 21:05:20 pm »
You are right, artificial intelligence is not needed.
A person with actual brain capacity is needed. They cost money or someone has to spend some free time.
A wonderful thing about VirtueMart is, that it is open source. So anyone who does not want to create the language overrides themselves can write the code or ask someone to do that.

BTW: An order email with purely a language string can NEVER be sent to the customer, if the shop is properly tested in a test environment. Everybody should do that.

I do understand your concern, I had this matter before. But what is better than getting a language variable, realizing something has to be done and then choosing the perfect string that suits that custom status? Otherwise the standard status notices will be probably used forever, even if they don't really fit. That's already happening with the current ones in many shops. They don't really fit.
Your three options were all worse than making the overrides yourself. If you make a new status, it's just a minute more work and you have the perfect mail subject for your process.

If you have a generic solution to this that works for everyone, please offer the code to the VM team. I am sure they will have an open ear for that if it is ready to use. But it should be ready to use, if they have to work for some hours to figure out how that should work, they might say: Let the shop owner make three overrides in two minutes, so we don't have to spend a day on this.

Stefan
--
Stefan Schumacher
www.jooglies.com - VirtueMart Invoice Layouts