<?php

namespace WooSwatches\Modules;

use WooSwatches\Base\Module;

final class Archive_Shop extends Module {

	public function __construct() {
		parent::__construct();
	}

	public function default_settings() {
		return array(
			'enable_swatches'      => false,
			'enable_preloader'     => true,
			'default_selected'     => false,
			'display_pos'          => 'before_cart',
			'attr_display_limit'   => '',
			'more_attribute_style' => 'more_text',
			'show_clear_link'      => false,
			'swatches_align'       => 'center'
		);
	}

	function validate_settings( $settings ) {
		$settings['enable_swatches']       = wp_validate_boolean( $settings['enable_swatches'] );
		$settings['enable_preloader']      = wp_validate_boolean( $settings['enable_preloader'] );
		$settings['default_selected']      = wp_validate_boolean( $settings['default_selected'] );
		$settings['display_pos']           = sanitize_key( $settings['display_pos'] );
		$settings['attr_display_limit']    = sanitize_text_field( $settings['attr_display_limit'] );
		$settings['more_attribute_style']  = sanitize_key( $settings['more_attribute_style'] );
		$settings['show_clear_link']       = wp_validate_boolean( $settings['show_clear_link'] );
		$settings['swatches_align']        = sanitize_key( $settings['swatches_align'] );
		return $settings;
	}

}