logo
Welcome to our new AbleCommerce forums. As a guest, you may view the information here. To post to this forum, you must have a registered account with us, either as a new user evaluating AbleCommerce or an existing user of the application. For all questions related to the older version of Gold and earlier, please go to AbleCommerce Gold forum. Please use your AbleCommerce username and password to Login. New Registrations are disabled.

Notification

Icon
Error

2 Pages12>
Options
Go to last post Go to first unread
ray22901031  
#1 Posted : Wednesday, April 29, 2020 12:57:30 AM(UTC)
ray22901031

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 2/17/2019(UTC)
Posts: 909

Thanks: 3 times
Was thanked: 15 time(s) in 15 post(s)
Dear Developers,

First and most important, I hope you are all well and safe.

I have come across a real potential problem and I require your assistance. Motorola has required all of us for the past five years to use MAP pricing on all radio products. The option "require user to click a link to view price" is problematic, because the price is actually shown in the source code. A company looking for violations will use a bot to search the source code and they will encounter pricing information. Although I can try to block these bots by being very specific in my robot.txt, a bot can ignore the robot.txt completely if it wishes.

Is there any way, that pricing can be hidden so it also does not show up in the source code, without doing major surgery?

I love this platform and the last thing I want to do is have to go someplace else and abandon all the work that I have done.

I await your reply.

Many Thanks

Wanna join the discussion?! Login to your AbleCommerce Forums forum account. New Registrations are disabled.

mazhar  
#2 Posted : Wednesday, April 29, 2020 12:52:20 PM(UTC)
mazhar

Rank: Administration

Groups: Admin, Administrators, HelpDesk, System, Authorized User, Developers, Registered
Joined: 10/5/2018(UTC)
Posts: 175

Thanks: 8 times
Was thanked: 17 time(s) in 15 post(s)
Hi, I think this can be achieved very easily. Please try the following.

First of all, Create Views folder in your Theme folder if you haven't created it before and copy web.config from root's Views folder into it. Then make sure you have the Product folder under the theme Views folder and copy /Views/Product/_BuyProductDialog.cshtml into it. Now we can make updates to _BuyProductDialog.cshtml file and override the default file.

Edit _BuyProductDialog.cshtml and locate the following line of code in it

Code:

@if (Model.ShowOurPrice)
            {
                <span>
                    @Html.Action("ProductPrice", new { ProductId = Model.Product.Id, OptionList = Model.OptionList, SelectedKitProducts = Model.SelectedKitProducts })
                </span>
            }


and update it like

Code:

@if (Model.ShowOurPrice)
            {
                <script>
                    $(function () {
                        $("#ShowPriceLink").click(function () {
                            $.ajax({
                                url: '@Url.Action("ProductPrice")',
                                type: "GET",
                                data: {
                                    ProductId: @Model.Product.Id,
                                    OptionList: '@Model.OptionList',
                                    SelectedKitProducts: [@string.Join(",", Model.SelectedKitProducts.Select(i => i.ToString()).ToArray())],
                                }
                            }).done(function (data) {
                                $("#price-container").html(data);
                                $("#ShowPriceLink").click();
                            });
                        });
                    })
                </script>
                <span id="price-container">
                    <h5><a id="ShowPriceLink">@string.Format(GetResourceString("retail.productprice.show_me_the_price_of_{0}", false).ToString(), Model.Product.Name)</a></h5>
                </span>
            }


Save the change and now it should only show the Price by dynamically loading it upon click.

You may also want to duplicate the _ProductSchema.cshtml under Theme's views folder and remove price information.
ray22901031  
#3 Posted : Wednesday, April 29, 2020 8:32:55 PM(UTC)
ray22901031

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 2/17/2019(UTC)
Posts: 909

Thanks: 3 times
Was thanked: 15 time(s) in 15 post(s)
Hi Mazhar,

Thank you very much for your reply, I did my very best to follow the steps, but I'm getting a undefined error, I will have my developer look at this but I'm glad you think this is not a big deal.

