Skip to content

Commit 9699143

Browse files
committed
Plugin: Buycourse: add option to not show shoping cart in catalogue but same subscribe button even if the course is in sale - refs BT#20825
1 parent 8e1e3a4 commit 9699143

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

plugin/buycourses/lang/english.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,4 +318,5 @@
318318
$strings['SubscriptionPeriodDuration'] = "Subscription duration (in days)";
319319
$strings['Product'] = "Product name";
320320
$strings['YouProductIsActivatedYouCanNowAccessIt'] = "Your product is now activated and you can now have access to it.";
321+
$strings['hide_shopping_cart_from_course_catalogue'] = "Hide shopping cart from the course catalogue and leave the subscribe button";
321322

plugin/buycourses/lang/french.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,4 +247,5 @@
247247
$strings['Product'] = "Produit";
248248
$strings['SalePrice'] = "Prix";
249249
$strings['YouProductIsActivatedYouCanNowAccessIt'] = "Votre abonnement a été activé, vous avez maintenant accès au module choisi.";
250+
$strings['hide_shopping_cart_from_course_catalogue'] = "Cacher le chariot de vente dans le catalogue de cours et laisse le bouton s'inscrire";
250251

plugin/buycourses/lang/spanish.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,3 +318,4 @@
318318
$strings['SubscriptionPeriodDuration'] = "Duración de suscripción (en días)";
319319
$strings['Product'] = "Producto";
320320
$strings['YouProductIsActivatedYouCanNowAccessIt'] = "Tu producto esta activado y puedes ahora acceder a este.";
321+
$strings['hide_shopping_cart_from_course_catalogue'] = "Esconder el carito de compra del catalogo de curso y dejar el boton de subscripcion a curso";

plugin/buycourses/src/buy_course_plugin.class.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ public function __construct()
108108
'commissions_enable' => 'boolean',
109109
'unregistered_users_enable' => 'boolean',
110110
'hide_free_text' => 'boolean',
111+
'hide_shopping_cart_from_course_catalogue' => 'boolean',
111112
'invoicing_enable' => 'boolean',
112113
'tax_enable' => 'boolean',
113114
'use_currency_symbol' => 'boolean',
@@ -606,8 +607,12 @@ public function returnBuyCourseButton(int $productId, int $productType)
606607
$productId = $productId;
607608
$productType = $productType;
608609
$url = api_get_path(WEB_PLUGIN_PATH).'buycourses/src/process.php?i='.$productId.'&t='.$productType;
610+
$buyButton = Display::returnFontAwesomeIcon('shopping-cart');
611+
if ($this->get('hide_shopping_cart_from_course_catalogue') === 'true') {
612+
$buyButton = Display::returnFontAwesomeIcon('check').PHP_EOL.get_lang('Subscribe');
613+
}
609614
$html = '<a class="btn btn-success btn-sm" title="'.$this->get_lang('Buy').'" href="'.$url.'">'.
610-
Display::returnFontAwesomeIcon('shopping-cart').'</a>';
615+
$buyButton .'</a>';
611616

612617
return $html;
613618
}

0 commit comments

Comments
 (0)