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 34 of 34

Thread: Display Exhchange rate on product and checkout pages

  1. #1
    nihon is offline Senior Member
    Join Date
    May 2008
    Posts
    150

    Default Display Exhchange rate on product and checkout pages

    Hi can anybody help out and find away how i can display the exchange rate for my sub currency.

    thanks
    Version (Code/DB):
    AspDotNetStorefront ML 8.1.2.0/8.1.2.0

  2. #2
    deanfp is offline Senior Member
    Join Date
    May 2009
    Location
    Sweden
    Posts
    556

    Default

    It changes so much that we just add a link to http://www.xe.com/ucc/

    They do a converter that you can add to your page http://www.xe.com/ucc/customize.php

  3. #3
    nihon is offline Senior Member
    Join Date
    May 2008
    Posts
    150

    Default

    Thanks for this ..nice idea, but i just want to show my clients the rate we are converting at .. so basically the figure i have in the admin - currency page ..
    Version (Code/DB):
    AspDotNetStorefront ML 8.1.2.0/8.1.2.0

  4. #4
    DanV's Avatar
    DanV is offline Ursus arctos horribilis
    Join Date
    Apr 2006
    Posts
    1,568

    Default

    You could either query it directly from Currency table and output it to the page, or write a small XMLPackage to do it. Either way, it should be a simple mod.

  5. #5
    nihon is offline Senior Member
    Join Date
    May 2008
    Posts
    150

    Default

    Thank you Dan ..

    Hmm... write a query or XML..

    I have no idea how to write that ..
    anybody has the time to help me out
    Thanks guys ..
    Version (Code/DB):
    AspDotNetStorefront ML 8.1.2.0/8.1.2.0

  6. #6
    nihon is offline Senior Member
    Join Date
    May 2008
    Posts
    150

    Default

    Anybody would like to help me out on this ..
    I want to add the exchange rate and the converted total price..
    So my main is GBP, under the Total GBP Price i want to show the exchange rate and the AUD price ..

    Thanking in advanced
    Version (Code/DB):
    AspDotNetStorefront ML 8.1.2.0/8.1.2.0

  7. #7
    nihon is offline Senior Member
    Join Date
    May 2008
    Posts
    150

    Default

    I have been fooling around for the past 10days and cant seem to figure it out .. anybody care to guide me with this ..
    Thanks guys
    Version (Code/DB):
    AspDotNetStorefront ML 8.1.2.0/8.1.2.0

  8. #8
    Jao is offline Senior Member
    Join Date
    Oct 2008
    Posts
    1,132

    Default

    These links could be your starting point: Learning about XMLPackage
    XMLPackages

  9. #9
    nihon is offline Senior Member
    Join Date
    May 2008
    Posts
    150

    Default

    Thanks for that Jao.
    If i had to add the subtotal in a differant currency would i need to use the XML too?
    i was plating around with
    HTML Code:
    Localization.CurrencyStringForDisplayWithoutExchangeRate(SubTotal, ThisCustomer.CurrencySetting);
    How can i use this to specify a currency. thanks
    Version (Code/DB):
    AspDotNetStorefront ML 8.1.2.0/8.1.2.0

  10. #10
    Jao is offline Senior Member
    Join Date
    Oct 2008
    Posts
    1,132

    Default

    Yes, you could use that line, simply change the ThisCustomer.CurrencySetting to the desire currency you want to use. You don't need to create an XMLPackage for that kind of request.

  11. #11
    nihon is offline Senior Member
    Join Date
    May 2008
    Posts
    150

    Default

    Thanks for the advise ..
    Please do not laugh at me ..
    so would it be
    Localization.CurrencyStringForDisplayWithoutExchan geRate(SubTotal, AUD);
    Thanks
    Version (Code/DB):
    AspDotNetStorefront ML 8.1.2.0/8.1.2.0

  12. #12
    Jao is offline Senior Member
    Join Date
    Oct 2008
    Posts
    1,132

    Default

    Yes, but it should be like this:
    Code:
    Localization.CurrencyStringForDisplayWithoutExchangeRate(SubTotal, "AUD");

  13. #13
    nihon is offline Senior Member
    Join Date
    May 2008
    Posts
    150

    Default

    HA ..
    You have no idea what funny code i was coming up with..

    I would have never figured that out .. thanks a million.
    Kind Regards
    Version (Code/DB):
    AspDotNetStorefront ML 8.1.2.0/8.1.2.0

  14. #14
    Jao is offline Senior Member
    Join Date
    Oct 2008
    Posts
    1,132

    Default

    It's okay, curiosity leads to a greater discovery, keep it up. You always have guys to back you up...

  15. #15
    nihon is offline Senior Member
    Join Date
    May 2008
    Posts
    150

    Default

    Thanks for your kind comment.

    Now am on to the next step, trying to figure out how to tell the system to hide the small code i just placed when its in AUD mode. .

    i douth i can mange to figure it out but i shall try..
    Version (Code/DB):
    AspDotNetStorefront ML 8.1.2.0/8.1.2.0

  16. #16
    nihon is offline Senior Member
    Join Date
    May 2008
    Posts
    150

    Default

    I feel i am one step closer.

    HTML Code:
    if (Currency.GetDefaultCurrency() == ThisCustomer.CurrencySetting)
                {
                    CartSubTotalAU.Visible = false;
                }
    This seems to work but the other way round. i need this to work when on the AUD and not on my default GBP. Any ideas ..

    I think i need to change the GetDefaultCurrency.. but to what?
    Version (Code/DB):
    AspDotNetStorefront ML 8.1.2.0/8.1.2.0

  17. #17
    nihon is offline Senior Member
    Join Date
    May 2008
    Posts
    150

    Default

    I got it ..

    HTML Code:
    if (("AUD") == ThisCustomer.CurrencySetting)
                {
                    CartSubTotalAU.Visible = false;
    YES YES
    Version (Code/DB):
    AspDotNetStorefront ML 8.1.2.0/8.1.2.0

  18. #18
    nihon is offline Senior Member
    Join Date
    May 2008
    Posts
    150

    Default

    Am so proud of my self .. sorry guys .. i had to post this.. Name:  01.jpg
Views: 35
Size:  24.8 KB

    Thank you Jao
    Version (Code/DB):
    AspDotNetStorefront ML 8.1.2.0/8.1.2.0

  19. #19
    nihon is offline Senior Member
    Join Date
    May 2008
    Posts
    150

    Default

    Hi guys am tryig to put the exchange rate on the page and most of all on the receipt.
    Can anybody confirm this code for me ..
    Code:
    <?xml version="1.0" standalone="yes"?>
    <!-- ###################################################################################################### -->
    <!-- Copyright AspDotNetStorefront.com, 1995-2009.  All Rights Reserved.					                -->
    <!-- http://www.aspdotnetstorefront.com														                -->
    <!-- For details on this license please visit  the product homepage at the URL above.		                -->
    <!-- THE ABOVE NOTICE MUST REMAIN INTACT.                                                                   -->
    <!-- ###################################################################################################### -->
    <package displayname="Order Receipt" version="2.1" debug="false" >
        <query name="Currency" rowElementName="ExchangeRate">
            <sql>
                <![CDATA[
                     select ExchangeRate from dbo.Currency where ExchangeRate = @ExchangeRate
                ]]>
            </sql>
    		<queryparam paramname="@ExchangeRate" paramtype="runtime" requestparamname="ExchangeRate" defvalue="0" sqlDataType="int" validationpattern="^\d{1,9}$"/>
        </query>
       
    
        <PackageTransform>
    		<xsl:stylesheet version="1.0"
    				 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    				 xmlns:aspdnsf="urn:aspdnsf"
    					xmlns:receipt="urn:receipt"
    				 xmlns:msxsl="urn:schemas-microsoft-com:xslt"
    				 exclude-result-prefixes="receipt" >
    			<xsl:output method="html" omit-xml-declaration="yes" encoding="utf-8"/>
    			
    
    
    			
    	
    			<xsl:template match="/">
    				<name>
    					<!--AUD ExchangeRate:-->
    					<xsl:value-of select="aspdnsf:StringResource('notification.betareceipt.xml.config.17')" disable-output-escaping="yes" />
    				</name>
    				<td class="tdOrderHeaderValue">
    					<span id="lblOrderNumber">
    						<xsl:value-of select="@OrderInfo/ExchangeRate" />
    					</span>
    				</td>
    				
    				
    				</xsl:template>
    
    				</xsl:stylesheet>
    				</PackageTransform>
    </package>
    Version (Code/DB):
    AspDotNetStorefront ML 8.1.2.0/8.1.2.0

  20. #20
    nihon is offline Senior Member
    Join Date
    May 2008
    Posts
    150

    Default

    I know the classes and notification.betareceipt.xml.config.17 are not correct, these i will change once i figure out how to display the dam exchange rate .. i have been 4 days non stop to do this .. and it does not work ..
    Version (Code/DB):
    AspDotNetStorefront ML 8.1.2.0/8.1.2.0

  21. #21
    Jao is offline Senior Member
    Join Date
    Oct 2008
    Posts
    1,132

    Default

    The first thing to do here is to set the debug property of the package tag to true and see if the XML was able to pull out the information.

  22. #22
    nihon is offline Senior Member
    Join Date
    May 2008
    Posts
    150

    Default

    ok thanks .. but how about the code am i on the write track.. as i have no idea what certain things mean. am just copying and pasting trying all sorts and nothing is displaying..
    Version (Code/DB):
    AspDotNetStorefront ML 8.1.2.0/8.1.2.0

  23. #23
    nihon is offline Senior Member
    Join Date
    May 2008
    Posts
    150

    Default

    ow wow .. this debug property of the package tag to true has loaded loads of info .. lets see if i can understand it ..
    Version (Code/DB):
    AspDotNetStorefront ML 8.1.2.0/8.1.2.0

  24. #24
    Jao is offline Senior Member
    Join Date
    Oct 2008
    Posts
    1,132

    Default

    If the <ExchangeRate> tag is available and it contains an information, it means that the query has successfully pull out the necessary information and is ready to be displayed once called.

  25. #25
    nihon is offline Senior Member
    Join Date
    May 2008
    Posts
    150

    Default

    in the currency.xml.config_store.runtime.xml
    i have no <ExchangeRate> tag showing
    Version (Code/DB):
    AspDotNetStorefront ML 8.1.2.0/8.1.2.0

  26. #26
    nihon is offline Senior Member
    Join Date
    May 2008
    Posts
    150

    Default

    ok i think i have the <query name=" " rowElementName=" ">
    Wrong what should these be?
    Whats is rowElementName ?
    Version (Code/DB):
    AspDotNetStorefront ML 8.1.2.0/8.1.2.0

  27. #27
    Jao is offline Senior Member
    Join Date
    Oct 2008
    Posts
    1,132

    Default

    Okay, first, could you tell me what XML package you're trying to modify here? So that I could work on it.

  28. #28
    nihon is offline Senior Member
    Join Date
    May 2008
    Posts
    150

    Default

    Thanks Joe,
    The XML am working on is a new one, its based from a lot of copy and past from the receipt XML file, i pasted the code on page 2 of this tread.
    Is that ok .. would you like me to email you the file..
    Thanks for your patience
    Version (Code/DB):
    AspDotNetStorefront ML 8.1.2.0/8.1.2.0

  29. #29
    Jao is offline Senior Member
    Join Date
    Oct 2008
    Posts
    1,132

    Default

    Well, you could try this one, under the notification.receipt.xml.config:
    Code:
    <!-- Price Column -->
    <td id="colPrice" width="10%">
    CURRENT RATE:
                <xsl:value-of select="receipt:FormatCurrencyWithoutCurrencyCode(DisplayPrice)"  disable-output-escaping="yes" />
    EXCHANGE RATE:
                <xsl:value-of select="receipt:FormatCurrencyWithoutCurrencyCode(DisplayPrice, 'AUD')" disable-output-escaping="yes" />
    Note: Highlighted parts are the ones added. See if that works for you.

  30. #30
    nihon is offline Senior Member
    Join Date
    May 2008
    Posts
    150

    Default

    Thanks Jeo
    Just to make sure would this be garbing and displaying the exchange rate i have in the Admin.. as this is what am after.. thanks
    Version (Code/DB):
    AspDotNetStorefront ML 8.1.2.0/8.1.2.0

  31. #31
    Jao is offline Senior Member
    Join Date
    Oct 2008
    Posts
    1,132

    Default

    Yes, it should be as long as the TargetCurrency, which is the second parameter matches that of the other pages accordingly.

  32. #32
    nihon is offline Senior Member
    Join Date
    May 2008
    Posts
    150

    Default

    THANKS JEO
    This actually made some thing very nice and use full .. Please see attached.. Name:  Screen shot 2009-11-26 at 2.52.48 PM.png
Views: 34
Size:  5.2 KB
    But what am actually after is the actual exchange rate that i input in the currency page . Example
    1.00 Pound Sterling (GBP) = 1.71 Australian Dollar (AUD)
    Version (Code/DB):
    AspDotNetStorefront ML 8.1.2.0/8.1.2.0

  33. #33
    Jao is offline Senior Member
    Join Date
    Oct 2008
    Posts
    1,132

    Default

    Well, here's a simple modification on the notification.receipt.xml.config. You can add these lines of code in the template: GetAvailableHeaders, let's say, we put it at the bottom part:
    Code:
    				<xsl:if test="$isVatEnabled = true() and $OrderInfo/VATRegistrationID != ''">
    					<header>
    						<name>
    							<!--Vat Registration ID:-->
    							<xsl:value-of select="aspdnsf:StringResource('notification.betareceipt.xml.config.26')" disable-output-escaping="yes" />
    						</name>
    						<value>
    							<xsl:value-of select="$OrderInfo/VATRegistrationID" disable-output-escaping="yes" />
    						</value>
    					</header>
    				</xsl:if>
            <header>
              <name>
                <!--Current Rate:-->
                <xsl:value-of select="'Current Rate:'" disable-output-escaping="yes" />
              </name>
              <value>
                <xsl:value-of select="/root/System/PrimaryCurrency" /> : <xsl:value-of select="receipt:FormatCurrencyWithoutCurrencyCode(1.00)"  disable-output-escaping="yes" />
              </value>
            </header>
            <header>
              <name>
                <!--Exchange Rate:-->
                <xsl:value-of select="'Exchange Rate:'" disable-output-escaping="yes" />
              </name>
              <value>
                <xsl:value-of select="'AUD'" /> : <xsl:value-of select="receipt:FormatCurrencyWithoutCurrencyCode(1.00,'AUD')"  disable-output-escaping="yes" />
              </value>
            </header>
    Note: The highlighted parts are the added lines.

  34. #34
    nihon is offline Senior Member
    Join Date
    May 2008
    Posts
    150

    Default

    OMG..
    JOE.. THANK YOU THANK YOU..
    Dam this is perfect ..

    For all does fooling around with other Storefronts well you are losing out so much. Aspdotnetstorefront and the people involved makes this system so powerful and worth every penny..
    THANKS JOE..
    Version (Code/DB):
    AspDotNetStorefront ML 8.1.2.0/8.1.2.0