Many thanks
ray22901031  
#4 Posted : Thursday, April 30, 2020 4:41:54 PM(UTC)
ray22901031

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 2/17/2019(UTC)
Posts: 909

Thanks: 3 times
Was thanked: 15 time(s) in 15 post(s)
Hello Mazhar,

I decided to experiment a little bit and I have followed your steps to the letter, I have copied the proper cshtml file to a directory called Product under views, under my Themes. Please note there was already a web.config file. I have made absolutely no edits to the file, it is the original file without any modifications. I reset the server and I get a undefined errors. Below is the message from the backend.

Not sure why this is occurring without any modification whatsoever?

An error has occured at http://rfl01/motorola-bpr40-radio-aah84rcs8aa1an View less
Exception: Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'. Stack Trace: at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage) at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm) at System.Web.Mvc.Html.ChildActionExtensions.ActionHelper(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues, TextWriter textWriter) at System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper htmlHelper, String actionName, String controllerName, Object routeValues) at ASP._Page_Views_Product_Index_cshtml.Execute() in C:\Web Sites\AbleCommerce\rfl01\Site\Views\Product\Index.cshtml:line 7 at System.Web.WebPages.WebPageBase.ExecutePageHierarchy() at System.Web.Mvc.WebViewPage.ExecutePageHierarchy() at System.Web.WebPages.StartPage.ExecutePageHierarchy() at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) at System.Web.Mvc.Controller.ExecuteCore() at System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) at System.Web.Mvc.Async.AsyncResultWrapper.<.cctor>b__0(IAsyncResult asyncResult, Action action) at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) at System.Web.Mvc.MvcHandler.b__5(IAsyncResult asyncResult, ProcessRequestState innerState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) Inner Exception: Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'. Inner Exception Stack Trace: at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage) at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm) at System.Web.Mvc.Html.ChildActionExtensions.ActionHelper(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues, TextWriter textWriter) at CommerceBuilder.Web.Extensions.HtmlExtensions.Widget(HtmlHelper html, String name, Object routeValues) at CommerceBuilder.Web.Mvc.AbleCommercePage`1.RenderWidgetZone(WidgetZone widgetZone, Boolean editable, PageDataType pageType, Int32 pageId, Int32 widgetBoardId, Boolean restore) at CommerceBuilder.Web.Mvc.AbleCommercePage`1.RenderZoneForProduct(String name, ProductPageData data, Boolean editable) at ASP._Page_Views_Shared_Inner_ARS_Radio_BPR40_cshtml.Execute() in C:\Web Sites\AbleCommerce\rfl01\Site\Views\Shared\Inner\ARS-Radio-BPR40.cshtml:line 7 at System.Web.WebPages.WebPageBase.ExecutePageHierarchy() at System.Web.Mvc.WebViewPage.ExecutePageHierarchy() at System.Web.WebPages.StartPage.ExecutePageHierarchy() at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) at System.Web.Mvc.Controller.ExecuteCore() at System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) at System.Web.Mvc.Async.AsyncResultWrapper.<.cctor>b__0(IAsyncResult asyncResult, Action action) at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) at System.Web.Mvc.MvcHandler.b__5(IAsyncResult asyncResult, ProcessRequestState innerState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.<>c__DisplayClass4.b__3() at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.Wrap[TResult](Func`1 func) at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) Inner Exception: Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'. Inner Exception Stack Trace: at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage) at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm) at System.Web.Mvc.Html.ChildActionExtensions.ActionHelper(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues, TextWriter textWriter) at CommerceBuilder.Web.Extensions.HtmlExtensions.Widget(HtmlHelper html, String name, Object routeValues) at CommerceBuilder.Web.Mvc.AbleCommercePage`1.RenderWidgetZone(WidgetZone widgetZone, Boolean editable, PageDataType pageType, Int32 pageId, Int32 widgetBoardId, Boolean restore) at CommerceBuilder.Web.Mvc.AbleCommercePage`1.RenderZoneForProduct(String name, ProductPageData data, Boolean editable) at ASP._Page_Views_Shared_Inner_ARS_Radio_BPR40_cshtml.Execute() in C:\Web Sites\AbleCommerce\rfl01\Site\Views\Shared\Inner\ARS-Radio-BPR40.cshtml:line 7 at System.Web.WebPages.WebPageBase.ExecutePageHierarchy() at System.Web.Mvc.WebViewPage.ExecutePageHierarchy() at System.Web.WebPages.StartPage.ExecutePageHierarchy() at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) at System.Web.Mvc.Controller.ExecuteCore() at System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) at System.Web.Mvc.Async.AsyncResultWrapper.<.cctor>b__0(IAsyncResult asyncResult, Action action) at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) at System.Web.Mvc.MvcHandler.b__5(IAsyncResult asyncResult, ProcessRequestState innerState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.<>c__DisplayClass4.b__3() at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.Wrap[TResult](Func`1 func) at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) Inner Exception: Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'. Inner Exception Stack Trace: at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage) at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm) at System.Web.Mvc.Html.ChildActionExtensions.ActionHelper(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues, TextWriter textWriter) at CommerceBuilder.Web.Extensions.HtmlExtensions.Widget(HtmlHelper html, String name, Object routeValues) at CommerceBuilder.Web.Mvc.AbleCommercePage`1.RenderWidgetZone(WidgetZone widgetZone, Boolean editable, PageDataType pageType, Int32 pageId, Int32 widgetBoardId, Boolean restore) at CommerceBuilder.Web.Mvc.AbleCommercePage`1.RenderZoneForProduct(String name, ProductPageData data, Boolean editable) at ASP._Page_Views_Shared_Inner_ARS_Radio_BPR40_cshtml.Execute() in C:\Web Sites\AbleCommerce\rfl01\Site\Views\Shared\Inner\ARS-Radio-BPR40.cshtml:line 7 at System.Web.WebPages.WebPageBase.ExecutePageHierarchy() at System.Web.Mvc.WebViewPage.ExecutePageHierarchy() at System.Web.WebPages.StartPage.ExecutePageHierarchy() at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) at System.Web.Mvc.Controller.ExecuteCore() at System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) at System.Web.Mvc.Async.AsyncResultWrapper.<.cctor>b__0(IAsyncResult asyncResult, Action action) at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) at System.Web.Mvc.MvcHandler.b__5(IAsyncResult asyncResult, ProcessRequestState innerState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.<>c__DisplayClass4.b__3() at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.Wrap[TResult](Func`1 func) at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride)

