Inhalte aufrufen

Profilbild

Remove % Sign before price

masterpayment

  • Bitte melden Sie sich an, um eine Antwort zu verfassen.
4 Antworten zu diesem Thema

#1 Yoram

Yoram

    Advanced Member

  • Members
  • PunktPunktPunkt
  • 37 Beiträge

Geschrieben: 15 May 2020 - 11:56

Hello,

 

I want to remove the % sign before the price. (Circled in the picture). But if i disable the setting "Catalog settings > Show discount sign" the discount badge also dissapears (marked with the arrow in the picture). That is not the behaviour i want.

 

Is there someting i can do to make this dissapear, but not the discount badge?

Angehängte Bilder


Smartstore: Website | Webshop


#2 altmoola

altmoola

    Advanced Member

  • Members
  • PunktPunktPunkt
  • 66 Beiträge

Geschrieben: 15 May 2020 - 15:59

The only way to change this is to change the view. Navigate to the Views\Shared\Partials\Product.List.Item.Price.cshtml view and change the following line:

@(Model.Price.SavingAmount.HasValue() ? "% " : "")@Model.Price.Price

to:

@Model.Price.Price


#3 Yoram

Yoram

    Advanced Member

  • Members
  • PunktPunktPunkt
  • 37 Beiträge

Geschrieben: 19 May 2020 - 13:21

Thanks for your answer. But thats not really what the hint says: "Specifies whether a discount sign ("%") should be displayed next to the final price when discounts were applied".

 

I don't understand this behavior.


Smartstore: Website | Webshop


#4 altmoola

altmoola

    Advanced Member

  • Members
  • PunktPunktPunkt
  • 66 Beiträge

Geschrieben: 19 May 2020 - 14:55

I don't understand it either as the hint seems to mean it shouldn't show it, however, you can see from the code that it doesn't take any settings into consideration.



#5 Marcel Schmidt

Marcel Schmidt

    SmartStore AG

  • Administrators
  • 149 Beiträge

Geschrieben: 02 June 2020 - 15:54

Yes, you are right, the settings hint is somewhat missleading. As you guys pointed out, this setting doesnt influence the '%' display whatsoever, it only applies to the badge on product image.

 

A more long term solution would be overriding this view with your theme, this way it is (mostly) update save.

(Having the exact same folder structure and file names in your theme as in the views)

 

Best regards


  • Yoram gefällt das