Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Email And Document Template Editor In Cs-Cart 4.4.1 Rate Topic   - - - - -

 
  • yakulakov
  • CS-Cart
  • CS-Cart Architects
  • Join Date: 26-Jan 15
  • 92 posts

Posted 16 August 2016 - 11:03 AM #1

q9Z4cdO.png

 

Hi!

 

The alpha version of CS-Cart 4.4.1 is coming in the closest time, and the production release will be available this fall. Two main changes in the new version are the new logic of theme functioning and the updated email and document template editor.

 

In this post, we’d like to share with you the information about the updated email and document template editor. The editor has been a prototype for a long time. Now, it will be released as a ready-to-go feature built into CS-Cart 4.4.1. Store administrators will be able to edit email notifications, plus these documents via the new editor:

  • Invoices
  • Packing slips
  • Packing slips of the RMA add-on
  • Supplier invoices of the Suppliers add-on
  • Gift certificates of the Gift certificates add-on

Read general information about the editor in our old post.

 

 

Quick Introduction to the Editor

In CS-Cart 4.4.1, store administrators will be able to edit and construct email notifications, invoices, packing slips, and gift certificates right in their admin panels using a visual text editor.

Basically, two key elements of the editor are variables and snippets:

  • A variable is a dynamic component of a template. A template fetches all the necessary information through variables. For example, the {{ order.total }} variable added to the invoice template displays the total order price in the invoice. Developers will be able to expand the list of available variables via add-ons.

R4UuJKY.png

 

  • A snippet is a separate part of a template to quickly insert the same information to different invoices or email notifications. Often the footer and header of email notifications or invoices must look the same. Store admins construct a snippet in the Code snippets tab when editing an invoice or email and then add the whole snippet by simply inserting the function to the invoice or email. For example, this function {{ snippet("footer") }} fetches the footer snippet to email notifications. Developers will be able to expand the list of available snippets via add-ons.

nxm3Nhf.png

 

The new template editor works on the template engine called Twig (version 1.24). Developers can take advantage of all the Twig features.

 

 

 

Key Insights for Developers

  • Since the editor is based on WYSIWYG, you won’t be able to insert conditions, loops, or other logical constructions to invoices and email notifications—WYSIWYG cuts them off.
  • Use snippets to add conditions, loops, and that kind of constructions to templates. Snippet editing window doesn’t use WYSIWYG—you’ll be able to work with snippets just like with SMARTY templates.
  • There will be no hooks for documents—use snippets instead.
  • You’ll be able to add new variables, snippets, and, probably, invoices via add-ons.
  • Store administrators will manually insert variables and snippets to documents.
  • Backward compatibility will be fine—if your add-on uses email notifications or invoices, it will still work in CS-Cart 4.4.1. Templates will be fetched same as before.
  • After the upgrade to CS-Cart 4.4.1, the new template editor will be disabled. Store admins will be able to activate it on the Settings → Appearance page of their admin panels. After a clean CS-Cart 4.4.1 installation, the new editor will be active by default. Store admins will also be able to choose the old template editor on the clean installation.

 

We’ve prepared detailed developer docs describing the whole workflow and examples. Check them out.

 

For now, you can test the new editor in our developer demo stores: CS-Cart and Multi-Vendor. To edit email notifications or documents, go to Design in the admin panel and select Email templates or Documents:

 

hBRsMoa.png

 

Please ask any questions about new document template editor in this topic, our developers will kindly answer them.



 
  • cscartrocks
  • Member
  • Members
  • Join Date: 24-Jan 11
  • 1594 posts

Posted 16 August 2016 - 11:06 AM #2

Thanks for this great feature. Will test it out.


One Step Checkout Addon - The ultimate checkout experience
Best CS-Cart SEO addon - CS-Cart SEO Ultimate Addon
PM for quality custom work/project


 
  • Vivek Gupta
  • Senior Member
  • Members
  • Join Date: 09-Jul 15
  • 247 posts

Posted 17 August 2016 - 04:58 AM #3

Great :) (y)


Vivek Gupta 
 


 
  • Mongoose
  • Senior Member
  • Members
  • Join Date: 08-Mar 13
  • 958 posts

Posted 17 August 2016 - 12:06 PM #4

It would be even greater if this feature would also extend to the editing of product detail pages and the brand page feature page.


CS Cart Evangelist - running CS Cart 4.7.4 in three domains


 
  • crazyshark20
  • Junior Member
  • Members
  • Join Date: 19-Aug 09
  • 202 posts

Posted 17 August 2016 - 02:21 PM #5

invoices A4 format , but horizontal and juxtaposed so as to be 3 pieces of A4 how to set ??

 

https://s8.postimg.o...0sl/invoice.jpg



 
  • imac
  • CTO
  • CS-Cart Architects
  • Join Date: 22-Nov 05
  • 2036 posts

Posted 18 August 2016 - 07:08 AM #6

 

