<?php

/**
 * Fired during plugin activation
 *
 * @link       www.redefiningtheweb.com
 * @since      1.0.0
 *
 * @package    Rtwwpcp_Woocommerce_Pdf_Catalog_Pro
 * @subpackage Rtwwpcp_Woocommerce_Pdf_Catalog_Pro/includes
 */

/**
 * Fired during plugin activation.
 *
 * This class defines all code necessary to run during the plugin's activation.
 *
 * @since      1.0.0
 * @package    Rtwwpcp_Woocommerce_Pdf_Catalog_Pro
 * @subpackage Rtwwpcp_Woocommerce_Pdf_Catalog_Pro/includes
 * @author     RedefiningTheWeb <developer@redefiningtheweb.com>
 */
class Rtwwpcp_Woocommerce_Pdf_Catalog_Pro_Activator {

	/**
	 * Short Description. (use period)
	 *
	 * Long Description.
	 *
	 * @since    1.0.0
	 */
	public static function rtwwpcp_activate() 
	{
		if ( get_option( 'default_catalog_format' ) == '' ) 
		{
			$rtwwpcp_default_pdf_layout = '
			<div>
				<div style="width: 50%; float: left; padding: 1%;">
					<div id="rtwwcpcp_img" style="width: 48%; float: left;"><img style="max-width: 100%; width: auto; padding: 5px; height: 200px;" src="[thumb_img_1]" /></div>
					<div id="rtwwcpcp_img" style="width: 48%; float: left;"><img style="max-width: 100%; width: auto; padding: 5px; height: 200px;" src="[thumb_img_2]" /></div>
					<div id="rtwwcpcp_img" style="width: 48%; float: left;"><img style="max-width: 100%; width: auto; padding: 5px; height: 200px;" src="[thumb_img_3]" /></div>
					<div id="rtwwcpcp_img" style="width: 48%; float: left;"><img style="max-width: 100%; width: auto; padding: 5px; height: 200px;" src="[thumb_img_4]" /></div>
				</div>
				<div style="width: 45%; float: left; padding: 1%;">
					<div style="font-family: sans-serif; width: 100%; border-collapse: collapse;">
						<div>
							<div style="font-size: 24px; font-weight: bold; color: #212121;">[product_name]</div>
						</div>
						<div>
							<div style="font-size: 17px; padding: 7px 0; color: #212121; font-weight: bold;"><span style="color: #fdcc0d; font-size: 20px;">★</span> <span style="color: #fdcc0d; font-size: 20px; verical-align: middle;">★</span> <span style="color: #fdcc0d; font-size: 20px;">★</span> <span style="color: #fdcc0d; font-size: 20px;">★</span> <span style="color: #fdcc0d; font-size: 20px;">★</span>
							</div>
						</div>
						<div style="font-size: 16px;">[product_price]</div>
						<div style="width: 100%; margin-top: 5px;">[product_category]</div>
						<div id="rtwwpcp_variation_list">
							<div style="padding-top: 10px;">[variation]</div>
						</div>
						<div>
							<div style="padding-top: 16px; font-size: 13px; line-height: 18px; font-family: sans-serif;">[product_short_desc]</div>
						</div>
						<div style="text-align: center; padding-top: 15px;">
							<div style="background-color: #d93c50; color: #ffffff; float-right;text-align: center; padding 10px; line-height: 45px; height: 45px; width: 200px;"><a style="color: #ffffff; text-decoration: none; font-size: 18px; font-weight: bold; letter-spacing: 2px; text-align: center;" href="[add_to_cart]">Add To Cart</a>
							</div>
						</div>
					</div>
				</div>
			</div>
			<table style="font-family: sans-serif; width: 100%; border-collapse: collapse;" cellspacing="0" cellpadding="0">
				<tbody>
					<tr>
						<td style="padding: 1px 35px 0 35px; background-color: #efefef;" colspan="4"> </td>
					</tr>
					<tr>
						<td style="padding: 20px 35px 0 35px; font-size: 16px; color: #212121; line-height: 26px; font-weight: bold;" colspan="4">Product Description</td>
					</tr>
					<tr>
						<td style="padding: 20px 35px; font-size: 13px; line-height: 18px;" colspan="4">[product_desc]</td>
					</tr>
					<tr>
						<td style="padding: 1px 35px 0 35px; background-color: #efefef;" colspan="4"> </td>
					</tr>
					<tr id="rtwwpcp_similar_prod">
						<td style="font-size: 18px; font-weight: bold; color: #212121; padding: 15px; text-align: center;" colspan="4">Similar Products</td>
					</tr>
					<tr id="relate_prod_tr">
						<td style="width: 25%; padding: 15px; text-align: center;" width="25%">
							<table id="rtwwpcp_relat_prod" style="font-family: sans-serif; width: 180px; border-collapse: collapse;" cellspacing="0" cellpadding="0">
								<tbody>
									<tr>
										<td><img style="width: auto; max-width: 180px; height: 200px;" src="[relate_img_1]" /></td>
									</tr>
									<tr id="rtwwpcp_relat_prod_tr">
										<td style="font-size: 16px; font-weight: normal; padding-top: 10px; padding-bottom: 10px;">[relate_prod_1]</td>
									</tr>
									<tr>
										<td id="rtwwpcp_add_to_cart" style="font-size: 16px; font-weight: normal; background-color: #d93c50; height: 30px;"><a style="color: #ffffff; text-decoration: none;" href="[add_to_cart_1]">Buy Now</a></td>
									</tr>
								</tbody>
							</table>
						</td>
						<td style="width: 25%; padding: 15px; text-align: center;" width="25%">
							<table id="rtwwpcp_relat_prod" style="font-family: sans-serif; width: 180px; border-collapse: collapse;" cellspacing="0" cellpadding="0">
								<tbody>
									<tr>
										<td><img style="width: auto; max-width: 180px; height: 200px;" src="[relate_img_2]" /></td>
									</tr>
									<tr id="rtwwpcp_relat_prod_tr">
										<td style="font-size: 16px; font-weight: normal; padding-top: 10px; padding-bottom: 10px;">[relate_prod_2]</td>
									</tr>
									<tr>
										<td id="rtwwpcp_add_to_cart" style="font-size: 16px; font-weight: normal; background-color: #d93c50; height: 30px;"><a style="color: #ffffff; text-decoration: none;" href="[add_to_cart_2]">Buy Now</a></td>
									</tr>
								</tbody>
							</table>
						</td>
						<td style="width: 25%; padding: 15px; text-align: center;" width="25%">
							<table id="rtwwpcp_relat_prod" style="font-family: sans-serif; width: 180px; border-collapse: collapse;" cellspacing="0" cellpadding="0">
								<tbody>
									<tr>
										<td><img style="width: auto; max-width: 180px; height: 200px;" src="[relate_img_3]" /></td>
									</tr>
									<tr id="rtwwpcp_relat_prod_tr">
										<td style="font-size: 16px; font-weight: normal; padding-top: 10px; padding-bottom: 10px;">[relate_prod_3]</td>
									</tr>
									<tr>
										<td id="rtwwpcp_add_to_cart" style="font-size: 16px; font-weight: normal; background-color: #d93c50; height: 30px;"><a style="color: #ffffff; text-decoration: none;" href="[add_to_cart_3]">Buy Now</a></td>
									</tr>
								</tbody>
							</table>
						</td>
						<td style="width: 25%; padding: 15px; text-align: center;" width="25%">
							<table id="rtwwpcp_relat_prod" style="font-family: sans-serif; width: 180px; border-collapse: collapse;" cellspacing="0" cellpadding="0">
								<tbody>
									<tr>
										<td><img style="width: auto; max-width: 180px; height: 200px;" src="[relate_img_4]" /></td>
									</tr>
									<tr id="rtwwpcp_relat_prod_tr">
										<td style="font-size: 16px; font-weight: normal; padding-top: 10px; padding-bottom: 10px;">[relate_prod_4]</td>
									</tr>
									<tr>
										<td id="rtwwpcp_add_to_cart" style="font-size: 16px; font-weight: normal; background-color: #d93c50; height: 30px;"><a style="color: #ffffff; text-decoration: none;" href="[add_to_cart_4]">Buy Now</a></td>
									</tr>
								</tbody>
							</table>
						</td>
					</tr>
				</tbody>
			</table>';

			update_option("default_catalog_format", $rtwwpcp_default_pdf_layout);

		}
	}
}