Many Thanks
mazhar  
#5 Posted : Thursday, April 30, 2020 8:29:58 PM(UTC)
mazhar

Rank: Administration

Groups: Admin, Administrators, HelpDesk, System, Authorized User, Developers, Registered
Joined: 10/5/2018(UTC)
Posts: 175

Thanks: 8 times
Was thanked: 17 time(s) in 15 post(s)
MAPSample.zip (1,181kb) downloaded 5 time(s).
Here is a sample theme with a working example in 902. Just upload the theme and then apply the theme on a product which has the hidden price featured enabled. When you preview the product you won't see the price in HTML suorce until you click the show price link.
ray22901031  
#6 Posted : Thursday, April 30, 2020 9:00:21 PM(UTC)
ray22901031

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 2/17/2019(UTC)
Posts: 909

Thanks: 3 times
Was thanked: 15 time(s) in 15 post(s)
Hello Mazhar,

I appreciate your efforts, but none of this is working. When I apply the theme to the sample website, it explodes. When I applied the theme to my website, it explodes. There's something else going on, bottom line.

On my current theme, if I add a folder under views, name product, and I just copy the default file from root to the new folder without any modifications, the system explodes.

Why?

There's something else going on, I am not doing anything but putting a identical file onto my theme folder, the system cannot handle it. There has to be a reason why?

Any suggestions you can make for troubleshooting, I would appreciate.
mazhar  
#7 Posted : Thursday, April 30, 2020 9:06:09 PM(UTC)
mazhar