invoices A4 format , but horizontal and juxtaposed so as to be 3 pieces of A4 how to set ??

 

https://s8.postimg.o...0sl/invoice.jpg

 

You can not set it this way. You need a custom modification for this. 

Unfortunately we are not going to implement this feature. 


Ilya Makarov,
CS-Cart Architect Team
Suggest and vote for new features | Report a bug

 
  • Darius
  • Douchebag
  • Members
  • Join Date: 20-Apr 08
  • 3176 posts

Posted 19 August 2016 - 06:34 AM #7

Actual invoice template editor is done very well indeed however I am missing the key point of this feature that is editing actual invoice before print.

 

While in admin order details page for example

http://dev.demo.cs-c...ils&order_id=96

 

there is a tweak before send but actually this should be edit and there send, save and download

 

My product names are long and seo oriented, I am always editing invoice product names to remove what is not necessary or to combine re calculate product list if too many identical product in same order.

 

Lack of save button would be big disappointment.



 
  • Darius
  • Douchebag
  • Members
  • Join Date: 20-Apr 08
  • 3176 posts

Posted 19 August 2016 - 06:37 AM #8

PS while printing order invoice, print preview mode of firefox, invoice content does not fit to default A4 page unless you pick shrink to fit, some content hides behind right margin.

 

Also I know that everyone can change this according to taste but what is this padding: 0px 44px 0px 46px; for? Isint page setup margins enough or you expect them to be set to 0 and controlled from invoice?

<td style="background-color: #ffffff; margin: 0px auto 0px auto; padding: 0px 44px 0px 46px; text-align: left;">


 
  • imac
  • CTO
  • CS-Cart Architects
  • Join Date: 22-Nov 05
  • 2036 posts

Posted 19 August 2016 - 12:32 PM #9

Actual invoice template editor is done very well indeed however I am missing the key point of this feature that is editing actual invoice before print.

 

While in admin order details page for example

http://dev.demo.cs-c...ils&order_id=96

 

there is a tweak before send but actually this should be edit and there send, save and download

 

My product names are long and seo oriented, I am always editing invoice product names to remove what is not necessary or to combine re calculate product list if too many identical product in same order.

 

Lack of save button would be big disappointment.

We decided that save button can broke the order workflow.

 

When you change order status, your saved invoice should be modified because it is already have another status in it, and I don't have an idea how we can implement this.


Ilya Makarov,
CS-Cart Architect Team
Suggest and vote for new features | Report a bug

 
  • Darius
  • Douchebag
  • Members
  • Join Date: 20-Apr 08
  • 3176 posts

Posted 19 August 2016 - 12:41 PM #10

I guess you are missing the point that since invoice is saved from the law and book keeping, accounting it cannot be changed. Same as currency exchange rate cannot impact completed order total.

 

I guess you should check this addon

http://marketplace.c...management.html

 

currently it is best invoicing addon for my needs, I suppose I'll have to stick with it..



 
  • Darius
  • Douchebag
  • Members
  • Join Date: 20-Apr 08
  • 3176 posts

Posted 19 August 2016 - 12:48 PM #11

What does invoice document has to do with order status anyways?

 

Invoice as a document should not reflect status of the order. There are just too many aspects of of what part of the order is paid, what part shipped, when order will be paid, will company pay invoice at all maybe it will bankrupt.. All this sorted by accountant..

 

 

When you change order status, your saved invoice should be modified because it is already have another status in it, and I don't have an idea how we can implement this.

 

here a scenario for you.

 

1. you sell t-shirt and complete order invoice nr1001

send order, customer gets order but t-shirt is too small and he returns it.

2. you create credit note invoice nr1002 (not nr1001)



 
  • imac
  • CTO
  • CS-Cart Architects
  • Join Date: 22-Nov 05
  • 2036 posts

Posted 30 August 2016 - 08:44 AM #12

What does invoice document has to do with order status anyways?

 

Invoice as a document should not reflect status of the order. There are just too many aspects of of what part of the order is paid, what part shipped, when order will be paid, will company pay invoice at all maybe it will bankrupt.. All this sorted by accountant..

 

 

 

here a scenario for you.

 

1. you sell t-shirt and complete order invoice nr1001

send order, customer gets order but t-shirt is too small and he returns it.

2. you create credit note invoice nr1002 (not nr1001)

Are you saying that we should not display order status on the invoice? https://www.evernote...qqkflfZV3ikpCGY- because each time we change order status, the invoice will also be changed.

What if customer changes shipping method or payment method after the order is placed.


Ilya Makarov,
CS-Cart Architect Team
Suggest and vote for new features | Report a bug

 
  • imac
  • CTO
  • CS-Cart Architects
  • Join Date: 22-Nov 05
  • 2036 posts

Posted 30 August 2016 - 08:46 AM #13

I just think you should implement new functionality "beside" existing functionality so that you don't break things that are out of your control.  Additionally, if you did a new implementation then you would be free of compatibility issues.

 

