コード例 #1
0
 /**
  * Récupère le pilotage de prix, le nombre de produit avec un prix incohérent, le type de l'entité et la langue de la boutique. 
  * Parcours la tableau de donnée avec la nouvelle valeur des prix par produit incohérent puis met à jour tout les autres prix de 
  * ce produit. Ensuite renvoie le template avec le nombre de prix incohérent qui on été corrigé et le template de la méthode :
  * ajax_checking_products_values si des produits incohérents sont toujours présent. / Get the price piloting, the number of 
  * product with an inconsistent price, type of the entity and the language of the shop. Browse the given table with the new
  * new value pricing of the inconsistent product and updates any other price of this product. Then display the template 
  * of the number of corrected product and the template of the method : ajax_checking_products_values if inconsistent product
  * already present.
  * 
  * @param array $_POST['product_price'] List of the new price for the product like array( $id_product => $new_price )
  * @return JSON Response
  */
 public function ajax_save_product_price()
 {
     header('Content-Type: application/json');
     $response = array();
     $price_piloting_option = get_option('wpshop_shop_price_piloting');
     $inconsistent_product_number = !empty($_POST['product_price']) ? count($_POST['product_price']) : 0;
     $consistent_product_number = 0;
     $entity_type_id = wpshop_entities::get_entity_identifier_from_code(WPSHOP_NEWTYPE_IDENTIFIER_PRODUCT);
     $language = WPSHOP_CURRENT_LOCALE;
     if (!empty($_REQUEST['icl_post_language'])) {
         $query = $wpdb->prepare("SELECT locale FROM " . $wpdb->prefix . "icl_locale_map WHERE code = %s", $_REQUEST['icl_post_language']);
         $language = $wpdb->get_var($query);
     }
     if (!empty($_POST['product_price'])) {
         foreach ($_POST['product_price'] as $product_id => $price) {
             try {
                 if ($price_piloting_option == 'TTC') {
                     wpshop_attributes::saveAttributeForEntity(array('decimal' => array('product_price' => $price)), $entity_type_id, $product_id, $language, 'wpshop_products');
                 } else {
                     wpshop_attributes::saveAttributeForEntity(array('decimal' => array('price_ht' => $price)), $entity_type_id, $product_id, $language, 'wpshop_product');
                 }
                 wpshop_products::calculate_price($product_id);
                 $consistent_product_number++;
             } catch (Exception $e) {
             }
         }
     }
     $response['template_number'] = __(sprintf('Number of processed product : %d/%d', $consistent_product_number, $inconsistent_product_number), 'wps-product');
     $list_product = wps_product_ctr::get_inconsistent_product();
     ob_start();
     require wpshop_tools::get_template_part(WPS_PRODUCT_DIR, WPS_PRODUCT_TEMPLATES_MAIN_DIR, "backend", "product_check_data");
     $response['template'] = ob_get_clean();
     wp_die(json_encode($response));
 }
コード例 #2
0
 function display_account_last_actions()
 {
     global $wpdb;
     $output = '';
     $user_id = get_current_user_id();
     if (!empty($user_id)) {
         $query = $wpdb->prepare('SELECT * FROM ' . $wpdb->posts . ' WHERE post_type = %s AND post_author = %d', WPSHOP_NEWTYPE_IDENTIFIER_ORDER, $user_id);
         $orders = $wpdb->get_results($query);
         if (!empty($orders)) {
             $orders_list = '';
             foreach ($orders as $order) {
                 $order_meta = get_post_meta($order->ID, '_order_postmeta', true);
                 $order_number = !empty($order_meta) && !empty($order_meta['order_key']) ? $order_meta['order_key'] : '';
                 $order_date = !empty($order_meta) && !empty($order_meta['order_date']) ? mysql2date(get_option('date_format'), $order_meta['order_date'], true) : '';
                 $order_amount = !empty($order_meta) && !empty($order_meta['order_key']) ? wpshop_tools::formate_number($order_meta['order_grand_total']) . ' ' . wpshop_tools::wpshop_get_currency(false) : '';
                 $order_available_status = unserialize(WPSHOP_ORDER_STATUS);
                 $order_status = !empty($order_meta) && !empty($order_meta['order_status']) ? __($order_available_status[$order_meta['order_status']], 'wpshop') : '';
                 ob_start();
                 require wpshop_tools::get_template_part(WPS_ACCOUNT_DIR, WPS_ACCOUNT_PATH . WPS_ACCOUNT_DIR . "/templates/", "frontend", "account/account-dashboard-resume-element");
                 $orders_list .= ob_get_contents();
                 ob_end_clean();
             }
             ob_start();
             require_once wpshop_tools::get_template_part(WPS_ACCOUNT_DIR, WPS_ACCOUNT_PATH . WPS_ACCOUNT_DIR . "/templates/", "frontend", "account/account-dashboard-resume");
             $output = ob_get_contents();
             ob_end_clean();
         }
     }
     return $output;
 }
