Jump to content

Private note in BO order details no longer works after upgrade from 1.7.6.5 to 1.7.8.7 - SOLVED!


Recommended Posts

When a new customer places an order, I am no longer able to add a private note on the order details page in the BO.  When I click the "+" symbol, nothing happens.

If a returning customer places an order, I am able to add-on to previously created private notes.

Can anyone help me solve this issue and restore the private note functionality?

privatenote.jpgexistingprivatenote.jpg

Edited by robfo541 (see edit history)
Link to comment
Share on other sites

I was able to solve the issue myself after some hours of tinkering. 


I had to edit the file src/PrestaShopBundle/Resources/views/Admin/Sell/Order/Order/Blocks/View/customer.html.twig

This is the section of code causing the issue:

 

<div id="privateNote" class="mt-2 info-block">
        <div class="row">
          {% set isPrivateNoteOpen = not orderForViewing.customer.privateNote is empty %}

          <div class="col-md-6">
            <h3 class="mb-0{{ not isPrivateNoteOpen ? ' d-print-none': '' }}">
              {{ 'Private note'|trans({}, 'Admin.Orderscustomers.Feature') }}
            </h3>
          </div>
          <div class="col-md-6 text-right d-print-none">
            <a href="#"
               class="float-right tooltip-link js-private-note-toggle-btn {% if isPrivateNoteOpen %}is-opened{% endif %}"
            >
              {% if isPrivateNoteOpen %}
                <i class="material-icons">remove</i>
              {% else %}
                <i class="material-icons">add</i>
              {% endif %}
            </a>
          </div>

          <div class="col-md-12 mt-3 js-private-note-block {% if not isPrivateNoteOpen %}d-none{% endif %}">
            {{ form_start(privateNoteForm, {
              'action': path('admin_customers_set_private_note', {
                'customerId': orderForViewing.customer.id,
                'back': path('admin_orders_view', {'orderId': orderForViewing.id})
              })
              }) }}

              {{ form_widget(privateNoteForm.note) }}
              <div class="d-none">
                {{ form_rest(privateNoteForm) }}
              </div>

              <div class="mt-2 text-right">
                <button type="submit"
                        class="btn btn-primary btn-sm js-private-note-btn"
                        {% if orderForViewing.customer.privateNote is empty %}disabled{% endif %}
                >
                  {{ 'Save'|trans({}, 'Admin.Actions') }}
                </button>
              </div>
            {{ form_end(privateNoteForm) }}
          </div>
        </div>
      </div>
    {% endif %}
  </div>
</div>

 

 

Delete the above section and replace with the following:

 

 

 <div id="privateNote" class="mt-2 info-block">
        
          <div class="col-md-12 mt-3 js-private-note-block">
            {{ form_start(privateNoteForm, {
              'action': path('admin_customers_set_private_note', {
                'customerId': orderForViewing.customer.id,
                'back': path('admin_orders_view', {'orderId': orderForViewing.id})
              })
              }) }}

              {{ form_widget(privateNoteForm.note) }}
              <div class="d-none">
                {{ form_rest(privateNoteForm) }}
              </div>

              <div class="mt-2 text-right">
                <button type="submit"
                        class="btn btn-primary btn-sm js-private-note-btn"
                        {% endif %}
                >
                  {{ 'Save'|trans({}, 'Admin.Actions') }}
                </button>
              </div>
            {{ form_end(privateNoteForm) }}
          </div>
        </div>
      </div>
  </div>
</div>

 

This will solve the issue by removing all of the code pertaining to the private note "toggle" button.  The private note field will now be shown expanded by default on the order details page.

I hope you all find this helpful :)

 

  • Like 1
Link to comment
Share on other sites

  • robfo541 changed the title to Private note in BO order details no longer works after upgrade from 1.7.6.5 to 1.7.8.7 - SOLVED!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...