Skip to content

Commit

Permalink
feat: add support for SDK banner
Browse files Browse the repository at this point in the history
  • Loading branch information
Soare-Robert-Daniel committed Nov 4, 2024
1 parent efb0ba6 commit 368ab1c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
14 changes: 14 additions & 0 deletions classes/admin.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ function product_meta() {
<?php endif; ?>
</div>
</div>
<div id="tsdk_banner" class="ppom-banner"></div>
<?php
echo '<p>' . __( 'You can create different meta groups for different products.', 'woocommerce-product-addon' ) . '</p>';
}
Expand All @@ -238,6 +239,19 @@ function product_meta() {
// existing meta group tables show only ppom main page
if ( $action != 'new' && $do_meta != 'edit' && $view != 'addons' && $view != 'changelog' ) {
ppom_load_template( 'admin/existing-meta.php' );

$should_load_banner = ! ppom_pro_is_installed();
if ( ppom_pro_is_installed() ) {
$license_data = get_option( 'ppom_pro_license_data', array() );
$should_load_banner = isset( $license_data->plan ) &&
is_numeric( $license_data->plan ) &&
NM_PersonalizedProduct::LICENSE_PLAN_1 <= NM_PersonalizedProduct::get_license_category( intval( $license_data->plan ) );
}

if ( $should_load_banner ) {
do_action( 'themeisle_sdk_load_banner', 'ppom' );
}

}

echo '</div>';
Expand Down
4 changes: 4 additions & 0 deletions css/ppom-admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -1862,3 +1862,7 @@ header.ppom-modal-header {
.ppom-wrapper a.ppom-upsell-condition:hover{
text-decoration: none;
}

.ppom-banner:has(.tsdk-banner-cta) {
margin: 20px 0;
}

0 comments on commit 368ab1c

Please sign in to comment.