コード例 #3
0
 public function help_tab_content($screen, $tab)
 {
     $id = $tab['id'];
     $title = $tab['callback'][0]->help_tabs[$tab['id']]['title'];
     $content = $tab['callback'][0]->help_tabs[$tab['id']]['content'];
     $pages = $tab['callback'][0]->help_tabs[$tab['id']]['pages'];
     require wpshop_tools::get_template_part(WPS_HELP_DIR, WPS_HELP_TEMPLATES_MAIN_DIR, "backend", "wps_tab_content_tpl");
 }
コード例 #4
0
 function display_modal()
 {
     $output = '';
     ob_start();
     require_once wpshop_tools::get_template_part(WPS_MODAL_DIR, $this->template_dir, "frontend", "modal");
     $output = ob_get_contents();
     ob_end_clean();
     echo $output;
 }
コード例 #5
0
 /**
  * AJAX - Charge le fomulaire d'ajout rapide d'un client / Load the form for new customer quick add
  */
 function customer_creation()
 {
     check_ajax_referer('wps-customer-quick-nonce', 'wps-nonce');
     global $wpdb;
     $customer_entity_type_id = wpshop_entities::get_entity_identifier_from_code(WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS);
     $query = $wpdb->prepare("SELECT ID FROM {$wpdb->posts} WHERE post_type = %s AND post_author = %d", WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS, get_current_user_id());
     $cid = $wpdb->get_var($query);
     $customer_attribute_set = !empty($_GET) && !empty($_GET['customer_set_id']) ? $_GET['customer_set_id'] : null;
     $customer_attributes = wpshop_attributes_set::getAttributeSetDetails($customer_attribute_set, "'valid'");
     require_once wpshop_tools::get_template_part(WPSCLTQUICK_DIR, WPSCLTQUICK_TEMPLATES_MAIN_DIR, "backend", "customer", "creation");
     wp_die();
 }
コード例 #6
0
 /**
  * DISPLAY / Affichage - Display all letter buttons for element choice / Affiche les lettres de l'alphabet pour lister les éléments existants
  *
  * @param string $type The type of element to display alphabet for / Le type d'élément pour lequel on va afficher l'alphabet
  *
  * @return string The alphabet letter button / Les bouttons affichant les lettres de l'alphabet
  */
 public static function alphabet_letters($type = 'customer', $available_letters = array(), $chosen_letter = '')
 {
     global $wpdb;
     $alphabet = unserialize(WPSPOS_ALPHABET_LETTERS);
     $alphabet_interface = '';
     foreach ($alphabet as $alpha) {
         ob_start();
         require wpshop_tools::get_template_part(WPSPOS_DIR, WPSPOS_TEMPLATES_MAIN_DIR, 'backend', 'alphabet', 'letters');
         $alphabet_interface .= ob_get_contents();
         ob_end_clean();
     }
     return $alphabet_interface;
 }
コード例 #7
0
 /**
  * Display Discount Chip
  * @param array $args
  * @return string
  */
 function display_discount_chip($args)
 {
     $output = '';
     if (!empty($args) && !empty($args['pid'])) {
         $wps_price = new wpshop_prices();
         $discount_data = wpshop_prices::check_discount_for_product($args['pid']);
         if (!empty($discount_data)) {
             ob_start();
             require wpshop_tools::get_template_part(WPS_PRODUCT_DIR, WPS_PRODUCT_TEMPLATES_MAIN_DIR, "frontend", "product_discount_chip");
             $output = ob_get_contents();
             ob_end_clean();
         }
     }
     return $output;
 }
コード例 #8
0
 /**
  * AJAX - Display pictures in backend panel
  */
 function wp_ajax_display_pictures_in_backend()
 {
     $status = true;
     $response = '';
     $media_indicator = !empty($_POST['media_id']) ? $_POST['media_id'] : null;
     if (!empty($media_indicator)) {
         $media_id = explode(',', $media_indicator);
         if (!empty($media_id)) {
             ob_start();
             require wpshop_tools::get_template_part(WPS_MEDIA_MANAGER_DIR, $this->template_dir, "backend", "media_list");
             $response = ob_get_contents();
             ob_end_clean();
         }
     }
     echo json_encode(array('status' => $status, 'response' => $response));
     wp_die();
 }
