コード例 #1
0
 /**
  * Loads the class that will handle prices in different currencies for each
  * product.
  */
 private function load_currencyprices_manager()
 {
     $this->_currencyprices_manager = WC_Aelia_CurrencyPrices_Manager::Instance();
 }
コード例 #2
0
 /**
  * Returns the singleton instance of the prices manager.
  *
  * @return WC_Aelia_CurrencyPrices_Manager
  */
 public static function Instance()
 {
     if (empty(self::$instance)) {
         self::$instance = new WC_Aelia_CurrencyPrices_Manager();
     }
     return self::$instance;
 }
コード例 #3
0
 public function __construct()
 {
     $this->currencyprices_manager = WC_Aelia_CurrencyPrices_Manager::Instance();
     $this->set_hooks();
 }
コード例 #4
0
<?php

if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
use Aelia\WC\CurrencySwitcher\Subscriptions\Subscriptions_Integration;
use Aelia\WC\CurrencySwitcher\Subscriptions\WC_Aelia_CS_Subscriptions_Plugin;
$currencyprices_manager = WC_Aelia_CurrencyPrices_Manager::instance();
$enabled_currencies = WC_Aelia_CurrencySwitcher::settings()->get_enabled_currencies();
$base_currency = WC_Aelia_CurrencySwitcher::settings()->base_currency();
// The text domain for translations
$text_domain = WC_Aelia_CS_Subscriptions_Plugin::$text_domain;
$post_id = $currencyprices_manager->current_post->ID;
echo '<div id="wc_aelia_cs_subscription_prices" class="clearfix show_if_subscription">';
// Debug
echo 'DEBUG - SUBSCRIPTION';
// Display header of currency pricing section
include 'currencyprices_header.php';
$product_regular_prices = $currencyprices_manager->get_product_regular_prices($post_id);
$product_sale_prices = $currencyprices_manager->get_product_sale_prices($post_id);
$signup_prices = Subscriptions_Integration::get_subscription_signup_prices($post_id);
echo '<table>';
echo '<tr>';
echo '<th>';
echo '</th>';
echo '<th>';
echo __('Regular price', $text_domain);
echo '</th>';
echo '<th>';
echo __('Sale price', $text_domain);