0
Reply

How to remove that $-symbol in case if no offer is present?

Tripti Tiwari

Tripti Tiwari

Jun 24 2016 4:02 AM
354

How to remove that $-symbol in case if no offer is present and show and take it space when offer is present?I want to shift my original price in center and due to presence of S sign it is not possible for me.How can I do this?I want solution in Laravel.

I am trying this code...

foreach($restaurant->categories as $category) {
foreach($category->dishes as $dish) {
foreach ($offers as $key => $offer) {
$dishes = json_decode($offer->dishes);
foreach($dishes as $offer_dish) {

if($offer_dish == $dish->id){
foreach($dish->packs as $pack) {
if($offer->discount_type == 'percentage'){
$pack->mrp = $pack->price;
$pack->offers = $offer->name;

$pack->price = $pack->price - (($offer->discount_quantity * $pack->price)/100);
$pack->price = $pack->price;
if($offer->activated == 1){

} else{
$offer->activated = 1;
}

}
else{
$pack->mrp = $pack->price;
$pack->price = $pack->price - $offer->discount_quantity; $pack->price = $pack->price - (($offer->discount_quantity * $pack->price)/100);
$pack->price = $pack->price - (($offer->discount_quantity * $pack->price)/100);
$pack->offers = $offer->minimum_price;
}
}
}

}
}
}
}