コード例 #9
0
 /**
  * Generate product sheet datas
  *
  * @param integer $product_id THe product identifier to generate the sheet for
  *
  * @return string
  */
 function generate_product_sheet_datas($product_id)
 {
     $product = get_post($product_id);
     $shop_type = get_option('wpshop_shop_type');
     $product_price_data = get_post_meta($product_id, '_wps_price_infos', true);
     // Attributes Def
     $product_atts_def = $this->get_product_atts_def($product_id);
     // Attach CSS datas
     ob_start();
     require wpshop_tools::get_template_part(WPS_PRODUCT_DIR, WPS_PRODUCT_TEMPLATES_MAIN_DIR, "backend", "product_sheet_datas_style");
     $output = ob_get_contents();
     ob_end_clean();
     ob_start();
     require wpshop_tools::get_template_part(WPS_PRODUCT_DIR, WPS_PRODUCT_TEMPLATES_MAIN_DIR, "backend", "product_sheet");
     $output .= ob_get_contents();
     ob_end_clean();
     return $output;
 }
コード例 #10
0
 /**
  * Display address in customer informations panel
  * @param integer $customer_id
  * @param integre $order_id
  * @param integer $address_type
  * @return string
  */
 function display_customer_address_in_order($customer_id, $order_id, $address_type)
 {
     $output = '';
     if (!empty($customer_id) && !empty($order_id) && !empty($address_type)) {
         $order_infos = get_post_meta($order_id, '_order_info', true);
         $order_metadata = get_post_meta($order_id, '_order_postmeta', true);
         $billing_address_option = get_option('wpshop_billing_address');
         $address_type_indicator = !empty($billing_address_option) && !empty($billing_address_option['choice']) && $billing_address_option['choice'] == $address_type ? 'billing' : 'shipping';
         // Freeze Address display
         $address_informations = !empty($order_infos) && is_array($order_infos) && !empty($order_infos[$address_type_indicator]) && !empty($order_infos[$address_type_indicator]['address']) ? $order_infos[$address_type_indicator]['address'] : '';
         $address_content = !empty($address_informations) && !empty($order_infos[$address_type_indicator]['id']) ? wps_address::display_an_address($address_informations, '', $order_infos[$address_type_indicator]['id']) : '';
         ob_start();
         require wpshop_tools::get_template_part(WPS_ADDRESS_DIR, WPS_LOCALISATION_TEMPLATES_MAIN_DIR, "backend", "freeze-address-admin-display");
         $output = ob_get_contents();
         ob_end_clean();
     }
     return $output;
 }
コード例 #11
0
ファイル: pos.php プロジェクト: pronoSoupe/pronobo_soupe
		<h2><?php 
_e('WP-Shop POS Software', 'wps-pos-i18n');
?>
 <a class="add-new-h2" href="<?php 
echo admin_url('admin.php?page=wps-pos&new_order=yes');
?>
"><?php 
_e('Create a new order', 'wps-pos-i18n');
?>
</a></h2>
	<!-- 	<div class="wpspos-main-actions-buttons-container" ><?php 
require_once wpshop_tools::get_template_part(WPSPOS_DIR, WPSPOS_TEMPLATES_MAIN_DIR, 'backend', 'pos', 'top_button');
?>
</div> -->
		<?php 
require_once wpshop_tools::get_template_part(WPSPOS_DIR, WPSPOS_TEMPLATES_MAIN_DIR, 'backend', 'tab_pos');
?>
	</div>

	<div id="wpspos-dashboard-widgetswrap" class="metabox-holder" ><?php 
/**	Create nonce for metabox order saving securisation	*/
wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false);
/**	Create nonce for metabox order saving securisation	*/
wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false);
/**	Call the different fonction to add meta boxes on dashboard	*/
do_meta_boxes('wpspos-dashboard', 'wpspos-dashboard-summary', null);
?>
		<div class="wpspos-dashboard-contents wpspos-current-step-<?php 
echo $current_step;
?>
" >
コード例 #12
0
 function wpshop_rss_tutorial_videos()
 {
     $ini_get_checking = ini_get('allow_url_fopen');
     if ($ini_get_checking != 0) {
         $content = @file_get_contents('http://www.wpshop.fr/rss_video.xml');
         $videos_rss = $content !== false ? new SimpleXmlElement($content) : null;
         if (!empty($videos_rss) && !empty($videos_rss->channel)) {
             $videos_items = array();
             foreach ($videos_rss->channel->item as $i => $item) {
                 $videos_items[] = $item;
             }
             $rand_element = array_rand($videos_items);
             ob_start();
             require_once wpshop_tools::get_template_part(WPS_DASHBOARD_DIR, WPSDASHBOARD_TPL_DIR, "backend", "dashboard", "videos");
             $output = ob_get_contents();
             ob_end_clean();
         } else {
             $output = __('No tutorial videos can be loaded', 'wpshop');
         }
     } else {
         $output = __('Your servor doesn\'t allow to open external files', 'wpshop');
     }
     echo $output;
 }
