0

enter image description hereI'm trying to change a default setting in Magento, and I have found the solution how to change it.

The issue is I can't find the file, I need to modify items.phtml.

The path is app/design/adminhtml/default/default/template/sales/order/shipment/create/items.phtml. But I think the post was for Magento 1, I'm not 100% sure.

Where I can find the items.phtml file?

I am trying to set the Email Copy of Shipment as "Checked" as default. Please see the attached screenshot.

I found an old post where a person wanted to achieve the same and was provided this ( I found out later that the post was 9 years old):

__('Email Copy of Shipment') ?>

When created the "items.phtml" and did what was suggested in the comments nothing changed.

I did run after i inserted the file. : php bin/magento setup:upgrade and deploy, Cleared cache and re indexed.

Any help with this is appreciated.

6
  • So items.phtml overrides adminhtml right? Commented Jan 13, 2020 at 12:33
  • You can FInd this file in /vendor/magento/module-shipping/view/adminhtml/templates/view/items.phtml or also you can create a new file in app/design/adminhtml/{Vendor}/{Theme}/Magento_Shipping/templates/order/view/items.phtml Commented Jan 13, 2020 at 12:42
  • Hi, Thanks for the help, When i go to app/design/adminhtml//vendor/ - there is no directories beyond this point, I tried to do ls -la and also ls /ld to see if there is any hidden. Commented Jan 13, 2020 at 12:44
  • Hi @Jan-petterHavna you need to create app/design/adminhtml/{your_custom_vendor}/{your_custom_theme}/Magento_Shipping/templates/order/view/items.phtml (This is if it overrides adminhtm, if it overrides frontend then it will be frontend instead of adminhtml ) Commented Jan 13, 2020 at 13:40
  • @zarnParekh I did this, and nothing changes, I'm trying to set Email Copy of Shipment as selected as default. so when we push send we don't need to check this box every time. the code i was provided was this: <p> <label class="normal" for="send_email"><?php echo Mage::helper('sales')->__('Email Copy of Shipment') ?></label> <input id="send_email" name="shipment[send_email]" value="1" type="checkbox" checked="checked"/> </p> Commented Jan 13, 2020 at 14:01

1 Answer 1

0

You may be over thinking the file location. Go to the folder where magento is installed. then go to: /vendor/magento/module-shipping/view/adminhtml/templates/view/items.phtml Make your change there Then just refresh your web browser.

3
  • HI, Thank you for your answer. Is this for the admin panel? not the website it self. I found the file, and if this sis the case I do have been overthinking. However, i can not fine the line of code with Checkbox's inside this file. Can i add the code i have received inside there? Or am i on the wrong file? Commented Jan 16, 2020 at 23:38
  • Thank you for your help, this is resolved now! Commented Jan 17, 2020 at 22:41
  • I found the path and did the change in item.phtml, but i have a feeling that is safer to do this if I do it like they mention above to create custom folders etc in app//design/adminhtml: But what will the pat be there if i found it here:vendor/magento/module-shipping/view/adminhtml/templates/create/items.phtm Commented Jan 18, 2020 at 0:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.