Rank: Administration

Groups: Admin, Administrators, HelpDesk, System, Authorized User, Developers, Registered
Joined: 10/5/2018(UTC)
Posts: 175

Thanks: 8 times
Was thanked: 17 time(s) in 15 post(s)
Please go ahead and try the change directly in the original file without duplicating it under the theme. By duplicating it under the theme provides better separation for any future upgrades.
ray22901031  
#8 Posted : Thursday, April 30, 2020 9:17:38 PM(UTC)
ray22901031

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 2/17/2019(UTC)
Posts: 909

Thanks: 3 times
Was thanked: 15 time(s) in 15 post(s)
Okay, it was exploding because I was testing it on an earlier version. I unzipped the file, contents under my theme directory, went into admin, and picked that theme. It works.

So now I need to integrated into my theme, if I do as you ask, create a directory called Products under views, and just copy the root file without modification, it should override the root file, even though they are the identical files, it should not explode my system, but it does.

So there's something else going on, there has been absolutely no code modification to my system with the exception of the product template code change that you guys recommended, only the CSS has been altered. I am also using the new theme.config file, so I had to remove the two files, scripts and styles under the shared directory, could this be causing the issue because all my includes are now under the theme.config file ?
mazhar  
#9 Posted : Thursday, April 30, 2020 9:44:56 PM(UTC)
mazhar

Rank: Administration

Groups: Admin, Administrators, HelpDesk, System, Authorized User, Developers, Registered
Joined: 10/5/2018(UTC)
Posts: 175

Thanks: 8 times
Was thanked: 17 time(s) in 15 post(s)
Quote:
Okay, it was exploding because I was testing it on an earlier version. I unzipped the file, contents under my theme directory, went into admin, and picked that theme. It works.

Great, the version mismatch explains why it didn't work.

Quote:
So now I need to integrated into my theme, if I do as you ask, create a directory called Products under views, and just copy the root file without modification, it should override the root file, even though they are the identical files, it should not explode my system, but it does.

Yes, you should be able to duplicate /Views/Product/__BuyProductDialog.cshtml under /Themes/[Your Theme]/Views/Product/_BuyProductDialog.cshtml. The file under theme will override the root version and makes it easy to keep customizations isolated from the orignal. I am not sure why it's not working in your scenario, make sure that you are copying the file and not using the file from a different version of AbleCommerce. Perhaps do a website restart after copying the file in case something is getting cached.
Quote:
So there's something else going on, there has been absolutely no code modification to my system with the exception of the product template code change that you guys recommended, only the CSS has been altered. I am also using the new theme.config file, so I had to remove the two files, scripts and styles under the shared directory, could this be causing the issue because all my includes are now under the theme.config file ?

That sounds fine. I don't think so if it's related. It should work without them just like its working in the MAPSample theme I shared above.
ray22901031  
#10 Posted : Thursday, April 30, 2020 9:51:19 PM(UTC)
ray22901031

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 2/17/2019(UTC)
Posts: 909

Thanks: 3 times
Was thanked: 15 time(s) in 15 post(s)
I am duplicating the proper file with the proper version under my theme folder and the system explodes, I'm not even concerned at this point with anything else. I even have taken your product directory from your example and pasted it under my view folder, my system explodes.

Forget everything else, there is no major modification here, my system keeps exploding if I create a directory call product under views and I copy that particular file.

I am now going behind the scenes, using Windows Explorer, made a copy of my current theme, I'm taking your files from your example and I'm just going to paste over my copy of my current theme, if that works I will bring over the custom.css and the custom-rfl.css over to see what is causing this to explode.

If you have any thing else that I should be looking for please let me know, do you honestly think that something in the css file is causing the system to explode?
ray22901031  
#11 Posted : Thursday, April 30, 2020 10:38:02 PM(UTC)
ray22901031

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 2/17/2019(UTC)
Posts: 909

Thanks: 3 times
Was thanked: 15 time(s) in 15 post(s)
Hello Mazhar,