コード例 #13
0
 function display_payment_modes()
 {
     $output = '';
     $payment_modes = get_option('wps_payment_mode');
     if (!empty($payment_modes) && !empty($payment_modes['mode'])) {
         $default_choice = !empty($payment_modes['default_choice']) ? $payment_modes['default_choice'] : '';
         $payment_modes = $payment_modes['mode'];
         $tmp_array = array();
         foreach ($payment_modes as $payment_mode_id => $payment_mode) {
             if (!empty($payment_mode['active'])) {
                 $tmp_array[$payment_mode_id] = $payment_mode;
             }
         }
         $payment_modes = apply_filters('wps-paymentmode-filter', $tmp_array);
         ob_start();
         require_once wpshop_tools::get_template_part(WPS_PAYMENT_MODE_DIR, $this->template_dir, "frontend", "payment-modes");
         $output = ob_get_contents();
         ob_end_clean();
     }
     return $output;
 }
コード例 #14
0
 function display_highlightings($args)
 {
     $output = $highlightings = '';
     if (!empty($args) && !empty($args['hook_name'])) {
         $datas = $this->get_data_for_hook($args['hook_name']);
         //Display in Template
         if (!empty($datas)) {
             foreach ($datas as $data) {
                 ob_start();
                 require wpshop_tools::get_template_part(WPS_HIGHLIGHTING_DIR, $this->template_dir, "frontend", "highlighting");
                 $highlightings .= ob_get_contents();
                 ob_end_clean();
             }
         }
     }
     return $highlightings;
 }
コード例 #15
0
<div class="wps-address-list-container" >
	<?php 
require wpshop_tools::get_template_part(WPS_ADDRESS_DIR, WPS_LOCALISATION_TEMPLATES_MAIN_DIR, "backend", "addresses");
?>
</div>
<a href="#" class="alignright wps-address-icon-black wps-address-icon-add" id="wps-address-add-for-<?php 
echo $post->ID;
?>
" ></a>
<div class="clear" ></div>
コード例 #16
0
 /**
  * ACCOUNT - Edit account informations data
  */
 function account_informations_form()
 {
     global $wpdb;
     $output = '';
     if (get_current_user_id() != 0) {
         // Customer ID data
         $customer_entity_type_id = wpshop_entities::get_entity_identifier_from_code(WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS);
         $query = $wpdb->prepare('SELECT ID FROM ' . $wpdb->posts . ' WHERE post_type = %s AND post_author = %d', WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS, get_current_user_id());
         $cid = $wpdb->get_var($query);
         $fields_to_output = $signup_fields = array();
         $password_attribute = $signup_form_attributes = array();
         $entity_id = wpshop_entities::get_entity_identifier_from_code(WPSHOP_NEWTYPE_IDENTIFIER_CUSTOMERS);
         $query = $wpdb->prepare('SELECT id FROM ' . WPSHOP_DBT_ATTRIBUTE_SET . ' WHERE entity_id = %d', $entity_id);
         $customer_entity_id = $wpdb->get_var($query);
         $attributes_set = wpshop_attributes_set::getElement($customer_entity_id);
         $account_attributes = wpshop_attributes_set::getAttributeSetDetails(!empty($attributes_set->id) ? $attributes_set->id : '', "'valid'");
         $query = $wpdb->prepare('SELECT id FROM ' . WPSHOP_DBT_ATTRIBUTE_GROUP . ' WHERE attribute_set_id = %d', $attributes_set->id);
         $customer_attributes_sections = $wpdb->get_results($query);
         foreach ($customer_attributes_sections as $k => $customer_attributes_section) {
             if (!empty($account_attributes[$customer_attributes_section->id])) {
                 foreach ($account_attributes[$customer_attributes_section->id]['attribut'] as $attribute) {
                     $signup_fields[] = $attribute;
                 }
             }
         }
         ob_start();
         require wpshop_tools::get_template_part(WPS_ACCOUNT_DIR, $this->template_dir, "frontend", "account/account_form");
         $output = ob_get_contents();
         ob_end_clean();
     }
     return $output;
 }
コード例 #17
0
 /**
  * Display low stoclk alert message
  * @param string $args
  * @return string
  */
 function display_alert_stock_message($args)
 {
     $message = '';
     $post_ID = !empty($args) && !empty($args['id']) ? $args['id'] : '';
     $low_stock_alert_option = get_option('wpshop_low_stock_alert_options');
     if (!empty($low_stock_alert_option) && !empty($low_stock_alert_option['active']) && !empty($post_ID)) {
         $product = wpshop_products::get_product_data($post_ID);
         $product_stock = $product['product_stock'];
         $manage_product_stock = !empty($product['manage_stock']) && strtolower(__($product['manage_stock'], 'wpshop')) == strtolower(__('Yes', 'wpshop')) ? true : false;
         if ($product_stock > 0 && (empty($low_stock_alert_option['based_on_stock']) || ('no' == $low_stock_alert_option['based_on_stock'] || 'yes' == $low_stock_alert_option['based_on_stock'] && $low_stock_alert_option['alert_limit'] >= $product_stock))) {
             ob_start();
             require wpshop_tools::get_template_part(WPS_MARKETING_TOOLS_DIR, $this->template_dir, "frontend", "wps_low_stock_alert_message");
             $message .= ob_get_contents();
             ob_end_clean();
         }
     }
     return $message;
 }
