Jump to content

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

Easy Editing Of Invoices And Email Notifications Rate Topic   * * * * * 1 votes

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

Posted 18 November 2016 - 03:14 PM #121

Yes correct, but I am not skilled enough to make snipped with conditions if else ..

 

But probably in same case you should create new snippet for this, because the above language variables used store-wide.



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

Posted 18 November 2016 - 03:16 PM #122

Before upgrade I had

 

below

{hook name="orders:invoice_order_status_info"}

<h2 style="font: bold 15px Tahoma; margin-bottom: 5px; padding: 0px 0px 3px 0px">{if $doc_id_text}{$doc_id_text}{else}{__("proforma_title")}{/if}</h2>

part above looked like

 

{assign var="order_header" value=__("invoice")}
 

{if $status_settings.appearance_type == "I" && $order_info.doc_ids[$status_settings.appearance_type]}
    {assign var="doc_id_text" value="{__("invoice_vat")} #`$order_info.doc_ids[$status_settings.appearance_type]`"}
{elseif $status_settings.appearance_type == "C" && $order_info.doc_ids[$status_settings.appearance_type]}
    {assign var="doc_id_text" value="{__("credit_memo")} #`$order_info.doc_ids[$status_settings.appearance_type]`"}
    {assign var="order_header" value=__("credit_memo")}
{elseif $status_settings.appearance_type == "O"}
    {assign var="order_header" value=__("order_details")}
{/if}


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

Posted 18 November 2016 - 03:46 PM #123

Could you put code what does {{ o.invoice_id_text }} consist of ? I will put it to snippets with just modified text variables? I really need this one, just went like, hopefully no orders yet :D



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

Posted 19 November 2016 - 08:31 AM #124

Found code location

 

app\Tygh\Template\Document\Order\Variables\OrderVariable.php

        // Invoice header and invoice id text
        $this->data['invoice_header'] = __('invoice', array(), $context->getLangCode());
        $this->data['invoice_id_text'] = __('order', array(), $context->getLangCode()) . '&nbsp;#' . $order->getId();
        $status_data = $order->getStatusData($context->getLangCode());
        if (!empty($status_data['params']['appearance_type'])) {
            if ($status_data['params']['appearance_type'] == 'O') {
                $this->data['invoice_header'] = __('order_details', array(), $context->getLangCode());
            } elseif (!empty($this->data['doc_ids'][$status_data['params']['appearance_type']])) {
                $doc_id = $this->data['doc_ids'][$status_data['params']['appearance_type']];
                if ($status_data['params']['appearance_type'] == 'I') {
                    $this->data['invoice_id_text'] = __('invoice', array(), $context->getLangCode()) . ' #' . $doc_id . '<br/>' . $this->data['invoice_id_text'];
                } elseif ($status_data['params']['appearance_type'] == 'C') {
                    $this->data['invoice_header'] = __('credit_memo', array(), $context->getLangCode());
                    $this->data['invoice_id_text'] = __('credit_memo', array(), $context->getLangCode()) . ' #' . $doc_id . '<br/>' . $this->data['invoice_id_text'];
                }
            }
        }

I want to make a snippet that would do this

 

$this->data['invoice_id_text'] = __('my_order', array(), $context->getLangCode()) . '&nbsp;#' . $order->getId();

 

$this->data['invoice_id_text'] = __('my_invoice', array(), $context->getLangCode()) . ' #' . $doc_id . '<br/>' . $this->data['invoice_id_text'];

 

$this->data['invoice_id_text'] = __('my_credit_memo', array(), $context->getLangCode()) . ' #' . $doc_id . '<br/>' . $this->data['invoice_id_text'];

 

This is because I need to have lang variables

 

'my_order'  named "proforma invoice / translation"

'my_invoice' named "Commercial invoice / translation"

 

I do not want to change value for default order and invoice value that is widely used in backed.

 

Also I do not think having # built in is good idea.. Better to have something like

__('space') somebody will use "#" others may want to put "Nr" or "No"



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

Posted 21 November 2016 - 07:58 AM #125

Would someone please help me writing a snipped with conditions

 

