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
|
|
|
|
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.
|
|
|
|
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.
Important Information:
The AbleCommerce Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close