<?php

namespace DropshippingExportFreeVendor;

/**
 * @var string $title
 * @var string $mode
 * @var bool $edit
 * @var \Core\Infrastructure\View\FormView $form
 * @var WPDesk\View\Renderer\Renderer $renderer
 */
use DropshippingExportFreeVendor\WPDesk\Library\DropshippingExport\Form\Fields\ExportMapperFormFields;
use DropshippingExportFreeVendor\WPDesk\Library\DropshippingExport\Form\Fields\Component\ProductFieldsComponent;
use DropshippingExportFreeVendor\WPDesk\Library\DropshippingExport\Action\Loader\Plugin\PluginLinksLoaderAction;
$renderer->output_render('Header', ['title' => $title]);
$is_pl_lang = PluginLinksLoaderAction::is_pl_lang();
?>

<h2>
<?php 
// TRANSLATORS: %s: page step.
echo \esc_html(\sprintf(\__('Step %s', 'dropshipping-export-free'), '3/4'));
?>
</h2>
<p>
<?php 
$docs_url = $is_pl_lang ? 'https://wpdesk.link/export-docs-step3-pl' : 'https://wpdesk.link/export-docs-step3';
echo \wp_kses_post(\sprintf(\__('Choose the product fields and advanced settings for exported data. Read more in the plugin <a href="%s" target="_blank">documentation</a>.', 'dropshipping-export-free'), $docs_url));
?>
</p>
<hr>
<?php 
$form->form_start(['method' => 'POST', 'template' => 'form-start-no-table']);
?>
<div class="flex-container">

<div class="wrap-condition single-condition flex-row" id="dropshipping-export-mapper">
	<div class="flex-col width-100 flex-col-start">
		<div class="flex-container">
			<div class="flex-row stretch flex-fields">
				<div class="flex-col">
					<div class="dropshipping-accordion width-100">
						<h3 data-profile-id="fields">
							<span style="display: inline-block;"><p><strong><?php 
\esc_html_e('Product fields', 'dropshipping-export-free');
?></strong></p></span>
							<span class="docs-text" style="display: inline-block;"><p>
							<?php 
$docs_url = $is_pl_lang ? 'https://wpdesk.link/export-docs-product-fields-pl' : 'https://wpdesk.link/export-docs-product-fields';
echo \wp_kses_post(\sprintf(\__('Read more about this functionality in the <a class="docs-url" href="%s" target="_blank">documentation</a>.', 'dropshipping-export-free'), $docs_url));
?>
</span>
						</h3>
						<div>
							<?php 
$form->show_field(ProductFieldsComponent::PRODUCT_FIELDS);
?>
													</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="flex-col width-100 flex-col-start">
		<div class="flex-container">
			<div class="flex-row stretch flex-fields fields-7">
				<div class="flex-col flex-col-start flex-col-column">
					<div class="dropshipping-accordion width-100">
						<h3 data-profile-id="attributes">
							<span style="display: inline-block;"><p><strong><?php 
\esc_html_e('Product attributes', 'dropshipping-export-free');
?></strong></p></span>
							<span class="docs-text" style="display: inline-block;"><p>
							<?php 
$docs_url = $is_pl_lang ? 'https://wpdesk.link/export-docs-attributes-pl' : 'https://wpdesk.link/export-docs-attributes';
echo \wp_kses_post(\sprintf(\__('Read more about this functionality in the <a class="docs-url" href="%s" target="_blank">documentation</a>.', 'dropshipping-export-free'), $docs_url));
?>
</span>
						</h3>
						<div>
							<h4><?php 
\esc_html_e('Select attributes', 'dropshipping-export-free');
?></h4>
							<p style="font-size: 10px;"><?php 
\esc_html_e('Select the attributes you want to export. You can select all attributes, of which exclude some.', 'dropshipping-export-free');
?></p>
							<table class="form-table" style="width:100%; max-width: 100%;">
								<tbody>
									<tr>
										<td>
											<?php 
$form->show_field(ExportMapperFormFields::PRODUCT_ATTRIBUTES_SELECT);
?>
										</td>
										<td style="width:50px">
											<span id="product_attributes_values_label"><?php 
$form->show_label(ExportMapperFormFields::PRODUCT_ATTRIBUTES_VALUES);
?></span>
										</td>
										<td>
											<?php 
$form->show_field(ExportMapperFormFields::PRODUCT_ATTRIBUTES_VALUES);
?>
										</td>
									</tr>
									<tr>
										<td colspan="2">
											<?php 
$form->show_field(ExportMapperFormFields::PRODUCT_ATTRIBUTES_AS_SINGLE_VALUE);
?>
											<?php 
$form->show_label(ExportMapperFormFields::PRODUCT_ATTRIBUTES_AS_SINGLE_VALUE);
?>
										</td>
									</tr>							
								</tbody>
							</table>
						</div>
					</div>
					<div class="dropshipping-accordion width-100">
						<h3 data-profile-id="advanced">
							<span style="display: inline-block;"><p><strong><?php 
\esc_html_e('Advanced', 'dropshipping-export-free');
?></strong></p></span>
							<span class="docs-text" style="display: inline-block;"><p>
							<?php 
$docs_url = $is_pl_lang ? 'https://wpdesk.link/export-docs-advanced-pl' : 'https://wpdesk.link/export-docs-advanced';
echo \wp_kses_post(\sprintf(\__('Read more about this functionality in the <a class="docs-url" href="%s" target="_blank">documentation</a>.', 'dropshipping-export-free'), $docs_url));
?>
</span>
						</h3>
						<div>
							<h4><?php 
\esc_html_e('Price modifier', 'dropshipping-export-free');
?></h4>
							<?php 
$form->show_field(ExportMapperFormFields::PRODUCT_ADVANCED_PRICE_MOD);
?>

							<h4><?php 
\esc_html_e('Stock modifier', 'dropshipping-export-free');
?></h4>
							<?php 
$form->show_field(ExportMapperFormFields::PRODUCT_ADVANCED_STOCK_MOD);
?>
				
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<?php 
$renderer->output_render('Steps', ['mode' => $mode, 'edit' => $edit, 'form' => $form, 'previous_step' => $previous_step]);
?>
<input type="hidden" name="file_mode" id="file_mode" value="<?php 
echo \esc_attr($mode);
?>">
<?php 
$form->form_fields_complete();
$form->form_end(['template' => 'form-end-no-table']);
?>

<?php 
$renderer->output_render('Footer');