if ($status_data['params']['appearance_type'] == 'O') {

 

print this

__('order', array(), $context->getLangCode()) . '&nbsp;#' . $order->getId();

 

else if ($status_data['params']['appearance_type'] == 'I') {

 

print this

__('invoice', array(), $context->getLangCode()) . ' #' . $doc_id



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

Posted 23 November 2016 - 07:09 AM #126

Ok I thought I'll share my current workaround of how to actually edit and print invoices using tweak and send feature. Installed this free CKeditor full

 

http://marketplace.c...l-ckeditor.html



 
  • johnbol1
  • Never Re
  • Members
  • Join Date: 23-Feb 10
  • 4657 posts

Posted 29 December 2016 - 07:49 PM #127

In the old system we had a check box on each status to choose whether to send an email notification or not to the customer. Where do i set this in the new email template system ?


Custom printed hi visibility clothing sale the UK's online hivis safety shop
v4.5.2


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11392 posts

Posted 29 December 2016 - 09:05 PM #128

It's not part of the "email", but part of the 'notification'.  I.e. the 'notification' can use the new or old email methods.

This is set in the Administrion/Order statuses page for each order status and it should show on the order.details page when doing a 'save' as to whether to notify customer, orders department, vendor, etc....


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • ikoshkin
  • Tech Writer
  • CS-Cart Architects
  • Join Date: 25-Nov 15
  • 440 posts

Posted 30 December 2016 - 05:54 AM #129

In the old system we had a check box on each status to choose whether to send an email notification or not to the customer. Where do i set this in the new email template system ?


Hello. Please check this article: http://docs.cs-cart....ifications.html
Basically, with the new email template mode you go to Design > Email templates and change the status of notifications to Disabled. Depending on the tab you're on, that will disable notifications about this status for customers or for orders department. The article contains detailed instructions

 
  • johnbol1
  • Never Re
  • Members
  • Join Date: 23-Feb 10
  • 4657 posts

Posted 30 December 2016 - 07:59 PM #130

Hello. Please check this article: http://docs.cs-cart....ifications.html
Basically, with the new email template mode you go to Design > Email templates and change the status of notifications to Disabled. Depending on the tab you're on, that will disable notifications about this status for customers or for orders department. The article contains detailed instructions

Thank you !

 

Also the info in the email doesnt show my full company address, it only shows the first 2 lines, missing the zip code and county etc.

Where do i look to see where this info is pulled from


Custom printed hi visibility clothing sale the UK's online hivis safety shop
v4.5.2


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11392 posts

Posted 30 December 2016 - 08:18 PM #131

Hello. Please check this article: http://docs.cs-cart....ifications.html
Basically, with the new email template mode you go to Design > Email templates and change the status of notifications to Disabled. Depending on the tab you're on, that will disable notifications about this status for customers or for orders department. The article contains detailed instructions

So now there are 2 places to enable/disable customer notifications on status changes?  The Admin/Order Statuses and the Design/Emails pages?  That's seems rather awkward.  What is the precedence?  If status Open has 'notify customer' set in the Order statuses page and disabled in the Design Email, who wins?  Also for the reverse?

 

Why do you want to enable/disable at the Email document level versus the order status level where it's been since cs-cart inception?

 

Technically, a "notification" could be more than an email method.  A notification might be an SMS message, a push to a user's phone, etc.  Email is but one form of notification.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • johnbol1
  • Never Re
  • Members
  • Join Date: 23-Feb 10
  • 4657 posts

Posted 30 December 2016 - 09:04 PM #132

So now there are 2 places to enable/disable customer notifications on status changes?  The Admin/Order Statuses and the Design/Emails pages?  That's seems rather awkward.  What is the precedence?  If status Open has 'notify customer' set in the Order statuses page and disabled in the Design Email, who wins?  Also for the reverse?

 

Why do you want to enable/disable at the Email document level versus the order status level where it's been since cs-cart inception?

 

Technically, a "notification" could be more than an email method.  A notification might be an SMS message, a push to a user's phone, etc.  Email is but one form of notification.

I notice that when appearance>use new email notifications is chosen then the old order statuses are not able to be seen/change so I assume the only place that works then is the new method.


Custom printed hi visibility clothing sale the UK's online hivis safety shop
v4.5.2


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11392 posts

Posted 30 December 2016 - 09:07 PM #133

If so, that's a good thing.  However, I still contend that an "email" is one form of "notification" and the enable/disable should not be done at that level but should remain at the level of the order status so any type of "notification" would be controlled there.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • remoteone
  • Member
  • Members
  • Join Date: 06-Oct 09
  • 742 posts

Posted 31 December 2016 - 04:00 AM #134

 

....."email" is one form of "notification" and the enable/disable should not be done at that level but should remain at the level of the order status so any type of "notification" would be controlled there.

 

A very important point, I hope the csc team is listening,
Any SMS or other notification medium, 3rd party or otherwise is not part of the eMail template system and should be driven from the Order Status mechanism.



 
  • johnbol1
  • Never Re
  • Members
  • Join Date: 23-Feb 10
  • 4657 posts

Posted 31 December 2016 - 11:13 AM #135

If so, that's a good thing.  However, I still contend that an "email" is one form of "notification" and the enable/disable should not be done at that level but should remain at the level of the order status so any type of "notification" would be controlled there.

Id agree


Custom printed hi visibility clothing sale the UK's online hivis safety shop
v4.5.2


 
  • Daniel1003
  • Advanced Member
  • Authorized Reseller
  • Join Date: 15-Jun 12
  • 67 posts

Posted 02 January 2017 - 02:51 PM #136

Hi,

 

where can i edit the design of the email template?

 

The used colors are terrible.

Grey on grey, are you serious?


www.shopfreaks.de | CS Cart Developer


 
  • SpyreDigital
  • Junior Member
  • Authorized Reseller
  • Join Date: 01-Nov 10
  • 94 posts

Posted 27 January 2017 - 12:57 AM #137

Hi,

 

where can i edit the design of the email template?

 

The used colors are terrible.

Grey on grey, are you serious?

I second this



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

Posted 22 February 2017 - 11:03 AM #138

It is kind of disappointing that in 451 or 461 {{ o.invoice_id_text }} is hardcoded and not a snipet..
 



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

Posted 01 March 2017 - 12:09 PM #139

some of the snippets are not working at all



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

Posted 01 March 2017 - 02:43 PM #140

some of the snippets are not working at all

 

What does not work for you?