コード例 #18
0
 /**
  * Display Orders moment in the day Statistics
  */
 function wps_statistics_orders_moment($args = array('choosen_day' => '', 'return' => false))
 {
     $begin_date = !empty($_POST['begin_date']) ? wpshop_tools::varSanitizer($_POST['begin_date']) : date('Y-m-d', strtotime('1 months ago'));
     $end_date = !empty($_POST['end_date']) ? wpshop_tools::varSanitizer($_POST['end_date']) : date('Y-m-d');
     $datadate = $this->wps_stats_mdl->wps_get_orders_by_hours($begin_date, $end_date, !empty($args['choosen_day']) ? $args['choosen_day'] : '');
     $days = array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');
     ob_start();
     require wpshop_tools::get_template_part(WPS_STATISTICS_DIR, WPS_STATISTICS_TEMPLATES_MAIN_DIR, "backend", "wps_statistics_orders_moment");
     $output = ob_get_contents();
     ob_end_clean();
     if (!empty($args) && !empty($args['return']) && $args['return']) {
         return $output;
     } else {
         echo $output;
     }
 }
コード例 #19
0
 /**
  * Display the content into list table column
  *
  * @param string $column THe column identifier to modify output for
  * @param integer $post_id The current post identifier
  */
 function list_table_column_content($column, $post_id)
 {
     global $wpdb;
     /**	Get wp_users idenfifier from customer id	*/
     $query = $wpdb->prepare("SELECT post_author FROM {$wpdb->posts} WHERE ID = %d", $post_id);
     $current_user_id_in_list = $wpdb->get_var($query);
     /**	Get current post informations	*/
     $customer_post = get_post($post_id);
     /**	Get user data	*/
     $current_user_datas = get_userdata($current_user_id_in_list);
     /**	Switch current column for custom case	*/
     $use_template = true;
     switch ($column) {
         case 'customer_identifier':
             echo $post_id;
             $use_template = false;
             break;
         case 'customer_date_subscription':
             echo mysql2date(get_option('date_format'), $current_user_datas->user_registered, true);
             $use_template = false;
             break;
         case 'customer_date_lastlogin':
             $last_login = get_user_meta($current_user_id_in_list, 'last_login_time', true);
             if (!empty($last_login)) {
                 echo mysql2date(get_option('date_format') . ' ' . get_option('time_format'), $last_login, true);
             } else {
                 _e('Never logged in', 'wpshop');
             }
             $use_template = false;
             break;
     }
     /**	Require the template for displaying the current column	*/
     if ($use_template) {
         $template = wpshop_tools::get_template_part(WPS_ACCOUNT_DIR, WPS_ACCOUNT_PATH . WPS_ACCOUNT_DIR . '/templates/', 'backend', 'customer_listtable/' . $column);
         if (is_file($template)) {
             require $template;
         }
     }
 }
コード例 #20
0
 /**
  * Display address in Back-Office panel
  * @param array $address_data
  */
 function display_address_in_administration($addresses_datas, $address_type)
 {
     global $wpdb;
     $output = '';
     if (!empty($addresses_datas) && !empty($address_type)) {
         $query = $wpdb->prepare('SELECT name FROM ' . WPSHOP_DBT_ATTRIBUTE_SET . ' WHERE id = %d', $address_type);
         $title = __($wpdb->get_var($query), 'wpshop');
         ob_start();
         require wpshop_tools::get_template_part(WPS_ADDRESS_DIR, $this->template_dir, "backend", "admin-address", "content");
         $output .= ob_get_contents();
         ob_end_clean();
     }
     return $output;
 }
コード例 #21
0
 function display_option()
 {
     $wps_wishlist_display = self::get_option();
     require_once wpshop_tools::get_template_part(WPS_WISHLIST_DIR, WPS_WISHLIST_TEMPLATE_DIR, 'backend/settings', "wishlist_option");
 }
コード例 #22
0
_e('Search products by letter', 'wpshop');
?>
</span>
<?php 
foreach ($letters as $letter) {
    ?>
<a href="#" class="wps-bton-second-mini-rounded <?php 
    echo strtoupper($current_letter) == strtoupper($letter) ? 'third' : '';
    ?>
 search_product_by_letter" id="<?php 
    echo $letter;
    ?>
"><?php 
    echo $letter != 'ALL' ? $letter : __('ALL', 'wpshop');
    ?>
</a>
<?php 
}
echo apply_filters('wps-filter-free-product-bton-tpl', $post->ID);
?>
</div>

