</th>
					<td><?php 
    echo ThemexWoo::getPrice(ThemexUser::$data['current']['balance']);
    ?>
</td>
				</tr>
				<?php 
    if (!ThemexCore::checkOption('shop_multiple') && ThemexShop::$data['status'] == 'publish') {
        ?>
				<tr>
					<th><?php 
        _e('Current Rate', 'makery');
        ?>
</th>				
					<td><?php 
        echo ThemexShop::filterRate(ThemexShop::$data['ID'], ThemexShop::$data['rate']);
        ?>
%</td>
				</tr>
				<?php 
    }
    $methods = array_flip(ThemexCore::getOption('withdrawal_methods', array('paypal', 'skrill', 'swift')));
    $gateways = ThemexWoo::getPaymentMethods();
    if (count($gateways) > 1 || !isset($gateways['paypal-adaptive-payments'])) {
        foreach (ThemexCore::$components['forms']['withdrawal'] as $name => $field) {
            if (is_array(reset($field))) {
                if (isset($methods[$name])) {
                    foreach ($field as $key => $child) {
                        ?>
								<tr class="trigger-method-<?php 
                        echo $name;
						<?php 
    }
    ?>
					</ul>
				</div>							
			</div>
		</div>
		<?php 
    if ($show) {
        echo ob_get_clean();
    } else {
        ob_end_clean();
    }
    $shop = ThemexUser::getShop($post->post_author);
    if (!empty($shop)) {
        ThemexShop::refresh($shop);
        get_template_part('module', 'shop');
    }
    ThemexSidebar::renderSidebar('product');
    ?>
	</aside>
	<div class="item-full column eightcol last">
		<?php 
    do_action('woocommerce_single_product_summary');
    ?>
	</div>
	<div class="clear"></div>
	<?php 
    do_action('woocommerce_after_single_product_summary');
    ?>
	<meta itemprop="url" content="<?php 
Пример #3
0
">
							<span class="fa fa-upload"></span>
						</label>
						<input type="file" id="product_thumb" name="product_image" class="element-upload shifted" />
						<input type="hidden" name="product_id" value="<?php 
            echo ThemexWoo::$data['product']['ID'];
            ?>
" />
						<input type="hidden" name="woo_action" value="update_image" />
					</form>
				</div>
				<?php 
        }
    } else {
        if (ThemexUser::isShop()) {
            ThemexShop::refresh(ThemexUser::$data['current']['shop'], true);
            ?>
			<div class="image-wrap">
				<?php 
            echo ThemexCore::getImage(themex_value('ID', ThemexShop::$data), 200, THEME_URI . 'images/shop.png');
            ?>
			</div>
			<div class="profile-upload">
				<form action="" enctype="multipart/form-data" method="POST">
					<label for="shop_thumb" class="element-button square" title="<?php 
            _e('Upload Image', 'makery');
            ?>
">
						<span class="fa fa-upload"></span>
					</label>
					<input type="file" id="shop_thumb" name="shop_image" class="element-upload shifted" />
Пример #4
0
<?php

ThemexShop::refresh($post->ID);
$owner = ThemexUser::getUser(ThemexShop::$data['author']);
?>
<div class="shop-preview">
	<div class="shop-images clearfix">
		<?php 
for ($index = 0; $index < 4; $index++) {
    ?>
		<div class="item-image">
			<div class="image-wrap">
				<?php 
    if (isset(ThemexShop::$data['products'][$index])) {
        ?>
				<a href="<?php 
        echo get_permalink(ThemexShop::$data['products'][$index]);
        ?>
" title="<?php 
        echo get_the_title(ThemexShop::$data['products'][$index]);
        ?>
">
					<?php 
        echo ThemexCore::getImage(ThemexShop::$data['products'][$index], 200, THEME_URI . 'images/product.png');
        ?>
				</a>
				<?php 
    } else {
        ?>
				<a href="<?php 
        the_permalink();
Пример #5
0
 /**
  * Updates shipping rates
  *
  * @access public
  * @param array $rates
  * @param array $package
  * @return array
  */
 public static function updateShipping($rates, $package)
 {
     $products = $package['contents'];
     $product = reset($products);
     $total = $package['contents_cost'];
     $shipping = ThemexShop::getShipping(ThemexUser::getShop($product['data']->post->post_author));
     $country = '';
     if (isset($package['destination']) && isset($package['destination']['country'])) {
         $country = $package['destination']['country'];
     }
     if (!empty($rates)) {
         foreach ($rates as $key => $rate) {
             if (isset($shipping[$key])) {
                 $method = $shipping[$key];
                 $enabled = themex_value('enabled', $method);
                 $available = themex_value('availability', $method);
                 $amount = themex_value('min_amount', $method);
                 $countries = themex_array('countries', $method);
                 if ($enabled == 'no' || !empty($amount) && $total < $amount || $available == 'specific' && !in_array($country, $countries)) {
                     unset($rates[$key]);
                 } else {
                     if ($key == 'flat_rate') {
                         $default = intval(themex_value('default_cost', $method));
                         $costs = themex_array('costs', $method);
                         $cost = 0;
                         foreach ($products as $product) {
                             $classes = get_the_terms($product['product_id'], 'product_shipping_class');
                             if (is_array($classes) && !empty($classes)) {
                                 $class = reset($classes);
                                 $class = $class->slug;
                                 if (isset($costs[$class])) {
                                     $cost = $cost + intval($costs[$class]) * $product['quantity'];
                                 } else {
                                     $cost = $cost + $default * $product['quantity'];
                                 }
                             } else {
                                 $cost = $cost + $default * $product['quantity'];
                             }
                         }
                         $rates[$key]->cost = $cost;
                     }
                 }
             }
         }
     }
     return $rates;
 }
Пример #6
0
 /**
  * Refreshes module data
  *
  * @access public	 
  * @return void
  */
 public static function refresh($ID = 0, $extended = false)
 {
     self::$data = self::getShop($ID, $extended);
 }
</th>
				<th><?php 
        _e('Method', 'makery');
        ?>
</th>
				<th><?php 
        _e('Amount', 'makery');
        ?>
</th>
				<th>&nbsp;</th>
			</tr>
		</thead>
		<tbody>
			<?php 
        foreach ($withdrawals as $ID) {
            $withdrawal = ThemexShop::getWithdrawal($ID);
            ?>
			<tr>
				<td><?php 
            echo date_i18n(get_option('date_format'), strtotime($withdrawal['date']));
            ?>
</td>
				<td>
					<?php 
            _e('via', 'makery');
            ?>
					<?php 
            echo $withdrawal['method']['label'];
            ?>
					<?php 
            _e('to', 'makery');
Пример #8
0
<aside class="column fourcol last">	
	<?php 
ThemexShop::refresh(ThemexUser::$data['active']['shop'], true);
if (!ThemexCore::checkOption('shop_multiple') && ThemexShop::$data['status'] == 'publish') {
    get_template_part('module', 'shop');
}
if (!empty(ThemexShop::$data['reviews'])) {
    get_template_part('module', 'reviews');
}
if (!ThemexCore::checkOption('product_favorites')) {
    get_template_part('module', 'favorites');
}
if (ThemexUser::isProfile() && !ThemexCore::checkOption('shop_favorites')) {
    get_template_part('module', 'updates');
}
if (!ThemexCore::checkOption('shop_multiple') && ThemexShop::$data['status'] != 'publish') {
    get_template_part('module', 'shop');
}
ThemexSidebar::renderSidebar('profile');
?>
</aside>
</h1>
	</div>
	<?php 
ThemexInterface::renderTemplateContent('shop-shipping');
?>
	<?php 
if (!ThemexWoo::isActive() || ThemexCore::checkOption('shop_shipping')) {
    ?>
	<span class="secondary"><?php 
    _e('This shop does not exist.', 'makery');
    ?>
</span>
	<?php 
} else {
    $methods = ThemexWoo::getShippingMethods();
    $shipping = ThemexShop::getShipping(ThemexShop::$data['ID']);
    if (!empty($methods)) {
        ?>
	<form action="" method="POST" class="site-form">
		<div class="message">
			<?php 
        ThemexInterface::renderMessages(themex_value('success', $_POST, false));
        ?>
		</div>
		<?php 
        if (isset($methods['free_shipping']) && $methods['free_shipping']->enabled == 'yes') {
            ?>
		<h3><?php 
            echo $methods['free_shipping']->title;
            ?>
</h3>