Ar_Model_Viewer_For_Woocommerce_Admin_Pro
in package
The admin-specific functionality of the plugin.
Defines the plugin name, version, and two hooks to enqueue the admin-facing stylesheet and JavaScript. As you add hooks and methods, update this description.
Tags
Table of Contents
Properties
- $plugin_name : string
- The ID of this plugin.
- $plugin_prefix : string
- The unique prefix of this plugin.
- $version : string
- The version of this plugin.
Methods
- __construct() : mixed
- Initialize the class and set its properties.
- ar_model_viewer_for_woocommerce_add_column_to_importer() : array<string|int, mixed>
- Register the columns in the importer.
- ar_model_viewer_for_woocommerce_add_column_to_mapping_screen() : array<string|int, mixed>
- Add automatic mapping support for Custom Columns.
- ar_model_viewer_for_woocommerce_add_export_column() : array<string|int, mixed>
- Add the custom column to the exporter and the exporter column menu.
- ar_model_viewer_for_woocommerce_add_export_data_file_alt() : mixed
- Provide the data to be exported for the Alt for 3D Model column.
- ar_model_viewer_for_woocommerce_add_export_data_file_android() : mixed
- Provide the data to be exported for the Android .glb URL column.
- ar_model_viewer_for_woocommerce_add_export_data_file_ios() : mixed
- Provide the data to be exported for the IOS .usdz URL column.
- ar_model_viewer_for_woocommerce_add_export_data_file_poster() : mixed
- Provide the data to be exported for the Poster for 3D Model column.
- ar_model_viewer_for_woocommerce_pro_metaboxes() : mixed
- ar_model_viewer_for_woocommerce_process_import() : WC_Product
- Process the data read from the CSV file.
- register_ar_model_viewer_widget() : mixed
Properties
$plugin_name
The ID of this plugin.
private
string
$plugin_name
The ID of this plugin.
Tags
$plugin_prefix
The unique prefix of this plugin.
private
string
$plugin_prefix
The string used to uniquely prefix technical functions of this plugin.
Tags
$version
The version of this plugin.
private
string
$version
The current version of this plugin.
Tags
Methods
__construct()
Initialize the class and set its properties.
public
__construct(string $plugin_name, string $plugin_prefix, string $version) : mixed
Parameters
- $plugin_name : string
-
The name of this plugin.
- $plugin_prefix : string
-
The unique prefix of this plugin.
- $version : string
-
The version of this plugin.
Tags
ar_model_viewer_for_woocommerce_add_column_to_importer()
Register the columns in the importer.
public
ar_model_viewer_for_woocommerce_add_column_to_importer(array<string|int, mixed> $options) : array<string|int, mixed>
Registers custom columns for the WooCommerce product importer. These columns allow adding URLs and other configurations specific to 3D models used in the AR (Augmented Reality) viewer.
Parameters
- $options : array<string|int, mixed>
-
Array containing the options for columns to be registered in the importer.
Return values
array<string|int, mixed> —$options Returns the array of options with the new columns added.
ar_model_viewer_for_woocommerce_add_column_to_mapping_screen()
Add automatic mapping support for Custom Columns.
public
ar_model_viewer_for_woocommerce_add_column_to_mapping_screen(array<string|int, mixed> $columns) : array<string|int, mixed>
This function adds support for automatically mapping custom columns in the product importer mapping screen in WooCommerce. It links potential column names displayed to the user with their corresponding database slugs.
Parameters
- $columns : array<string|int, mixed>
-
Array containing the current column mappings in the importer screen.
Return values
array<string|int, mixed> —$columns Returns the array of columns with new mappings for custom fields.
ar_model_viewer_for_woocommerce_add_export_column()
Add the custom column to the exporter and the exporter column menu.
public
ar_model_viewer_for_woocommerce_add_export_column(array<string|int, mixed> $columns) : array<string|int, mixed>
This function registers custom columns in the WooCommerce product exporter. These columns will allow exporting specific meta data related to 3D model files for Android, iOS, and additional model properties like the poster image and alt text. These will be selectable in the export options.
Parameters
- $columns : array<string|int, mixed>
-
Array of available columns for export.
Return values
array<string|int, mixed> —$columns Returns the updated array of columns with the new custom fields.
ar_model_viewer_for_woocommerce_add_export_data_file_alt()
Provide the data to be exported for the Alt for 3D Model column.
public
ar_model_viewer_for_woocommerce_add_export_data_file_alt(mixed $value, WC_Product $product) : mixed
This function retrieves the value for the Alt text of the 3D model from the product meta data and formats it for export.
Parameters
- $value : mixed
-
(default: '') The current value of the export column.
- $product : WC_Product
-
The product being exported.
Return values
mixed —$value The value that will be exported, should be in a format compatible with text files.
ar_model_viewer_for_woocommerce_add_export_data_file_android()
Provide the data to be exported for the Android .glb URL column.
public
ar_model_viewer_for_woocommerce_add_export_data_file_android(mixed $value, WC_Product $product) : mixed
This function retrieves the value for the Android .glb URL from the product meta data and formats it for export.
Parameters
- $value : mixed
-
(default: '') The current value of the export column.
- $product : WC_Product
-
The product being exported.
Return values
mixed —$value The value that will be exported, should be in a format compatible with text files.
ar_model_viewer_for_woocommerce_add_export_data_file_ios()
Provide the data to be exported for the IOS .usdz URL column.
public
ar_model_viewer_for_woocommerce_add_export_data_file_ios(mixed $value, WC_Product $product) : mixed
This function retrieves the value for the IOS .usdz URL from the product meta data and formats it for export.
Parameters
- $value : mixed
-
(default: '') The current value of the export column.
- $product : WC_Product
-
The product being exported.
Return values
mixed —$value The value that will be exported, should be in a format compatible with text files.
ar_model_viewer_for_woocommerce_add_export_data_file_poster()
Provide the data to be exported for the Poster for 3D Model column.
public
ar_model_viewer_for_woocommerce_add_export_data_file_poster(mixed $value, WC_Product $product) : mixed
This function retrieves the value for the Poster for 3D Model from the product meta data and formats it for export.
Parameters
- $value : mixed
-
(default: '') The current value of the export column.
- $product : WC_Product
-
The product being exported.
Return values
mixed —$value The value that will be exported, should be in a format compatible with text files.
ar_model_viewer_for_woocommerce_pro_metaboxes()
public
ar_model_viewer_for_woocommerce_pro_metaboxes() : mixed
ar_model_viewer_for_woocommerce_process_import()
Process the data read from the CSV file.
public
ar_model_viewer_for_woocommerce_process_import(WC_Product $object, array<string|int, mixed> $data) : WC_Product
This function processes the custom data imported from the CSV file for each product. It saves the imported values as metadata for the WooCommerce product. You can extend this to handle more fields or perform other actions with the data.
Parameters
- $object : WC_Product
-
- Product being imported or updated.
- $data : array<string|int, mixed>
-
- CSV data read for the product.
Return values
WC_Product —$object - Returns the updated product object with custom meta data saved.
register_ar_model_viewer_widget()
public
register_ar_model_viewer_widget(mixed $widgets_manager) : mixed
Parameters
- $widgets_manager : mixed