I will await documentation but my point is that I shouldn't have to re-do all my addons and custom development work I've done for others using hooks and approved methods because you decide to optionally allow users to edit email templates from a WYSIWYG editor.

Tony, have you had a chance to go through this post and dev docs.
Right now we in alpha state and we can make some serious changes. So I would really appreciate your feedback on this.

Ilya Makarov,
CS-Cart Architect Team
Suggest and vote for new features | Report a bug

 
  • lastpixel
  • Member
  • Trial users
  • Join Date: 25-Feb 16
  • 36 posts

Posted 30 August 2016 - 09:16 AM #14

Imac, how could I change the Subject line for the email that is sent when a new order is placed. I saw that I can change the body email (invoice), but we need to put the {{ order.total }} in the subject line.



 
  • imac
  • CTO
  • CS-Cart Architects
  • Join Date: 22-Nov 05
  • 2036 posts

Posted 30 August 2016 - 10:32 AM #15

Imac, how could I change the Subject line for the email that is sent when a new order is placed. I saw that I can change the body email (invoice), but we need to put the {{ order.total }} in the subject line.

Try the following.

Go to Design -> Email templates. Open the email notification that is base on your initial order status. In many cases this is either Open or Processes.

In my case this is Order notification: Open, and replace the Subject from:

{{ company_name }}: {{ __("change_order_status_o_subj", {"[order]": order_info.order_id}) }} 

to: 

{{ company_name }}: {{ __("change_order_status_o_subj", {"[order]": order_info.order_id}) }} {{ order_info.total }} 

Ilya Makarov,
CS-Cart Architect Team
Suggest and vote for new features | Report a bug

 
  • mokeshop
  • Senior Member
  • Members
  • Join Date: 27-Jul 12
  • 920 posts

Posted 30 August 2016 - 11:01 AM #16

Darius is right. Once issued invoice should not be changed.



 
  • Darius
  • Douchebag
  • Members
  • Join Date: 20-Apr 08
  • 3176 posts

Posted 30 August 2016 - 11:14 AM #17

I cannot speak for whole world accounting. But

credit memo and invoice must have unique number even they are for same order. Remember that order can be paid in parts, part of the order can be returned or refunded, there are just too many factors.

 

From accounting point on invoice you have to fit

seller details customer details, unique invoice number, sale date, product name, unit price, quantity, subtal, tax, total.

 

At what stage order is, is information for buyer and does not have to be on invoice.

 

 

What if customer changes shipping method or payment method after the order is placed.

 

 

That is why invoice should be create in very last step, when order is completed, before very last step invoice would be called proforma, proforma has no legal right, customer has no obligation to pay it or proceed with it, proforma are details and totals for

payment to be done. Commercial invoice would mean you are in debt, or you have made payment, proof of payment is receipt, bank receipt or similar..

 

 

 

Are you saying that we should not display order status on the invoice? https://www.evernote...qqkflfZV3ikpCGY- because each time we change order status, the invoice will also be changed.

What if customer changes shipping method or payment method after the order is placed.



 
  • lastpixel
  • Member
  • Trial users
  • Join Date: 25-Feb 16
  • 36 posts

Posted 30 August 2016 - 11:28 AM #18

 

Try the following.

Go to Design -> Email templates. Open the email notification that is base on your initial order status. In many cases this is either Open or Processes.

In my case this is Order notification: Open, and replace the Subject from:

{{ company_name }}: {{ __("change_order_status_o_subj", {"[order]": order_info.order_id}) }} 

to: 

{{ company_name }}: {{ __("change_order_status_o_subj", {"[order]": order_info.order_id}) }} {{ order_info.total }} 

 

I've tried {{ company_name }}: {{ __("change_order_status_o_subj", {"[order]": order_info.order_id}) }} - {{ order.total }}

but no working.

I receive this Subject line:  Simtech: Order #99 has been placed successfully -



 
  • The Tool
  • Been Here Way Too Long Member
  • Members
  • Join Date: 30-Mar 07
  • 3639 posts

Posted 30 August 2016 - 12:13 PM #19

I've tried {{ company_name }}: {{ __("change_order_status_o_subj", {"[order]": order_info.order_id}) }} - {{ order.total }}

but no working.

I receive this Subject line:  Simtech: Order #99 has been placed successfully -

 

Your code is missing _info.

{{ order_info.total }}


 
  • mokeshop
  • Senior Member
  • Members
  • Join Date: 27-Jul 12
  • 920 posts

Posted 30 August 2016 - 02:54 PM #20

Partially payed can be presented in the time invoice was issued. Payed change can be allowed. I don't see the relevance of changing shipping method on the invoice. If something is altered then alter the delivery slip not the issued invoice. Invoice can be marked payed but had also not to be presented or the invoice.

Once issused invoice should be left as it is. ;)
One cool idea is to pull payment method data to the invoice. Examples : payal Transaction id ....

My suggestion go away from issued invoices ;)