First I want to thank you for your time involved in this particular issue. These are the steps that I took to get the system working. Please note as I was going through the steps, I was constantly resetting IIS, again like you say for caching problems.

#1. I made a copy of my current theme (RFL-081119)
#2 New copy call (RFL-Testing)
#3. I then copy your example over RFL-Testing, which of course overrode custom.css, logos and certain images.

#4. Reset the site, check to see that all was working although the site did look like a mess, working, no explosions.
#5. Started to copy over files, one by one, starting with custom.css, all is working
#6. Continuing copy files. One by one, and checking to see that all is working

#7. The only file that had a different size was Skin.xml
#8. Although web.config were the same size, their contents were different.
#9. Copied over one by one, the old Skin.xml and web.config to see if I could get the system to explode, it would not

I eventually ended up staying with the new Skin.xml and web.config files.

My conclusion:

My system has been updated over three times from 08/11/19, I guess throughout the update process, which I am assuming only updates the sample theme, I did not manually move or update any files to my custom theme. I am going to assume that they were some files out of whack, that was causing these problems. I am going to assume in the future if there any future updates, to manually update my custom theme and just override the custom.css file. Is this the correct procedure?

Either way I hope this helps someone else.

Many Thanks,
-Ray


thanks 1 user thanked ray22901031 for this useful post.
mazhar on 5/1/2020(UTC)
ray22901031  
#12 Posted : Friday, May 1, 2020 12:29:49 AM(UTC)
ray22901031

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 2/17/2019(UTC)
Posts: 909

Thanks: 3 times
Was thanked: 15 time(s) in 15 post(s)
My Old Web.config file under my old theme were missing the following namespaces, would this have anything to do with the problem?

<add namespace="AbleCommerce.Models" />
<add namespace="AbleCommerce.Code" />
<add namespace="PagedList" />
<add namespace="PagedList.Mvc" />
<add namespace="CommerceBuilder.Common" />
<add namespace="Microsoft.Web.Mvc" />

Thanks
mazhar  
#13 Posted : Friday, May 1, 2020 9:33:00 AM(UTC)
mazhar

Rank: Administration

Groups: Admin, Administrators, HelpDesk, System, Authorized User, Developers, Registered
Joined: 10/5/2018(UTC)
Posts: 175

Thanks: 8 times
Was thanked: 17 time(s) in 15 post(s)
Quote:
<add namespace="AbleCommerce.Models" />

Yes, above namespace include is needed to use the
Code:
@model BuyProductDialogModel

in _BuyProductDialog.cshtml file. It makes sense why it was not working if this namespace was misssing.

Also, please do check that _ProductSchema.cshtml maybe also emitting the price in the HTML source which is for Google Rich Snippets. I am not sure but you may want to disable the offers schema in this file.
https://support.google.c...ers/thread/2444180?hl=en
ray22901031  
#14 Posted : Friday, May 1, 2020 9:38:39 AM(UTC)
ray22901031

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 2/17/2019(UTC)
Posts: 909

Thanks: 3 times
Was thanked: 15 time(s) in 15 post(s)
Hello Again Mazhar,

Could you please verify the following, when an update is executed only the web.config file in the main Views directory is updated, if I am overwriting views in my themes, I would need to manually make sure that the new web configuration file is also updated in my themes . Is this a correct statement?

Many Thanks
mazhar  
#15 Posted : Friday, May 1, 2020 9:46:08 AM(UTC)
mazhar

Rank: Administration

Groups: Admin, Administrators, HelpDesk, System, Authorized User, Developers, Registered
Joined: 10/5/2018(UTC)
Posts: 175

Thanks: 8 times
Was thanked: 17 time(s) in 15 post(s)
Quote:
Could you please verify the following, when an update is executed only the web.config file in the main Views directory is updated, if I am overwriting views in my themes, I would need to manually make sure that the new web configuration file is also updated in my themes . Is this a correct statement?

Yes, that's correct.
ray22901031  
#16 Posted : Friday, May 1, 2020 9:49:46 AM(UTC)
ray22901031

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 2/17/2019(UTC)
Posts: 909

