@@ -169,12 +169,6 @@ public function __construct() {
169169 'type ' => 'default ' ,
170170 'path ' => WooCommerce_Delivery_Notes::$ plugin_path . 'templates/print-order/ ' ,
171171 'url ' => WooCommerce_Delivery_Notes::$ plugin_url . 'templates/print-order/ ' ,
172- ),
173- array (
174- 'name ' => __ ( 'Custom template ' , 'woocommerce-delivery-notes ' ),
175- 'type ' => 'new_template ' ,
176- 'path ' => WooCommerce_Delivery_Notes::$ plugin_path . 'templates/new-template/ ' ,
177- 'url ' => WooCommerce_Delivery_Notes::$ plugin_url . 'templates/new-template/ ' ,
178172 )
179173 );
180174
@@ -321,17 +315,10 @@ public function parse_request( $wp ) {
321315 * Build the template locations
322316 */
323317 public function build_template_locations () {
318+ $ wc_template_directory = WC_TEMPLATE_PATH . 'print-order/ ' ;
319+
324320 // Get the paths for custom styles.
325- $ settings_type = get_option ( 'wcdn_template_style ' , '' );
326- if ( 'default ' === $ settings_type || '' === $ settings_type ) {
327- $ wc_template_directory = WC_TEMPLATE_PATH . 'print-order/ ' ;
328- $ plugin_path = self ::$ template_styles [0 ]['path ' ];
329- $ plugin_url = self ::$ template_styles [0 ]['url ' ];
330- } elseif ( 'new_template ' === $ settings_type ) {
331- $ wc_template_directory = WC_TEMPLATE_PATH . 'new-template/ ' ;
332- $ plugin_path = self ::$ template_styles [1 ]['path ' ];
333- $ plugin_url = self ::$ template_styles [1 ]['url ' ];
334- }
321+ $ settings_type = get_option ( 'wcdn_template_style ' );
335322 $ settings_path = null ;
336323 $ settings_url = null ;
337324 if ( isset ( $ settings_type ) && 'default ' !== $ settings_type ) {
@@ -362,10 +349,11 @@ public function build_template_locations() {
362349 ),
363350
364351 'plugin ' => array (
365- 'path ' => $ plugin_path ,
366- 'url ' => $ plugin_url ,
352+ 'path ' => self :: $ template_styles [ 0 ][ ' path ' ] ,
353+ 'url ' => self :: $ template_styles [ 0 ][ ' url ' ] ,
367354 ),
368355 );
356+
369357 return $ locations ;
370358 }
371359
0 commit comments