Merge pull request #4534 from rahulshukla-webkul/development
Issue #3572, fixes percentage for 2 decimal values
This commit is contained in:
commit
2e05c832ef
|
|
@ -4,6 +4,7 @@ namespace Webkul\Marketing\Providers;
|
|||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Webkul\Marketing\Console\Commands\EmailsCommand;
|
||||
use Illuminate\Console\Scheduling\Schedule;
|
||||
|
||||
class MarketingServiceProvider extends ServiceProvider
|
||||
{
|
||||
|
|
@ -17,6 +18,10 @@ class MarketingServiceProvider extends ServiceProvider
|
|||
$this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
|
||||
|
||||
$this->loadRoutesFrom(__DIR__ . '/../Http/routes.php');
|
||||
|
||||
$this->callAfterResolving(Schedule::class, function (Schedule $schedule) {
|
||||
$schedule->command('campaign:process')->daily();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -959,7 +959,7 @@ abstract class AbstractType
|
|||
|
||||
if ($haveOffers) {
|
||||
foreach ($customerGroupPrices as $key => $customerGroupPrice) {
|
||||
if ($key > 0) {
|
||||
if ($customerGroupPrice && $customerGroupPrice->qty > 1) {
|
||||
array_push($offerLines, $this->getOfferLines($customerGroupPrice));
|
||||
}
|
||||
}
|
||||
|
|
@ -985,7 +985,7 @@ abstract class AbstractType
|
|||
public function getOfferLines($customerGroupPrice) {
|
||||
$price = $this->getCustomerGroupPrice($this->product, $customerGroupPrice->qty);
|
||||
|
||||
$discount = (($this->product->price - $price) * 100) / ($this->product->price);
|
||||
$discount = number_format((($this->product->price - $price) * 100) / ($this->product->price), 2);
|
||||
|
||||
$offerLines = trans('shop::app.products.offers', ['qty' => $customerGroupPrice->qty,
|
||||
'price' => core()->currency($price), 'discount' => $discount]);
|
||||
|
|
|
|||
Loading…
Reference in New Issue