Adding a unit to product price

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
2 年 前
Hi,
I am trying to add the unit value to the price text in product simple view. To be exact I need to add the words {per Gram} to the right of the product price so end result would be : "$5.00 per gram" where the $5 is the price drawn from the database.

Is this possible outside of source code?

Thanks,
Alek
2 年 前
False alarm...figured it out.

Thanks
2 年 前
AlekC wrote:
Hi,
I am trying to add the unit value to the price text in product simple view. To be exact I need to add the words {per Gram} to the right of the product price so end result would be : "$5.00 per gram" where the $5 is the price drawn from the database.

Is this possible outside of source code?

Thanks,
Alek


you can add custom code at .cshtml page using c# logic or javascript when response arrives.
2 年 前
AlekC wrote:
...figured it out...

Please share your solution to help the community :)
2 年 前
Hi,

I just added this(bold and underlined) to the _ProductPrice.cshtml file.  I am sure it would be the same for inserting text anywhere within cshtml pages.

                <span @if (string.IsNullOrWhiteSpace(Model.PriceWithDiscount)) { <text> id="price-value-@(Model.ProductId)" class="price-value-@(Model.ProductId)" </text> }>
        
        @*Added text to page*@
                 <text>Starting at</text>

         @Html.Raw(Model.Price) <text>per gram</text>
                </span>
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.