<?php

/**
 * Free Showcase Integration Class
 */

namespace Simple_Giveaways;

if ( ! defined( 'ABSPATH' ) ) {
	return;
}

if ( ! class_exists( 'SG_WooCommerce_Dummy' ) ) {
	class SG_WooCommerce_Dummy extends GA_Integration {

		/**
		 * Get Categories
		 *
		 * @return string[]
		 */
		public function get_categories() {
			return [
				'ecommerce',
			];
		}

		/**
		 * Setting initial params
		 */
		public function __construct() {

			$this->title       = __( 'WooCommerce', 'giveasap' );
			$this->settings_id = 'sg_woocommerce';
			$this->image       = untrailingslashit( GASAP_URI ) . '/includes/integrations/assets/woocommerce_logo.svg';
			$this->desc        = __( 'Award users for purchasing your products. Increase sales.', 'giveasap' );
		}

		public function buttons( $integrations ) {
			echo '<a href="' . esc_url( giv_fs()->get_upgrade_url() ) . '" class="button button-primary">' . esc_html__( 'Upgrade to Business', 'giveasap' ) . '</a>';
		}

	}
}

add_filter( 'giveasap_integrations', '\Simple_Giveaways\sg_woocommerce_integration' );

/**
 * Registering mailchimp
 *
 * @return array
 */
function sg_woocommerce_integration( $integrations ) {

	$integrations['sg_woocommerce'] = '\Simple_Giveaways\SG_WooCommerce_Dummy';

	return $integrations;
}
