Skip to content

Instantly share code, notes, and snippets.

@webtoffee-git
Created July 18, 2024 12:10
Show Gist options
  • Save webtoffee-git/c0ee23e40d782dc2f4a86216a5589c14 to your computer and use it in GitHub Desktop.
Save webtoffee-git/c0ee23e40d782dc2f4a86216a5589c14 to your computer and use it in GitHub Desktop.
Code to disable the assembly cost option provided by Product Assembly / Gift Wrap / Plugin - By WebToffee (WebToffee WooCommerce Gift Cards)
<?php //Do not copy this line of code
function wt_admin_show_assembly_cost_on_giftcard() {
?>
<script>
jQuery(document).ready(function() {
setTimeout(function() {
if(jQuery('._wt_gc_amounts_field').length){
jQuery('._has_assembly_field').insertAfter('._wt_gc_amounts_field');
jQuery('._disable_assembly_field').insertAfter('._wt_gc_amounts_field');
jQuery('._assembly_cost_field').insertAfter('._wt_gc_amounts_field');
jQuery('._has_assembly_field ._assembly_cost_field ._disable_assembly_field').show();
}
}, 3000);
});
</script>
<?php
}
add_action('admin_footer', 'wt_admin_show_assembly_cost_on_giftcard');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment