Product Request Form V2.0

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 年 前
I messed up the title, it is a product quote request form.

I've completed a request form plugin for version 2.0. The plugin is currently pending approval, but a tutorial to create your own can be found at http://csharpwebdeveloper.com/writing-nopcommerce-2-plugin.
12 年 前
The plugin has been approved and is available for download at https://www.nopcommerce.com/p/216/request-quote-plugin.aspx
12 年 前
I installed it and I love it, good job.  I do however have a question.  How do I get the Reqest quote to only show up when buy button is disabled?  I want the plugin to automatically show the request form when buy button is disabled.  

Also is it possible to run it off of the product boxes, where it says Call for Price it could have the Request Quote there?
12 年 前
thrifty34 wrote:
I installed it and I love it, good job.  I do however have a question.  How do I get the Reqest quote to only show up when buy button is disabled?  I want the plugin to automatically show the request form when buy button is disabled.  

Also is it possible to run it off of the product boxes, where it says Call for Price it could have the Request Quote there?


Thanks thrifty! You can accomplish the desired functionality by modifying the file "_ProductVariantAddToCart.cshtml". Below is how I would modify the file, but keep in mind you will probably need to do some custom work to make this change work well with your theme.


@model Nop.Web.Models.Catalog.ProductModel.ProductVariantModel.AddToCartModel
<div class="add-info">
    @if (Model.CustomerEntersPrice)
    {
        @Html.LabelFor(model => model.CustomerEnteredPrice)<text>:</text>
        @Html.TextBoxFor(model => model.CustomerEnteredPrice, new { style = "Width: 60px;" })
        <br />
        @Model.CustomerEnteredPriceRange
        <br />
    }
    @if (!Model.DisableBuyButton)
    {
        @Html.LabelFor(model => model.EnteredQuantity)<text>:</text>
        @Html.TextBoxFor(model => model.EnteredQuantity, new { style = "Width: 40px;" })
    }
    @if (!Model.DisableBuyButton)
    {
        <input type="submit" name="addtocart-@(Model.ProductVariantId)" class="productvariantaddtocartbutton" value="@T("ShoppingCart.AddToCart")" />
    }
    @if (Model.DisableBuyButton) {
         @* When the buy button is disabled, display request quote *@
        <a title="Request Quote" href="@Url.RouteUrl("Nop.Plugin.Pricing.RequestQuote")">Request Quote!</a>
    }
    @if (!Model.DisableWishlistButton)
    {
        <input type="submit" name="addtowishlist-@(Model.ProductVariantId)" class="productvariantaddtowishlistbutton" value="@T("ShoppingCart.AddToWishlist")" />
    }
</div>
12 年 前
Sweet, I suprisingly thought I did that but it didn't work with my code but now works.

One more question

Is it possible instead of showing "Call for Price" in product grid to have it say "request quote" and link to the page?  And on product page it would have to be absent otherwise it would say it twice.
12 年 前
thrifty34 wrote:
Sweet, I suprisingly thought I did that but it didn't work with my code but now works.

One more question

Is it possible instead of showing "Call for Price" in product grid to have it say "request quote" and link to the page?  And on product page it would have to be absent otherwise it would say it twice.


Sure, that would be possible, but I would lean toward creating a new option and leaving "call for price" as it is. But if you really want to change it here is the basics:

Part 1: In the file "_ProductVariantPrice.cshtml" change the following code as required:


    else if (Model.CallForPrice)
    {
        <span class="productPrice">@T("Products.CallForPrice")</span>
    }


Part 2:
1. Change the string resource value of "Products.CallForPrice" (Displays to the public).
2. Change the string resource value of "Admin.Catalog.Products.Variants.Fields.CallForPrice" (Displays in admin).

I believe that is all you would need to do so you can re-purpose the "CallForPrice" functionality. Also don't forget that you need to restart the website so the cache is cleared.
12 年 前
So if I change Product box I can get it to show, but is there a way for it to direct to the product and than direct to the request form?  


@model Nop.Web.Models.Catalog.ProductModel
<div class="product-item">
    <h2 class="product-title">
        <a href="@Url.RouteUrl("Product", new { productId = Model.Id, SeName = Model.SeName })">@Model.Name</a>
    </h2>
    <div class="picture">
        <a href="@Url.RouteUrl("Product", new { productId = Model.Id, SeName = Model.SeName })" title="@Model.DefaultPictureModel.Title">
            <img style="border-width: 0px;" alt="@Model.DefaultPictureModel.AlternateText" src="@Model.DefaultPictureModel.ImageUrl" title="@Model.DefaultPictureModel.Title" />
        </a>
    </div>
    <div class="description">
        @Html.Raw(Model.ShortDescription)
    </div>
    <div class="add-info">
        <div class="prices">
            @Html.Partial("_ProductPrice", Model.ProductPrice)
        </div>
        <div class="buttons">
            <input type="button" value="@T("Products.Details")" class="productlistproductdetailbutton" onclick="setLocation('@Url.RouteUrl("Product", new { productId = Model.Id, SeName = Model.SeName })')" />
            @if (!Model.ProductPrice.DisableBuyButton)
            {
                <br />
                <input type="button" value="@T("ShoppingCart.AddToCart")" class="productlistaddtocartbutton" onclick="setLocation('@(@Url.RouteUrl("AddProductToCart", new { productId = Model.Id }))')" />
            }
            @if (Model.ProductPrice.DisableBuyButton) {
            @* When the buy button is disabled, display request quote *@
            <a title="Request Quote" href="@Url.RouteUrl("Nop.Plugin.Pricing.RequestQuote")">Request Quote!</a>
            }
        </div>
    </div>
</div>
12 年 前
thrifty34 wrote:
So if I change Product box I can get it to show, but is there a way for it to direct to the product and than direct to the request form?  ...


Let me just make sure I understand. You would like "Request quote" to link back to the product view when a customer is viewing the "Product Box View", but when the customer is viewing the product you want the link to take the customer to the request form?
12 年 前
On this page I would like it to take me straight to the request quote form.  See the Supernova Shoes


http://www.thriftyreefer.com/c/14http://www.thriftyreefer.com/c/14
12 年 前
thrifty34 wrote:
On this page I would like it to take me straight to the request quote form.  See the Supernova Shoes


http://www.thriftyreefer.com/c/14http://www.thriftyreefer.com/c/14


OK I understand. This would be a little more difficult because we need the product variant, not just the product. What I would do is setup a new action in the request quote controller. This action takes productId, queries for the product, and redirects to the request quote route with the newly acquired product variant id .
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.