Skip to content

Commit c3e8160

Browse files
committed
Plugin: BuyCourses: Fix deprecated method call error on service description page
1 parent fdfa4c5 commit c3e8160

2 files changed

Lines changed: 1 addition & 6 deletions

File tree

public/plugin/BuyCourses/src/service_information.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,6 @@
7777
$serviceDetailsHtml = (string) $service['description'];
7878
}
7979

80-
$serviceImage = !empty($service['image'])
81-
? (string) $service['image']
82-
: Template::get_icon_path('session_default.png');
83-
8480
$durationDays = (int) ($service['duration_days'] ?? 0);
8581
$durationLabel = $durationDays > 0
8682
? $durationDays.' '.($durationDays === 1 ? 'day' : 'days')
@@ -111,7 +107,6 @@
111107
$template = new Template($service['name'] ?? $plugin->get_lang('ServiceInformation'));
112108
$template->assign('service', $service);
113109
$template->assign('service_sale', $serviceSale);
114-
$template->assign('service_image', $serviceImage);
115110
$template->assign('service_details_html', $serviceDetailsHtml);
116111
$template->assign('service_description', $serviceDescription);
117112
$template->assign('pageUrl', $pageUrl);

public/plugin/BuyCourses/view/service_information.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
</div>
4848

4949
<article class="bc-info-hero">
50-
<div class="bc-info-hero__image-wrap"><img src="{{ service_image|e }}" alt="{{ service.name|e }}" class="bc-info-hero__image"></div>
50+
<div class="bc-info-hero__image-wrap"><img src="{{ (service.image|default('') ?: _p.web_img ~ 'session_default.svg')|e }}" alt="{{ service.name|e }}" class="bc-info-hero__image"></div>
5151
<div class="bc-info-hero__body">
5252
<div class="bc-info-badges">
5353
{% if applies_to_label %}<span class="bc-info-badge">{{ applies_to_label|e }}</span>{% endif %}

0 commit comments

Comments
 (0)