Jump to content

1.7.8.8 - Editing the back-end Order View page?


sampsonzak
 Share

Recommended Posts

Hi all, I need some help on figuring out how to edit the admin panel / back-end Order View, to make some CSS changes to the shipping address that it displays. (On my previous install of 1.7.2, this worked perfectly).

 

In my old PrestaShop 1.7.2, in this file: /admin/themes/default/template/controllers/orders/helpers/view/view.tpl, I had this code which worked perfectly: 

						<a href="#" onclick="CopyToClipboard('customer-name');return false;"><div class="customer-name" id="customer-name">{$addresses.delivery->firstname} {$addresses.delivery->lastname}</div></a>
						<a href="#" onclick="CopyToClipboard('customer-company');return false;"><div class="customer-company" id="customer-company">{$addresses.delivery->company}</div></a>
						<a href="#" onclick="CopyToClipboard('customer-address1');return false;"><div class="customer-address1" id="customer-address1">{$addresses.delivery->address1}</div>
						<a href="#" onclick="CopyToClipboard('customer-address2');return false;"><div class="customer-address2" id="customer-address2">{$addresses.delivery->address2}</div>
						<a href="#" onclick="CopyToClipboard('customer-city');return false;"><div class="customer-city" id="customer-city">{$addresses.delivery->city}</div>
						<a href="#" onclick="CopyToClipboard('customer-state');return false;"><div class="customer-state" id="customer-state">{$addresses.deliveryState->name}</div>
						<a href="#" onclick="CopyToClipboard('customer-postcode');return false;"><div class="customer-postcode" id="customer-postcode">{$addresses.delivery->postcode}</div>
						<a href="#" onclick="CopyToClipboard('customer-country');return false;"><div class="customer-country" id="customer-country">{$addresses.delivery->country}</div>
						<a href="#" onclick="CopyToClipboard('customer-phone');return false;"><div class="customer-phone" id="customer-phone">{$addresses.delivery->phone}</div>

 

In the new PrestaShop 1.7.8.8, I did a quick google and found the file (I think) that needs editing, which is: /src/PrestaShopBundle/Resources/views/Admin/Sell/Order/Order/Blocks/View/customer.html.twig

I need to replicate the above code(I think?) to replace this: 

            {% for line in orderForViewing.shippingAddressFormatted|split("\n") %}
              <p class="mb-0">{{ line }}</p>
            {% endfor %}

But I have absolutely no idea how.

 

If anyone could help, this would be really appreciated! I am willing to pay to get this working ASAP!

 

Thank you

Share this post


Link to post
Share on other sites

7 hours ago, prestashopfree.com said:

Hi, I'm happy to help.
Will you need a module for this, or just a modified twig?

Do you need to build the CopyToClipboard function directly into twig?

obrazek.png.09131c8762726cf9c7b31b237c5971ca.png

Hi,

 

I just need the code to copy/paste.

 

I also need something else adding to the same page;

If a customer has 2 or more "payment accepted" orders, to show a div at the top of the order-detail page:

 

This was my old code, I couldn't find where my last developer added the $customer_with_more_payment_accepted_status = 1 code though

	{if $customer_with_more_payment_accepted_status == 1}
	<div class="multipleorderalert" style="
		background-color: #ff0000;
		padding: 20px;
		color: #ffffff;
		font-size: 20px;
		font-weight: bold;
		text-align: center;
		margin-bottom: 15px; 
	">
			CUSTOMER HAS MORE THAN ONE ORDER with 'PAYMENT ACCEPTED' status !
	</div>
	{/if}

 

Share this post


Link to post
Share on other sites

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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More