<div id="wps_orders_product_listing_table">
<?php 
require wpshop_tools::get_template_part(WPS_ORDERS_DIR, $this->template_dir, "backend", "product-listing/wps_orders_product_listing_table");
?>
</div>



コード例 #23
0
 /**
  * WORDPRESS HOOK - FOOTER SCRIPTS - Create the help messages for wpshop. only create them into required pages by loking at current screen
  */
 function wps_dashboard_help()
 {
     /**	Initialise help messages	*/
     $help_cases = null;
     /**	Get current screen in order to load messages only in required pages	*/
     $current_screen = get_current_screen();
     switch ($current_screen->id) {
         case 'toplevel_page_wpshop_dashboard':
             $help_cases['download_newsletter_contacts'] = array('edge' => 'left', 'at' => 'left bottom', 'my' => 'left top', 'pointer_id' => '#download_newsletter_contacts');
             break;
         case 'wpshop_product':
             $help_cases['product_page_categories'] = array('edge' => 'right', 'at' => '', 'my' => '', 'pointer_id' => '#wpshop_product_categorydiv');
             $help_cases['product_datas_configuration'] = array('edge' => 'bottom', 'at' => 'center top', 'my' => 'bottom right', 'pointer_id' => '#wpshop_product_fixed_tab');
             $help_cases['product_display_configuration'] = array('edge' => 'bottom', 'at' => 'right bottom', 'my' => 'bottom', 'pointer_id' => '.wpshop_product_data_display_tab');
             $help_cases['product_variations'] = array('edge' => 'bottom', 'at' => 'right bottom', 'my' => 'bottom', 'pointer_id' => '#wpshop_new_variation_list_button');
             $help_cases['product_variations_configuration'] = array('edge' => 'bottom', 'at' => 'right bottom', 'my' => 'bottom', 'pointer_id' => '#wpshop_variation_parameters_button');
             $help_cases['add_product_automaticly_to_cart'] = array('edge' => 'right', 'at' => '', 'my' => '', 'pointer_id' => '#wpshop_product_options');
             break;
         case 'edit-wpshop_product_category':
             $help_cases['category_filterable_attributes'] = array('edge' => 'bottom', 'at' => 'top', 'my' => 'bottom', 'pointer_id' => '.filterable_attributes_container');
             $help_cases['category_picture'] = array('edge' => 'bottom', 'at' => '', 'my' => 'bottom', 'pointer_id' => '.category_new_picture_upload');
             break;
         case 'wpshop_shop_order':
             $help_cases['order_customer_comment'] = array('edge' => 'right', 'at' => '', 'my' => '', 'pointer_id' => '#wpshop_order_customer_comment');
             $help_cases['order_notification_message'] = array('edge' => 'bottom', 'at' => '', 'my' => '', 'pointer_id' => '#wpshop_order_private_comments');
             $help_cases['order_shipping_box'] = array('edge' => 'right', 'at' => '', 'my' => '', 'pointer_id' => '#wpshop_order_shipping');
             break;
         case 'wpshop_shop_message':
             $help_cases['message_historic'] = array('edge' => 'bottom', 'at' => '', 'my' => '', 'pointer_id' => '#wpshop_message_histo');
             break;
         case 'settings_page_wpshop_option':
             $help_cases['options_payment_part'] = array('edge' => 'right', 'at' => '', 'my' => '', 'pointer_id' => '#wps_payment_mode_list_container');
             break;
     }
     if (!empty($help_cases)) {
         /** Get help data seen by user **/
         $closed_help_window = get_user_meta(get_current_user_id(), '_wps_closed_help', true);
         /**	Read the different help cases	*/
         foreach ($help_cases as $help_id => $help_case) {
             if (empty($closed_help_window) || !empty($closed_help_window) && !array_key_exists($help_id, $closed_help_window)) {
                 switch ($help_id) {
                     case 'download_newsletter_contacts':
                         $pointer_content = '<h3>' . __('Customers information download', 'wpshop') . '</h3>';
                         $pointer_content .= '<p>' . __('You can download emails of customers who accept to receive your commercials offers or your partners commercials offers by newsletter', 'wpshop') . '</p>';
                         break;
                     case 'product_page_categories':
                         $pointer_content = '<h3>' . __('WPShop Categories', 'wpshop') . '</h3>';
                         $pointer_content .= '<p>' . __('You can classify your products by category.', 'wpshop') . '<br/></p>';
                         $pointer_content .= '<p><a href="' . admin_url('edit-tags.php?taxonomy=wpshop_product_category&post_type=wpshop_product') . '" class="button-primary" target="_blank">' . __('Create my WPShop categories', 'wpshop') . '</a></p>';
                         break;
                     case 'product_datas_configuration':
                         $pointer_content = '<h3>' . __('Product configurations', 'wpshop') . '</h3>';
                         $pointer_content .= '<p>' . __('Here, you can configure your product (Price, weight, reference and all attributes you want to create and affect to products', 'wpshop') . '</p>';
                         break;
                     case 'product_display_configuration':
                         $pointer_content = '<h3>' . __('Product display configurations', 'wpshop') . '</h3>';
                         $pointer_content .= '<p>' . __('Here, you can manage what elements you want to display on your product page', 'wpshop') . '</p>';
                         break;
                     case 'product_variations':
                         $pointer_content = '<h3>' . __('Product variations', 'wpshop') . '</h3>';
                         $pointer_content .= '<p>' . __('Here, you can generate your product variations.', 'wpshop') . '</p><br/>';
                         $pointer_content .= '<p><a href="http://www.wpshop.fr/documentations/configurer-un-produit-avec-des-options/" class="button-primary" target="_blank">' . __('Read the tutorial', 'wpshop') . '</a></p>';
                         break;
                     case 'product_variations_configuration':
                         $pointer_content = '<h3>' . __('Variations configuration', 'wpshop') . '</h3>';
                         $pointer_content .= '<p>' . __('Here, you can manage your product variations configurations (Display "Price from", variation price priority...).', 'wpshop') . '</p>';
                         break;
                     case 'add_product_automaticly_to_cart':
                         $pointer_content = '<h3>' . __('Add product to cart', 'wpshop') . '</h3>';
                         $pointer_content .= '<p>' . __('If you check this checkbox, this produc will be add automaticly to cart. This functionnality is helpful if you want to bill fees for example.', 'wpshop') . '</p>';
                         break;
                     case 'category_filterable_attributes':
                         $pointer_content = '<h3>' . __('Filterable search', 'wpshop') . '</h3>';
                         $pointer_content .= '<p>' . __('You can add a filter search to your WPShop, here will be display all available attributes for a filter search in this category', 'wpshop') . '</p><br/>';
                         $pointer_content .= '<p><a href="http://www.wpshop.fr/documentations/la-recherche-par-filtre/" class="button-primary" target="_blank">' . __('Read the filter search tutorial', 'wpshop') . '</a></p>';
                         break;
                     case 'category_picture':
                         $pointer_content = '<h3>' . __('Category image', 'wpshop') . '</h3>';
                         $pointer_content .= '<p>' . __('You can add a picture to illustrate your category', 'wpshop') . '</p>';
                         break;
                     case 'order_customer_comment':
                         $pointer_content = '<h3>' . __('Order customer comment', 'wpshop') . '</h3>';
                         $pointer_content .= '<p>' . __('Here is displayed the customer comment wrote during the order', 'wpshop') . '</p>';
                         break;
                     case 'message_historic':
                         $pointer_content = '<h3>' . __('Message Historic', 'wpshop') . '</h3>';
                         $pointer_content .= '<p>' . __('This is this message historic. You can check here if an automatic e-mail was send to a customer', 'wpshop') . '</p>';
                         break;
                     case 'order_notification_message':
                         $pointer_content = '<h3>' . __('Order notification', 'wpshop') . '</h3>';
                         $pointer_content .= '<p>' . __('You can add a private comment to the order or send an comment to customer about this order', 'wpshop') . '</p>';
                         break;
                     case 'order_shipping_box':
                         $pointer_content = '<h3>' . __('Shipping actions', 'wpshop') . '</h3>';
                         $pointer_content .= '<p>' . __('Here, you can manage your shipping actions, download the shipping slip.', 'wpshop') . '</p>';
                         break;
                     case 'options_payment_part':
                         $pointer_content = '<h3>' . __('Payment configuration', 'wpshop') . '</h3><p>' . __('You can manage your payment methods (Change name, add description, add a logo and apply configurations ). You can add others payment methods', 'wpshop') . '</p><br/><p><a href="http://shop.eoxia.com/boutique/shop/modules-wpshop/modules-de-paiement/" class="button-primary" target="_blank">' . __('See available payment methods', 'wpshop') . '</a></p>';
                         break;
                     default:
                         $pointer_content = '';
                         break;
                 }
                 require wpshop_tools::get_template_part(WPS_HELP_DIR, WPS_HELP_TEMPLATES_MAIN_DIR, 'backend', 'help', 'container');
             }
         }
     }
 }
