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

Options
Go to last post Go to first unread
ray22901031  
#1 Posted : Sunday, May 3, 2020 11:01:07 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 Everyone,

This is a continuation from the MAP issues that I was having. The minimal advertise price component of the product page has been fixed and is working properly, but now I need to turn my attention to the product schema that Google uses.

I'm trying to replace the price to show from (Model.MSRP), not (Model.Price), but I guess that I must declare (Model.MSRP) somewhere else. If you can steer me in the proper direction, I'm going to try to do this myself.

Eventually, there will be an if statement that checks (Model.ShowOurPrice), if true, MSRP, gets return else Price gets return. Starting to get the hang of razor syntax.

Many thanks,
-Ray

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

mazhar  
#2 Posted : Monday, May 4, 2020 12:16:30 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)
Since you have already implemented an IF/ELSE in the BuyProductDialog view file. You can pass the MSRP value from the same view file to ProductShema. You can add the following code in the IF statement that executes when the product requires the user to click show price.
Code:
TempData["MSRP"] = product.MSRP;

Then you can update the ProductSchema view file to read this information and use it.
Code:
decimal price = TempData.ContainsKey("MSRP") ? (decimal)TempData["MSRP"] : Model.Price;

finally instead of using Model.Price you can update to use price variable.
Users browsing this topic
Guest
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.