General settings
print_setting_html('guests','toggle','Enable for guests','Show the subscription form for unregistred users');
$admail_settings->print_setting_html('unsubscribe','toggle','Allow users to unsubscribe',"Add an unsubscribe link to the 'subscribed' notice");
$admail_settings->print_setting_html('email_field','toggle','Show Email field for registred users','If disabled, the E-mail used during registration will be used.');
$admail_settings->print_setting_html('auto_submission','toggle','Auto Submit Notice','Automatically submit notifications once a product is back in stock.');
$popup_enabled = ambisn_get_setting('popup') == 1 ? 'enabled' : '';
echo '';
//$admail_settings->print_setting_html('ajaxify_submission','toggle','Ajax Form Submission','Enable seamless subscription submissions without page reloads.');
//Exclude by product type
$product_types = array('simple'=>'Simple', 'variable'=>'Variable', 'grouped'=>'Grouped');
$admail_settings->print_setting_html('exclude_product_type','multiselect','Exclude by product type','', $product_types);
//Exclude by categories
$categories = array();
$product_categories = get_terms( array('taxonomy' => 'product_cat'));
foreach ( $product_categories as $product_category ) {
$categories[$product_category->slug] = $product_category->name;
}
$admail_settings->print_setting_html('exclude_categories','multiselect','Exclude products by categories','', $categories);
//Exclude by tag names
$product_tag_names = get_terms( array(
'taxonomy' => 'product_tag',
'hide_empty' => false,
'fields' => 'all',
) );
$tag_id_name_array = array();
if ( ! empty( $product_tag_names ) && ! is_wp_error( $product_tag_names ) ) {
foreach ( $product_tag_names as $tag ) {
$tag_id_name_array[$tag->term_id] = $tag->name;
}
}
$admail_settings->print_setting_html('exclude_tag_names','multiselect','Exclude products by tag names','', $tag_id_name_array);
$admail_settings->print_setting_html('s-variation','toggle','Hide subscription form on variation availability','Hide the subscription form if at least one variation is in stock.');
$admail_settings->print_setting_html('prevent_dupl_subscriptions','toggle','Prevent Duplicate Subscriptions','Recommended when working with duplicated or translated products to avoid multiple subscriptions for the same product across different versions.');
$custom_position_enabled = ambisn_get_setting('enable_custom_form_position') == 1 ? 'enabled' : '';
echo '
';
$admail_settings->print_setting_html('enable_custom_form_position','toggle','Enable custom form position (BETA)','','','hider');
echo '
';
$product_positions = array(
'woocommerce_before_single_product_summary' => 'Before the product summary',
'woocommerce_single_product_summary' => 'Inside the product summary (Default)',
'woocommerce_after_single_product_summary' => 'After the product summary',
'woocommerce_after_single_product' => 'After the single product wrapper',
'woocommerce_product_thumbnails' => 'After the product image thumbnails',
'woocommerce_before_add_to_cart_form' => 'Before the add to cart form',
'woocommerce_after_add_to_cart_form' => 'After the add to cart form',
'woocommerce_before_add_to_cart_button' => 'Before the add to cart button',
'woocommerce_after_add_to_cart_button' => 'After the add to cart button',
);
$hook_priority = [ 0 => 'Priority - 0', 5 => 'Priority - 5', 10 => 'Priority - 10', 15 => 'Priority - 15' , 20 => 'Priority - 20' , 25 => 'Priority - 25', 30 => 'Priority - 30' , 35 => 'Priority - 35', 40 => 'Priority - 40' ];
$admail_settings->print_setting_html('s_products_position', 'dropdown', 'Simple products (*)', '', $product_positions);
$admail_settings->print_setting_html('s_hook_priority', 'dropdown', '', '', $hook_priority);
$admail_settings->print_setting_html('v_products_position', 'dropdown', 'Variable products (**)', '', $product_positions);
$admail_settings->print_setting_html('v_hook_priority', 'dropdown', '', '', $hook_priority);
echo '
* Adjust the priority to control the position of the subscription form on the page.
';
echo '
** The custom position for variable products will only apply if no variations are available and WooCommerce’s "Hide out of stock items from the catalog" setting is enabled.
';
echo '
';
echo '
';
?>
Manage Product Subscriptions Page
Shortcode for Product Subscriptions Page
Use the shortcode below to display the product subscriptions content on any page of your site.
[admail_product_subscriptions_page]
Customers confirmation Emails settings
print_setting_html('confirmation_email','toggle','Enable subscription confirmation Email','');
$admail_settings->print_setting_html('conf_no_reply','toggle','Enable "No reply" option','');
?>
Template Preview
Please save to update the preview
Emails settings
print_setting_html('no_reply','toggle','Enable "No reply" option','');
$admail_settings->print_setting_html('email_price','toggle','Include the product price','');
$admail_settings->print_setting_html('email_qty','toggle','Include the available quantity','');
?>
E-mail Template
print_setting_html('email_template','uniselect','Available Templates','', $email_templates);
$admail_settings->print_setting_html('email_theme_color','color','Template theme color','');
?>
Template Preview
Please save to update the preview