tier pricing table change

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
4 years ago
Dear all,

I want to change the view of the tier prices but I don't knwo where to start.
At the moment I have a table with 2 rows and every tier is a column.
I want to change this to the view so I have 2 colomns and mutliple rows depending on how many tiers I am adding.

Can someone point me in the right direction where to start.
must I change the _producttierPrices.cshtml?  in this file I have the following:
<div class="table-wrapper">
            <table class="prices-table">
                <tr>
                    <td class="field-header">
                        @T("Products.TierPrices.Quantity")
                    </td>
                    @foreach (var tierPrice in Model)
                    {
                        <td class="item-quantity">
                            @(tierPrice.Quantity)+
                        </td>
                    }
                </tr>
                <tr>
                    <td class="field-header">
                        @T("Products.TierPrices.Price")
                    </td>
                    @foreach (var tierPrice in Model)
                    {
                        <td class="item-price">
                            @tierPrice.Price
                        </td>
                    }
                </tr>
            </table>
        </div>

I think I need to change here but I am not sure and what to change.

Thank you in advanced.
4 years ago
Yes, you are on right track. You need to change in _ProductTierPrices.cshtml.
4 years ago
just need to change up your tr and td elements (which has the bonus of removing the 2nd loop), try this:


        <div class="table-wrapper">
            <table class="prices-table">
                <tr>
                    <td class="field-header">
                        @T("Products.TierPrices.Quantity")
                    </td>
                    <td class="field-header">
                        @T("Products.TierPrices.Price")
                    </td>
                </tr>
                @foreach (var tierPrice in Model)
                {
                <tr>
                    <td class="item-quantity">
                        @(tierPrice.Quantity)+
                    </td>
                    <td class="item-price">
                        @tierPrice.Price
                    </td>
                </tr>
                }
            </table>
        </div>
4 years ago
Thanks, I will give it a try. I will let you know the outcome.

regards,
Rutger
4 years ago
hi,

can you also help me on the code for nopcommerce 42.?
I want to change this code as well so I have the same as above.

    <div class="tier-prices">
        <div class="title">
            <strong>@T("Products.TierPrices")</strong>
        </div>
        <div class="table-wrapper">
            <div class="prices-table">
                <div class="prices-row thead">
                    <div class="field-header">@T("Products.TierPrices.Quantity")</div>
                    @foreach (var tierPrice in Model)
                    {
                        <div class="item-quantity">
                            @(tierPrice.Quantity)+
                        </div>
                    }
                </div>
                <div class="prices-row tbody">
                    <div class="field-header">@T("Products.TierPrices.Price")</div>
                    @foreach (var tierPrice in Model)
                    {
                        <div class="item-price">
                            @tierPrice.Price
                        </div>
                    }
                </div>
            </div>
        </div>
    </div>

Thanks.
4 years ago
I have found out how to change it.
    <div class="tier-prices">
        <div class="title">
            <strong>@T("Products.TierPrices")</strong>
        </div>
        <div class="table-wrapper">
            <div class="prices-table">
                <div class="prices-row thead">
                    <div class="field-header">@T("Products.TierPrices.Quantity")</div>
          <div class="field-header">@T("Products.TierPrices.Price")</div>
        </div>
        @foreach (var tierPrice in Model)
                    {
                <div class="prices-row tbody">
            <div class="item-quantity">
                            @(tierPrice.Quantity)+
                        </div>
                        <div class="item-price">
                            @tierPrice.Price
                        </div>
                </div>
          }
            </div>
        </div>
    </div>

The last part I don't understand is how to have this also coded for mobile view.
If I use this code above it is working on desktop or ipad, but as soon aI go to the mobile it doesn't look good.
Does anyone have any suggestion how to solve this part?

Thank you in advanced.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.