wordpress - Overriding admin views in WooCommerce -


I know that you override WooCommerce main templates by defining your own and giving them the same name as the original template can do. But what I want to do, is to change some bits of administration view, i.e. the order editing screen.

The file I would like to zoom in / include / admin / meta-box / view / html-order-item.php but obviously I do not want to apply the changes in the core file because My change will be lost on the next WooCommerce update.

Is there a way in which I will run my own html core order-item.php file instead of the core? I've been searching for a long time, but I can not understand it ...

Thank you!

You will have a hard time removing the features from those screens after the plug-in is upgraded Too much code will need to be replaced. I think you can hide or change anything with CSS styles.

What you can do, add your attributes to different do_action calls, for example, in html-order-items.php The file specified contains the following action call:

 Include  ('html-order-item .php'); Do_action ('woocommerce_order_item_'. $ Item ['type']. '_html', $ item_id, $ item);   

You can hook into your own area.

> You have three more hooks:

  & lt ;? Php do_action ('woocommerce_before_order_itemmeta', $ item_id, $ item, $ _product)? & Gt; & Lt ;? Php do_action ('woocommerce_after_order_itemmeta', $ item_id, $ item, $ _product)? & Gt; & Lt ;? Php do_action ('woocommerce_admin_order_item_values', $ _product, $ item, absent ($ item_id)); ? & Gt;   

You may also need to look at the hooks to save data.

Edit: To exclude items in the list of meta fields, add: function remove_order_item_meta_fields ($ field) {$ fields [] = '_subscription_period'; $ Field [] = '_subscription_interval'; Return $ field; } Add_filter ('woocommerce_hidden_order_itemmeta', 'remove_order_item_meta_fields');

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -