1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Custom currency in user upgrade?

Discussion in 'XenForo Questions and Support' started by Tommy, Apr 19, 2012.

  1. Tommy

    Tommy Member

    Hello, this is my first post, and i am wondering if it is possible to add a custom/different currency in the user upgrade system? I need NOK since i'm from Norway :)

    Great forum software btw! :D

    Regards,
    Tommy.
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

  3. Tommy

    Tommy Member

  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

  5. Tommy

    Tommy Member

  6. ragtek

    ragtek Guest

  7. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    The query is enough to get it working. But it won't reflect in the Admin CP unless you make those additional code changes.
     
  8. Tommy

    Tommy Member

    I cannot find "Admin CP -> Development -> Admin Templates -> user_upgrade_edit" in my admin CP.

    This is my user_upgrade_edit template:
    PHP:
    <xen:title>{xen:phrase account_upgrades}</xen:title>
     
    <
    xen:require css="account_upgrades.css" />
     
    <
    xen:if is="{$available}">
        <
    div class="section">
            <
    h3 class="subHeading">{xen:phrase available_upgrades}</h3>
            <
    ul>
            <
    xen:foreach loop="$availablevalue="$upgrade">
                <
    li class="primaryContent">
                    <
    div class="upgrade">                   
                        <
    form action="{$payPalUrl}method="post" class="upgradeForm">
                            <
    div class="cost">{$upgrade.costPhrase}</div>
                            <
    xen:if is="{$upgrade.length_unit} AND {$upgrade.recurring}">
                                   
                                <
    input type="hidden" name="cmd" value="_xclick-subscriptions" />
                                <
    input type="hidden" name="a3" value="{$upgrade.cost_amount}/>
                                <
    input type="hidden" name="p3" value="{$upgrade.length_amount}/>
                                <
    input type="hidden" name="t3" value="{$upgrade.lengthUnitPP}/>
                                <
    input type="hidden" name="src" value="1" />
                                <
    input type="hidden" name="sra" value="1" />
                               
                                <
    input type="submit" value="{xen:phrase subscribe}" class="button" />
                            <
    xen:else />
                                <
    input type="hidden" name="cmd" value="_xclick" />
                                <
    input type="hidden" name="amount" value="{$upgrade.cost_amount}/>
                               
                                <
    input type="submit" value="{xen:phrase purchase}" class="button" />
                            </
    xen:if>
                           
                            <
    input type="hidden" name="business" value="{$xenOptions.payPalPrimaryAccount}/>
                            <
    input type="hidden" name="currency_code" value="{$upgrade.currency}/>
                            <
    input type="hidden" name="item_name" value="{xen:phrase account_upgrade}: {$upgrade.title} ({$visitor.username})" />
                            <
    input type="hidden" name="quantity" value="1" />
                            <
    input type="hidden" name="no_note" value="1" />
                            <
    input type="hidden" name="no_shipping" value="1" />
                            <
    input type="hidden" name="custom" value="{$visitor.user_id},{$upgrade.user_upgrade_id},token,{$visitor.csrf_token_page}/>
                           
                            <
    input type="hidden" name="charset" value="utf-8" />
                            <
    input type="hidden" name="email" value="{$visitor.email}/>
                           
                            <
    input type="hidden" name="return" value="{$requestPaths.fullBasePath}{xen:link account/upgrade-purchase}" />
                            <
    input type="hidden" name="cancel_return" value="{$requestPaths.fullBasePath}{xen:link index}" />
                            <
    input type="hidden" name="notify_url" value="{$xenOptions.boardUrl}/payment_callback.php" />
                        </
    form>
                       
                        <
    div class="upgradeMain">
                            <
    h4 class="title">{$upgrade.title}</h4>
                            <
    xen:if is="{$upgrade.description}">
                                <
    div class="description">{xen:string nl2br$upgrade.description}</div>
                            </
    xen:if>
                        </
    div>
                    </
    div>
                </
    li>
            </
    xen:foreach>
            </
    ul>
        </
    div>
    </
    xen:if>
     
    <
    xen:if is="{$purchased}">
        <
    div class="section">
            <
    h3 class="subHeading">{xen:phrase purchased_upgrades}</h3>
            <
    ul>
            <
    xen:foreach loop="$purchasedvalue="$upgrade">
                <
    li class="primaryContent">
                    <
    div class="upgrade">                   
                        <
    div class="upgradeForm">
                            <
    xen:if is="{$upgrade.record.end_date}">
                                <
    div>{xen:phrase expires}: <xen:datetime time="$upgrade.record.end_date" /></div>
                            </
    xen:if>
                            <
    xen:if is="{$upgrade.length_unit} AND {$upgrade.recurring}">
                                <
    a href="{$payPalUrl}?cmd=_subscr-find&amp;alias={xen:urlencode $xenOptions.payPalPrimaryAccount}" class="button">{xen:phrase cancel_subscription}</a>
                            </
    xen:if>
                        </
    div>
                       
                        <
    div class="upgradeMain">
                            <
    h4 class="title">{$upgrade.title}</h4>
                            <
    xen:if is="{$upgrade.description}">
                                <
    div class="description">{xen:string nl2br$upgrade.description}</div>
                            </
    xen:if>
                        </
    div>
                    </
    div>
                </
    li>
            </
    xen:foreach>
            </
    ul>
        </
    div>
    </
    xen:if>
     
  9. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    You must enable debug mode to access the Development tab. You can enable debug mode by adding this line to your library/config.php file:

    Code:
    $config['debug'] = 1;
    
     
    Tommy likes this.
  10. Tommy

    Tommy Member

    Aah! Thank you! :) I wasn't aware of that... :whistle:
     
  11. Dinh Thanh

    Dinh Thanh Well-Known Member

    Jake Bunce likes this.

Share This Page