コード例 #24
0
 /**
  * AJAX - Fill the opinion modal
  */
 function wps_fill_opinion_modal()
 {
     $status = true;
     $title = '';
     $content = '';
     $title = __('Add your opinion', 'wps_opinion');
     ob_start();
     $pid = !empty($_POST['pid']) ? intval($_POST['pid']) : null;
     require wpshop_tools::get_template_part(WPS_OPINION_DIR, $this->template_dir, "frontend", "wps-modal-opinion");
     $content = ob_get_contents();
     ob_end_clean();
     echo json_encode(array('status' => $status, 'title' => $title, 'content' => $content));
     wp_die();
 }
コード例 #25
0
 /**
  * AJAX - Refresh product listing in order back-office
  */
 function refresh_product_list()
 {
     $status = false;
     $response = '';
     $letter = !empty($_POST['letter']) ? sanitize_title($_POST['letter']) : '';
     if (!empty($_POST['oid'])) {
         $post = get_post($_POST['oid']);
     }
     if (!empty($letter)) {
         $current_letter = $letter;
         $wps_product_mdl = new wps_product_mdl();
         $products = $wps_product_mdl->get_products_by_letter($letter);
         ob_start();
         require wpshop_tools::get_template_part(WPS_ORDERS_DIR, $this->template_dir, "backend", "product-listing/wps_orders_product_listing_table");
         $response = ob_get_contents();
         ob_end_clean();
         $status = true;
     }
     echo json_encode(array('status' => $status, 'response' => $response));
     wp_die();
 }
