Skip to content

Instantly share code, notes, and snippets.

@kjohnson
Created September 26, 2019 17:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kjohnson/dc3cea3a4905b705dfc903c7c69be118 to your computer and use it in GitHub Desktop.
Save kjohnson/dc3cea3a4905b705dfc903c7c69be118 to your computer and use it in GitHub Desktop.
<?php
add_filter( 'ninja_shop_possible_template_paths', function( $paths ) {
$paths[] = dirname( __FILE__ ) . '/templates/';
return $paths;
} );
<?php
/**
* This is the modified template for our checkout instance,
* which returns an empty div to omit the Edit Cart link
* from the workflow.
*/
?>
<?php do_action( 'ninja_shop_content_checkout_before_cancel_element' ); ?>
<div class="ninja-shop-checkout_cancel hidden">
</div>
<?php do_action( 'ninja_shop_content_checkout_after_cancel_element' ); ?>
@kjohnson
Copy link
Author

Ninja Shop templates can be customized by loading a different file, which will be given preference over the initial template file.

  • Add the filter ninja_shop_possible_template_paths and append a new template path.
  • In the new template path, create template files with names matching the template in Ninja Shop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment