Inhalte aufrufen

Profilbild

@item.BasePrice empty in cart?

Cart Discount

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

#1 CompleteCoders

CompleteCoders

    Advanced Member

  • Members
  • PunktPunktPunkt
  • 103 Beiträge

Geschrieben: 21 April 2017 - 18:03

I have a product that has a 40% discount on it.  I see in the OrderSummary.cshtml that there is a check to see if  @if (Model.DisplayBasePrice && !String.IsNullOrEmpty(item.BasePrice)) then show the base price.  I have the DisplayBasePrice checked in settings but no BasePrice is empty.

 

I assume I don't understand what BasePrice is used for.  My client wants to show the non-discounted and discounted prices in the cart.  Trying to do it without code.

 

Thanks

 



#2 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3799 Beiträge

Geschrieben: 21 April 2017 - 19:24

A base price is often used for products with package units and is specified on product level. A declaration can be required by law (Price Indication Regulation PAngV).
It has nothing to do with a discounted (or non discounted) price. On the product detail page both are displayed. The cart just shows the difference (which is probably a bit more clearer to the buyer). To display the non discounted price you have to extend ShoppingCartItemModel and PrepareShoppingCartItemModel.

Marcus Gesing

Smartstore AG


#3 CompleteCoders

CompleteCoders

    Advanced Member

  • Members
  • PunktPunktPunkt
  • 103 Beiträge

Geschrieben: 21 April 2017 - 22:17

1. Is there an example somewhere that shows how to correctly extend a model?  

2. Seems to me it would be simpler to take the @item.Discount and divided it by the quantity.  That would give me the original price right.  Doing this depends on how complicated extending out the model is.

3. The wording "excl tax" seems to be built in the model.  Do I have control of this?

 

Thank you for making a great product.

 

Edit: Please ignore #2, I see I don't have the value, but I have a string coming out of that.  I'll have to learn to extend the model.



#4 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3799 Beiträge

Geschrieben: 22 April 2017 - 09:33

1. Can be achieved by an IResultFilter implementation. You can use ModelBase::CustomProperties to inject custom data into a view model.
 
3. It's a string resource with the key "Products.ExclTaxSuffix". You can change it the backend at Configuration > Regional Settings > Countries >
View string resources > Filter name by Products.ExclTaxSuffix > change the value.

Marcus Gesing

Smartstore AG



Auch markiert mit einem oder mehrerer dieser Schlüsselwörter: Cart, Discount