Hello,
I would like to hide the "Print Invoice", "Create Invoice" and "Generate Invoice as PDF" buttons on the Vendor panel.
So that the vendor can only print delivery bills. I already looked at a discussion with code changes, but that doesn't seem to work anymore:
https://forum.cs-cart.com/topic/47399-how-to-remove-print-invoice-options-from-orders/
:-(
Ok, I do it for myself. If anybody needs the same solution, here we go:
Edit the file /design/backend/templates/views/orders
Find
{btn type="list" text=$print_order href="orders.print_invoice?order_id=`$order_info.order_id`" class="cm-new-window"}
{if $settings.Appearance.email_templates === "new"}
{btn type="list" text=__("edit_and_send_invoice") href="orders.modify_invoice?order_id=`$order_info.order_id`"}
{/if}
Change it to:
{*
{btn type="list" text=$print_order href="orders.print_invoice?order_id=`$order_info.order_id`" class="cm-new-window"}
{if $settings.Appearance.email_templates === "new"}
{btn type="list" text=__("edit_and_send_invoice") href="orders.modify_invoice?order_id=`$order_info.order_id`"}
{/if} *}
Hi!
I do not recommend to make any changes directly in the core files, but instead make them via add-on. For example, by using hook in the My changes add-on, you can achieve the necessary result. Create the design/backend/templates/addons/my_changes/hooks/orders/details_tools.override.tpl template with the following content:
{btn type="list" text=__("print_packing_slip") href="orders.print_packing_slip?order_id=`$order_info.order_id`" class="cm-new-window"}
{btn type="list" text=__("edit_order") href="order_management.edit?order_id=`$order_info.order_id`"}
{btn type="list" text=__("copy") href="order_management.edit?order_id=`$order_info.order_id`©=1"}
{btn type="list"
text=__("delete")
href="orders.delete?order_id={$order_info.order_id}&redirect_url=orders.manage"
class="cm-confirm"
method="POST"
}
{$smarty.capture.adv_tools nofilter}
Install and enable the My Changes add-on and clear the cache of your installation.
I hope it will help you.
Hi!
I do not recommend to make any changes directly in the core files, but instead make them via add-on. For example, by using hook in the My changes add-on, you can achieve the necessary result. Create the design/backend/templates/addons/my_changes/hooks/orders/details_tools.override.tpl template with the following content:
{btn type="list" text=__("print_packing_slip") href="orders.print_packing_slip?order_id=`$order_info.order_id`" class="cm-new-window"}
{btn type="list" text=__("edit_order") href="order_management.edit?order_id=`$order_info.order_id`"}
{btn type="list" text=__("copy") href="order_management.edit?order_id=`$order_info.order_id`©=1"}
{btn type="list"
text=__("delete")
href="orders.delete?order_id={$order_info.order_id}&redirect_url=orders.manage"
class="cm-confirm"
method="POST"
}
{$smarty.capture.adv_tools nofilter}
Install and enable the My Changes add-on and clear the cache of your installation.
I hope it will help you.
Oh, thank you for this solution. :grin: