當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


PHP WHMCS OrderDomainPricingOverride用法及代碼示例

在購物車中計算域名價格時執行。

參數

變量 類型 注意
type string registertransfer
domain string
regperiod int 域名注冊期限(年)
renewalperiod int 域名續約年限(年)
dnsmanagement bool
emailforwarding bool
idprotection bool
eppcode string 僅可用於轉讓。
isPremium bool

響應

覆蓋第一筆付款的浮點數,或覆蓋第一筆和/或經常性數量的數組

示例代碼


<?php

add_hook('OrderDomainPricingOverride', 1, function($vars) {
    // Perform operations to determine price.
    // To override the first payment amount only simply return a float
    return '64.95';
    // To override the first payment and recurring amount, return an array as follows
    return ['firstPaymentAmount' => 64.95, 'recurringAmount' => 14.45];
});

相關用法


注:本文由純淨天空篩選整理自whmcs.com大神的英文原創作品 OrderDomainPricingOverride。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。