コード例 #26
0
 /** Display Apply Coupon Interface **/
 function display_apply_coupon_interface()
 {
     $output = '';
     if (!empty($_SESSION) && !empty($_SESSION['cart']) && !empty($_SESSION['cart']['order_items'])) {
         ob_start();
         require_once wpshop_tools::get_template_part(WPS_CART_DIR, WPS_CART_TPL_DIR, "frontend", "coupon/apply_coupon");
         $output = ob_get_contents();
         ob_end_clean();
     }
     return $output;
 }
コード例 #27
0
<div class="wps-gridwrapper6-marged">
<?php 
$step_finished = false;
foreach ($steps as $step_id => $step) {
    $step_id += 1;
    $step_class = $default_step == $step_id ? 'wps-checkout-step-current' : ($default_step > $step_id ? 'wps-checkout-step-finished' : 'wps-checkout-step');
    $step_finished = $default_step > $step_id ? true : false;
    require wpshop_tools::get_template_part(WPS_CLASSIC_CHECKOUT_DIR, $this->template_dir, "frontend", "checkout_step_indicator/checkout_step_indicator_step");
}
?>
</div>

コード例 #28
0
 /**
  * OPTIONS - Affiche les modules présents et leur état actuel / Display all modules and they current state
  */
 function module_listing()
 {
     /**	Define the directory containing all extra modules for current plugin	*/
     $module_folder = WPSHOP_MODULES_DIR;
     /**	Get	current modules options to know if they are activated or not */
     $module_option = get_option('wpshop_modules');
     /**	Check if the defined directory exists for reading and displaying an input to activate/deactivate the module	*/
     if (is_dir($module_folder)) {
         $parent_folder_content = scandir($module_folder);
         require_once wpshop_tools::get_template_part(EOMODMAN_DIR, EOMODMAN_TEMPLATES_MAIN_DIR, 'backend', 'settings');
     } else {
         _e('There is no modules to include into current plugin', 'eo-modmanager-i18n');
     }
 }
コード例 #29
0
_e('Welcome on wpshop', 'wpshop');
?>
</h1>
	<h2><?php 
_e('Before you start to use WPShop you will need to configure some parameters', 'wpshop');
?>
</h2>
	<div class="wpshop_admin_box">
		<div class="wps-gridwrapper3-marged">
		<?php 
$step_finished = false;
foreach ($steps as $step_id => $step) {
    $step_id += 1;
    $step_class = $current_step == $step_id ? 'wps-checkout-step-current' : ($current_step > $step_id ? 'wps-checkout-step-finished' : 'wps-checkout-step');
    $step_finished = $current_step > $step_id ? true : false;
    require wpshop_tools::get_template_part(WPS_INSTALLER_DIR, WPSINSTALLER_TPL_DIR, "backend", "step_indicator");
}
?>
		</div><!-- .wps-gridwrapper4-marged -->

		<div class="wps-installer-step-container wps-installer-step-container-<?php 
echo $current_step;
?>
" >
		<?php 
if ($current_step < count($steps)) {
    ?>
			<form action="<?php 
    echo admin_url('admin.php?page=wps-installer&amp;wps-installation-step=' . ($current_step + 1));
    ?>
" method="post" id="wps_installer_form" enctype="multipart/form-data" >
コード例 #30
0
 /**
  * Display orders in customer account
  * @param integer $customer_id
  * @return string
  */
 function display_orders_in_account($customer_id = '')
 {
     $output = '';
     $customer_id = !empty($customer_id) ? $customer_id : get_current_user_id();
     $from_admin = !empty($customer_id) ? true : false;
     $wps_orders_mdl = new wps_orders_mdl();
     $orders = $wps_orders_mdl->get_customer_orders($customer_id);
     // Display orders
     ob_start();
     require_once wpshop_tools::get_template_part(WPS_ORDERS_DIR, $this->template_dir, "frontend", "orders_list_in_account");
     $output = ob_get_contents();
     ob_end_clean();
     return $output;
 }