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

pull/4808/head
NicoDucou 2 years ago
parent 8e1e3a436c
commit 969914366b
  1. 1
      plugin/buycourses/lang/english.php
  2. 1
      plugin/buycourses/lang/french.php
  3. 1
      plugin/buycourses/lang/spanish.php
  4. 7
      plugin/buycourses/src/buy_course_plugin.class.php

@ -318,4 +318,5 @@ $strings['SubscriptionAlreadyExists'] = "Subscription already exists";
$strings['SubscriptionPeriodDuration'] = "Subscription duration (in days)";
$strings['Product'] = "Product name";
$strings['YouProductIsActivatedYouCanNowAccessIt'] = "Your product is now activated and you can now have access to it.";
$strings['hide_shopping_cart_from_course_catalogue'] = "Hide shopping cart from the course catalogue and leave the subscribe button";

@ -247,4 +247,5 @@ $strings['SubscriptionPeriodDuration'] = "Durée de souscription (en jours)";
$strings['Product'] = "Produit";
$strings['SalePrice'] = "Prix";
$strings['YouProductIsActivatedYouCanNowAccessIt'] = "Votre abonnement a été activé, vous avez maintenant accès au module choisi.";
$strings['hide_shopping_cart_from_course_catalogue'] = "Cacher le chariot de vente dans le catalogue de cours et laisse le bouton s'inscrire";

@ -318,3 +318,4 @@ $strings['SubscriptionAlreadyExists'] = "La suscripción ya existe";
$strings['SubscriptionPeriodDuration'] = "Duración de suscripción (en días)";
$strings['Product'] = "Producto";
$strings['YouProductIsActivatedYouCanNowAccessIt'] = "Tu producto esta activado y puedes ahora acceder a este.";
$strings['hide_shopping_cart_from_course_catalogue'] = "Esconder el carito de compra del catalogo de curso y dejar el boton de subscripcion a curso";

@ -108,6 +108,7 @@ class BuyCoursesPlugin extends Plugin
'commissions_enable' => 'boolean',
'unregistered_users_enable' => 'boolean',
'hide_free_text' => 'boolean',
'hide_shopping_cart_from_course_catalogue' => 'boolean',
'invoicing_enable' => 'boolean',
'tax_enable' => 'boolean',
'use_currency_symbol' => 'boolean',
@ -606,8 +607,12 @@ class BuyCoursesPlugin extends Plugin
$productId = $productId;
$productType = $productType;
$url = api_get_path(WEB_PLUGIN_PATH).'buycourses/src/process.php?i='.$productId.'&t='.$productType;
$buyButton = Display::returnFontAwesomeIcon('shopping-cart');
if ($this->get('hide_shopping_cart_from_course_catalogue') === 'true') {
$buyButton = Display::returnFontAwesomeIcon('check').PHP_EOL.get_lang('Subscribe');
}
$html = '<a class="btn btn-success btn-sm" title="'.$this->get_lang('Buy').'" href="'.$url.'">'.
Display::returnFontAwesomeIcon('shopping-cart').'</a>';
$buyButton .'</a>';
return $html;
}

Loading…
Cancel
Save