Thanks: 3 times
Was thanked: 15 time(s) in 15 post(s)
I figured as much,I know that you have documentation for merchants, is there anywhere where you have documentation for developers who wish to create their own themes, and the above topic is documented?

The more I use the software, the more I like it, but without the proper documentation, it's a hit and miss for me so development time is increased drastically. If there is no documentation for developers, are there any plans down the road for some?

Again many thanks
mazhar  
#17 Posted : Friday, May 1, 2020 9:58:37 AM(UTC)
mazhar

Rank: Administration

Groups: Admin, Administrators, HelpDesk, System, Authorized User, Developers, Registered
Joined: 10/5/2018(UTC)
Posts: 175

Thanks: 8 times
Was thanked: 17 time(s) in 15 post(s)
You can check http://api.ablecommerce.com/ for developer related documentation. We are working on it, improving and covering more topics.
ray22901031  
#18 Posted : Friday, May 1, 2020 10:02:34 AM(UTC)
ray22901031

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 2/17/2019(UTC)
Posts: 909

Thanks: 3 times
Was thanked: 15 time(s) in 15 post(s)
Thank you, I am aware of this but unfortunately this is not what would be considered reading material, but rather a reference guide to the API themselves. I think someone needs to reach out to Mike and explained to him the tremendous benefits of having someone create an article on the proper way to create a theme, and just common sense basic practices.

I can assure you this would go a long way for future sales.

Magento 2, was an absolute mess, but at least it had tremendous documentation.

I hope if Mike reads this, he would consider this request.

Many thanks to all
ray22901031  
#19 Posted : Saturday, May 2, 2020 4:10:13 PM(UTC)
ray22901031

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 2/17/2019(UTC)
Posts: 909

Thanks: 3 times
Was thanked: 15 time(s) in 15 post(s)
Hello Mazhar,

One small problem with the code, all items are now require to click to view price, it should only work with those items which have "Require user to click to view price", should have an else statement somewhere I think. Not up to speed on .NET programming at this time.

Thanks for your time,
-Ray
mazhar  
#20 Posted : Saturday, May 2, 2020 7:59:32 PM(UTC)
mazhar

Rank: Administration

Groups: Admin, Administrators, HelpDesk, System, Authorized User, Developers, Registered
Joined: 10/5/2018(UTC)
Posts: 175

Thanks: 8 times
Was thanked: 17 time(s) in 15 post(s)
You can use following snippet
Code:

@if (Model.ShowOurPrice)
            {
                var product = AbleContext.Container.Resolve<CommerceBuilder.Products.IProductRepository>()
                   .Load(Model.Product.Id);
                if (product != null && product.HidePrice)
                {
                    <script>
                    $(function () {
                        $("#ShowPriceLink").click(function () {
                            $.ajax({
                                url: '@Url.Action("ProductPrice")',
                                type: "GET",
                                data: {
                                    ProductId: @Model.Product.Id,
                                    OptionList: '@Model.OptionList',
                                    SelectedKitProducts: [@string.Join(",", Model.SelectedKitProducts.Select(i => i.ToString()).ToArray())],
                                }
                            }).done(function (data) {
                                $("#price-container").html(data);
                                $("#ShowPriceLink").click();
                            });
                        });
                    })
                    </script>
                    <span id="price-container">
                        <h5><a id="ShowPriceLink">@string.Format(GetResourceString("retail.productprice.show_me_the_price_of_{0}", false).ToString(), Model.Product.Name)</a></h5>
                    </span>
                }
                else
                {
                    <span>
                        @Html.Action("ProductPrice", new { ProductId = Model.Product.Id, OptionList = Model.OptionList, SelectedKitProducts = Model.SelectedKitProducts })
                    </span>
                }
            }

Edited by user Saturday, May 2, 2020 9:33:04 PM(UTC)  | Reason: Not specified

Users browsing this topic
Guest (4)
2 Pages12>
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.