Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 18 of 18

Thread: Extended Pricing Display Question

  1. #1
    miguelcrush is offline Senior Member
    Join Date
    Mar 2008
    Posts
    149

    Default Extended Pricing Display Question

    My store is using customer group pricing. Everything works fine, but I was wondering if there is a way to remove the customer level being displayed in the display of the price. For instance, I have a group called dealer 3. If a customer looks at a product it will show the regular price, then it will say "DEALER 3 Price:"------- I would rather just have "Your Price."

    Any ideas?? I checked the string resource manager to no avail.
    Mike Steyer
    Information Systems Admin

  2. #2
    ASPDNSF Staff - Jon's Avatar
    ASPDNSF Staff - Jon is offline Senior Member
    Join Date
    Sep 2004
    Posts
    11,419

    Default

    The behavior of the "aspdnsf:AddToCartForm()" XSL Helper is to display "customerLevelName", then a space, then "showproduct.aspx.26".

    You have two options (neither very good):
    • Do a string replacement on the markup returned by aspdnsf:AddToCartForm(). Replace "DEALER 3 Price:" with "Your Price:"
    • Don't use aspdnsf:AddToCartForm(), and create your own layout using XSL.
    Jon Wolthuis

  3. #3
    miguelcrush is offline Senior Member
    Join Date
    Mar 2008
    Posts
    149

    Default

    Yeesh. Alright, could you tell me where that value from AddToCartForm() is returned? Like which file(s)?

    Thanks Jon!
    Mike Steyer
    Information Systems Admin

  4. #4
    ASPDNSF Staff - Jon's Avatar
    ASPDNSF Staff - Jon is offline Senior Member
    Join Date
    Sep 2004
    Posts
    11,419

    Default

    It's a method in the XSLTExtensionBase class, within the AspDotNetStorefrontCommon project, available when purchasing the source code. But you don't need source code to do either of my bullet-points.
    Jon Wolthuis

  5. #5
    miguelcrush is offline Senior Member
    Join Date
    Mar 2008
    Posts
    149

    Default

    So how would one go about doing the string replacement? I've been trying to wrap my head around it, or maybe I'm thinking too deep.
    Mike Steyer
    Information Systems Admin

  6. #6
    Jesse is offline Banned
    Join Date
    May 2008
    Posts
    1,329

    Default

    In your xml package (default product.VariantsInRightBar.xml.config) for that area of text, find the SECOND area where it pulls the product variant price. Should be right around line 439 and look like this:

    <xsl:value-of select="aspdnsf:GetVariantPrice(VariantID, number(HidePriceUntilCart), Price, SalePrice, ExtendedPrice, Points, $pSalesPromptName, TaxClassID)"/>



    You're going to comment that out and replace it with a choose. You can't have it always fire the replacement, or it will act funky for non-customer level prices.
    Code:
    <xsl:choose>
    <xsl:when test="/root/Runtime/CustomerLevelID&gt;0">
    <xsl:value-of select="concat(substring-before(aspdnsf:GetVariantPrice(VariantID, number(HidePriceUntilCart), Price, SalePrice, ExtendedPrice, Points, $pSalesPromptName, TaxClassID),'My Customer Level'),'My New Price Prompt ', substring-after(aspdnsf:GetVariantPrice(VariantID, number(HidePriceUntilCart), Price, SalePrice, ExtendedPrice, Points, $pSalesPromptName, TaxClassID),'My Customer Level'))" disable-output-escaping="yes" />
    </xsl:when>
    <xsl:otherwise>
    <xsl:value-of select="aspdnsf:GetVariantPrice(VariantID, number(HidePriceUntilCart), Price, SalePrice, ExtendedPrice, Points, $pSalesPromptName, TaxClassID)"/>
    </xsl:otherwise>
    </xsl:choose>
    Of course, change the 'My Customer Level' with exactly what you want to replace... both times. And change the 'My New Price Prompt' with what you want to say instead. How's that work for ya?
    Last edited by Jesse; 05-14-2008 at 08:15 AM.

  7. #7
    Rob is offline Senior Member
    Join Date
    Aug 2004
    Posts
    3,037

    Default

    I'd have to test this, as it's a bit not normal, but here's a suggestion to try:

    if you don't need the customer level name showing anywhere, just use a " " (space) as the name of the customer level. That may work (i've never tried it) and will solve the issue.

    We show the customer level next to their logged in name also, so i'm thinking ths may not work for you, but it's very easy to try and may require no code mods.
    AspDotNetStorefront
    Shopping Cart

  8. #8
    miguelcrush is offline Senior Member
    Join Date
    Mar 2008
    Posts
    149

    Default

    Jesse! Thank you! But it doesn't seem to catch the customer level. If I take that replace statement out of the choose element and force it to fire, it will work. But then it messes up non-customer-leveled prices, like you said. Here's whats actually in my code right now (I substituted the "0" for "2" because to us, 0's are anons and 2's are registered):

    <!--<xsl:value-of select="aspdnsf:GetVariantPrice(VariantID, number(HidePriceUntilCart), Price, SalePrice, ExtendedPrice, Points, $pSalesPromptName, TaxClassID)" disable-output-escaping="yes" />-->
    <xsl:choose>
    <xsl:when test="root/Runtime/CustomerLevelID&gt;2">
    <xsl:value-of select="concat(substring-before(aspdnsf:GetVariantPrice(VariantID, number(HidePriceUntilCart), Price, SalePrice, ExtendedPrice, Points, $pSalesPromptName, TaxClassID),'ALL'),'Your', substring-after(aspdnsf:GetVariantPrice(VariantID, number(HidePriceUntilCart), Price, SalePrice, ExtendedPrice, Points, $pSalesPromptName, TaxClassID),'ALL'))" disable-output-escaping="yes"/>
    </xsl:when>
    <xsltherwise>
    <xsl:value-of select="aspdnsf:GetVariantPrice(VariantID, number(HidePriceUntilCart), Price, SalePrice, ExtendedPrice, Points, $pSalesPromptName, TaxClassID)" disable-output-escaping="yes"/>
    </xsltherwise>
    </xsl:choose>

    I don't know... yikes.
    Mike Steyer
    Information Systems Admin

  9. #9
    JWS is offline Junior Member
    Join Date
    Apr 2008
    Posts
    12

    Default

    Mike, I was just browsing and saw your post, so I may not know all the details, but....

    Wouldn't your customer level need to be "&gt;1" vs. "&gt;2" since the level you're wanting it to catch is when it IS 2?

    Jamie

  10. #10
    miguelcrush is offline Senior Member
    Join Date
    Mar 2008
    Posts
    149

    Default

    In our scenario, level 0 are anons, therefore they will only have the one price to worry about. Having a Your Price: with the same price will be unnecessary. The only difference between level 0 and level 2 (level one does not exist) is that level 2 customers are registered. The name of the level 2 group is "ALL." It would be preferable to not have a prompt of "ALL Price" that is the same as the regular price.
    Mike Steyer
    Information Systems Admin

  11. #11
    JWS is offline Junior Member
    Join Date
    Apr 2008
    Posts
    12

    Default

    Right, but if you are checking for a customer level > 2, it'll never "choose" that modification section to replace your prompt because that test will always fail.

    Did it not work for Jesse's original ">0" test? I would think it would've worked.

    Jamie


    Quote Originally Posted by miguelcrush View Post
    In our scenario, level 0 are anons, therefore they will only have the one price to worry about. Having a Your Price: with the same price will be unnecessary. The only difference between level 0 and level 2 (level one does not exist) is that level 2 customers are registered. The name of the level 2 group is "ALL." It would be preferable to not have a prompt of "ALL Price" that is the same as the regular price.

  12. #12
    miguelcrush is offline Senior Member
    Join Date
    Mar 2008
    Posts
    149

    Default

    We have more than just those two customer levels, all the way up to an ID of 7. I tried it at zero at first, just to see if it was functional, but when it does have to choose, it fails.
    Mike Steyer
    Information Systems Admin

  13. #13
    Jesse is offline Banned
    Join Date
    May 2008
    Posts
    1,329

    Default

    Hi Mike,

    What you're going to have to do is add an "<xsl:when" into the choose tag provided for each of the customer IDs you want to parse, with the specific information you wish to replace provided for that customerIDs level name. The &gt;0 portion was to ensure the customer was not "anon" and then just swapped out a specific customerID level name. That customerID level name is most likely not the same for all 7 of your customerIDs... and therefore will have to likewise be parsed.

    It's a bit of typing, but it's how you're going to want to do it if you want that price string changed for each of your customerIDs.

    Thanks,

  14. #14
    miguelcrush is offline Senior Member
    Join Date
    Mar 2008
    Posts
    149

    Default

    Great. Thanks Jesse. What books would you recommend for someone to read if they want to become proficient at this stuff (xsl/t specifically)?
    Mike Steyer
    Information Systems Admin

  15. #15
    Jesse is offline Banned
    Join Date
    May 2008
    Posts
    1,329

    Default

    Hi Mike,

    You actually caught me on the best day possible with that question. I've recently been going through "XSLT" by Jenni Tennison from Apress. Good book. Lots of XSLT loving in there to include detailed descriptions of the top-level intrinsic methods and what you're capable of doing in it. There's also, as always, very powerful articles for almost every single markup techonology known to man at W3Schools. Enjoy!

  16. #16
    Rob is offline Senior Member
    Join Date
    Aug 2004
    Posts
    3,037

  17. #17
    movingon is offline Junior Member
    Join Date
    May 2010
    Posts
    2

    Default extended pricing display question

    Hello,
    I am on version 8.0.1.2 and it seems to not use showproduct.aspx.26 because when I look at this it just says Price:, but on my display, it is displaying Regular Price:

    Is there a way to find out which string is being used so I can modify the string?

    Quote Originally Posted by ASPDNSF Staff - Jon View Post
    The behavior of the "aspdnsf:AddToCartForm()" XSL Helper is to display "customerLevelName", then a space, then "showproduct.aspx.26".

    You have two options (neither very good):
    • Do a string replacement on the markup returned by aspdnsf:AddToCartForm(). Replace "DEALER 3 Price:" with "Your Price:"
    • Don't use aspdnsf:AddToCartForm(), and create your own layout using XSL.

  18. #18
    AspDotNetStorefront Staff - Scott's Avatar
    AspDotNetStorefront Staff - Scott is offline Administrator
    Join Date
    Mar 2007
    Location
    Ashland, OR
    Posts
    2,390