Skip to content

Commit b0e2125

Browse files
feat: add support for SDK banner
1 parent 52f690f commit b0e2125

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

classes/admin.class.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ function product_meta() {
212212
<?php endif; ?>
213213
</div>
214214
</div>
215+
<div id="tsdk_banner" class="ppom-banner"></div>
215216
<?php
216217
echo '<p>' . __( 'You can create different meta groups for different products.', 'woocommerce-product-addon' ) . '</p>';
217218
}
@@ -238,6 +239,19 @@ function product_meta() {
238239
// existing meta group tables show only ppom main page
239240
if ( $action != 'new' && $do_meta != 'edit' && $view != 'addons' && $view != 'changelog' ) {
240241
ppom_load_template( 'admin/existing-meta.php' );
242+
243+
$should_load_banner = ! ppom_pro_is_installed();
244+
if ( ppom_pro_is_installed() ) {
245+
$license_data = get_option( 'ppom_pro_license_data', array() );
246+
$should_load_banner = isset( $license_data->plan ) &&
247+
is_numeric( $license_data->plan ) &&
248+
NM_PersonalizedProduct::LICENSE_PLAN_1 <= NM_PersonalizedProduct::get_license_category( intval( $license_data->plan ) );
249+
}
250+
251+
if ( $should_load_banner ) {
252+
do_action( 'themeisle_sdk_load_banner', 'ppom' );
253+
}
254+
241255
}
242256

243257
echo '</div>';

css/ppom-admin.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1862,3 +1862,7 @@ header.ppom-modal-header {
18621862
.ppom-wrapper a.ppom-upsell-condition:hover{
18631863
text-decoration: none;
18641864
}
1865+
1866+
.ppom-banner:has(.tsdk-banner-cta) {
1867+
margin: 20px 0;
1868+
}

0 commit comments

Comments
 (0)