Fixed php docs standards

This commit is contained in:
Claudio Sanches 2015-11-03 11:31:20 -02:00
parent efa19f799d
commit ee30b5b308
299 changed files with 2047 additions and 2047 deletions

View File

@ -34,7 +34,7 @@ class WC_Admin_Meta_Boxes {
/**
* Save Order Meta Boxes.
*
* In order:.
* In order:
* Save the order items.
* Save the order totals.
* Save the order downloads.

View File

@ -26,7 +26,7 @@ class WC_Admin_Report {
/**
* Get report totals such as order totals and discount amounts.
*
* Data example:.
* Data example:
*
* '_order_total' => array(
* 'type' => 'meta',

View File

@ -1,6 +1,6 @@
<?php
/**
* WC_Report_Sales_By_Product
* WC_Report_Sales_By_Product.
*
* @author WooThemes
* @category Admin
@ -14,7 +14,7 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
public $product_ids_titles = array();
/**
* Constructor
* Constructor.
*/
public function __construct() {
if ( isset( $_GET['product_ids'] ) && is_array( $_GET['product_ids'] ) ) {
@ -25,7 +25,7 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
}
/**
* Get the legend for the main chart sidebar
* Get the legend for the main chart sidebar.
* @return array
*/
public function get_chart_legend() {
@ -97,7 +97,7 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
}
/**
* Output the report
* Output the report.
*/
public function output_report() {
@ -124,7 +124,7 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
}
/**
* [get_chart_widgets description]
* [get_chart_widgets description].
*
* @return array
*/
@ -148,7 +148,7 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
}
/**
* Show current filters
* Show current filters.
*/
public function current_filters() {
@ -170,7 +170,7 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
}
/**
* Product selection
* Product selection.
*/
public function products_widget() {
?>
@ -351,7 +351,7 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
}
/**
* Output an export link
* Output an export link.
*/
public function get_export_button() {
@ -371,7 +371,7 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
}
/**
* Get the main chart
* Get the main chart.
*
* @return string
*/

View File

@ -9,7 +9,7 @@ if ( ! class_exists( 'WP_List_Table' ) ) {
}
/**
* WC_Report_Stock
* WC_Report_Stock.
*
* @author WooThemes
* @category Admin
@ -33,14 +33,14 @@ class WC_Report_Stock extends WP_List_Table {
}
/**
* No items found text
* No items found text.
*/
public function no_items() {
_e( 'No products found.', 'woocommerce' );
}
/**
* Don't need this
* Don't need this.
*/
public function display_tablenav( $position ) {
@ -50,7 +50,7 @@ class WC_Report_Stock extends WP_List_Table {
}
/**
* Output the report
* Output the report.
*/
public function output_report() {
@ -174,7 +174,7 @@ class WC_Report_Stock extends WP_List_Table {
$this->get_items( $current_page, $per_page );
/**
* Pagination
* Pagination.
*/
$this->set_pagination_args( array(
'total_items' => $this->max_items,

View File

@ -1,6 +1,6 @@
<?php
/**
* WC_Report_Taxes_By_Code
* WC_Report_Taxes_By_Code.
*
* @author WooThemes
* @category Admin
@ -10,7 +10,7 @@
class WC_Report_Taxes_By_Code extends WC_Admin_Report {
/**
* Get the legend for the main chart sidebar
* Get the legend for the main chart sidebar.
* @return array
*/
public function get_chart_legend() {
@ -18,7 +18,7 @@ class WC_Report_Taxes_By_Code extends WC_Admin_Report {
}
/**
* Output an export link
* Output an export link.
*/
public function get_export_button() {
@ -36,7 +36,7 @@ class WC_Report_Taxes_By_Code extends WC_Admin_Report {
}
/**
* Output the report
* Output the report.
*/
public function output_report() {
@ -60,7 +60,7 @@ class WC_Report_Taxes_By_Code extends WC_Admin_Report {
}
/**
* Get the main chart
* Get the main chart.
*
* @return string
*/

View File

@ -1,6 +1,6 @@
<?php
/**
* WC_Report_Taxes_By_Date
* WC_Report_Taxes_By_Date.
*
* @author WooThemes
* @category Admin
@ -10,7 +10,7 @@
class WC_Report_Taxes_By_Date extends WC_Admin_Report {
/**
* Get the legend for the main chart sidebar
* Get the legend for the main chart sidebar.
* @return array
*/
public function get_chart_legend() {
@ -18,7 +18,7 @@ class WC_Report_Taxes_By_Date extends WC_Admin_Report {
}
/**
* Output an export link
* Output an export link.
*/
public function get_export_button() {
@ -36,7 +36,7 @@ class WC_Report_Taxes_By_Date extends WC_Admin_Report {
}
/**
* Output the report
* Output the report.
*/
public function output_report() {
@ -60,7 +60,7 @@ class WC_Report_Taxes_By_Date extends WC_Admin_Report {
}
/**
* Get the main chart
* Get the main chart.
*
* @return string
*/

View File

@ -1,6 +1,6 @@
<?php
/**
* WooCommerce Account Settings
* WooCommerce Account Settings.
*
* @author WooThemes
* @category Admin
@ -15,7 +15,7 @@ if ( ! defined( 'ABSPATH' ) ) {
if ( ! class_exists( 'WC_Settings_Accounts' ) ) :
/**
* WC_Settings_Accounts
* WC_Settings_Accounts.
*/
class WC_Settings_Accounts extends WC_Settings_Page {
@ -33,7 +33,7 @@ class WC_Settings_Accounts extends WC_Settings_Page {
}
/**
* Get settings array
* Get settings array.
*
* @return array
*/

View File

@ -1,6 +1,6 @@
<?php
/**
* WooCommerce API Settings
* WooCommerce API Settings.
*
* @author WooThemes
* @category Admin
@ -15,12 +15,12 @@ if ( ! defined( 'ABSPATH' ) ) {
if ( ! class_exists( 'WC_Settings_Rest_API' ) ) :
/**
* WC_Settings_Rest_API
* WC_Settings_Rest_API.
*/
class WC_Settings_Rest_API extends WC_Settings_Page {
/**
* Constructor
* Constructor.
*/
public function __construct() {
$this->id = 'api';
@ -36,7 +36,7 @@ class WC_Settings_Rest_API extends WC_Settings_Page {
}
/**
* Get sections
* Get sections.
*
* @return array
*/
@ -51,7 +51,7 @@ class WC_Settings_Rest_API extends WC_Settings_Page {
}
/**
* Get settings array
* Get settings array.
*
* @return array
*/
@ -82,7 +82,7 @@ class WC_Settings_Rest_API extends WC_Settings_Page {
}
/**
* Form method
* Form method.
*
* @param string $method
*
@ -128,7 +128,7 @@ class WC_Settings_Rest_API extends WC_Settings_Page {
}
/**
* Output the settings
* Output the settings.
*/
public function output() {
global $current_section;
@ -144,7 +144,7 @@ class WC_Settings_Rest_API extends WC_Settings_Page {
}
/**
* Save settings
* Save settings.
*/
public function save() {
global $current_section;

View File

@ -1,6 +1,6 @@
<?php
/**
* WooCommerce Shipping Settings
* WooCommerce Shipping Settings.
*
* @author WooThemes
* @category Admin
@ -15,7 +15,7 @@ if ( ! defined( 'ABSPATH' ) ) {
if ( ! class_exists( 'WC_Settings_Payment_Gateways' ) ) :
/**
* WC_Settings_Payment_Gateways
* WC_Settings_Payment_Gateways.
*/
class WC_Settings_Payment_Gateways extends WC_Settings_Page {
@ -35,7 +35,7 @@ class WC_Settings_Payment_Gateways extends WC_Settings_Page {
}
/**
* Get sections
* Get sections.
*
* @return array
*/
@ -58,7 +58,7 @@ class WC_Settings_Payment_Gateways extends WC_Settings_Page {
}
/**
* Get settings array
* Get settings array.
*
* @return array
*/
@ -201,7 +201,7 @@ class WC_Settings_Payment_Gateways extends WC_Settings_Page {
}
/**
* Output the settings
* Output the settings.
*/
public function output() {
global $current_section;
@ -306,7 +306,7 @@ class WC_Settings_Payment_Gateways extends WC_Settings_Page {
}
/**
* Save settings
* Save settings.
*/
public function save() {
global $current_section;

View File

@ -1,6 +1,6 @@
<?php
/**
* WooCommerce Email Settings
* WooCommerce Email Settings.
*
* @author WooThemes
* @category Admin
@ -15,7 +15,7 @@ if ( ! defined( 'ABSPATH' ) ) {
if ( ! class_exists( 'WC_Settings_Emails' ) ) :
/**
* WC_Settings_Emails
* WC_Settings_Emails.
*/
class WC_Settings_Emails extends WC_Settings_Page {
@ -33,7 +33,7 @@ class WC_Settings_Emails extends WC_Settings_Page {
}
/**
* Get sections
* Get sections.
*
* @return array
*/
@ -57,7 +57,7 @@ class WC_Settings_Emails extends WC_Settings_Page {
}
/**
* Get settings array
* Get settings array.
*
* @return array
*/
@ -163,7 +163,7 @@ class WC_Settings_Emails extends WC_Settings_Page {
}
/**
* Output the settings
* Output the settings.
*/
public function output() {
global $current_section;
@ -189,7 +189,7 @@ class WC_Settings_Emails extends WC_Settings_Page {
}
/**
* Save settings
* Save settings.
*/
public function save() {
global $current_section;

View File

@ -1,6 +1,6 @@
<?php
/**
* WooCommerce General Settings
* WooCommerce General Settings.
*
* @author WooThemes
* @category Admin
@ -15,7 +15,7 @@ if ( ! defined( 'ABSPATH' ) ) {
if ( ! class_exists( 'WC_Settings_General' ) ) :
/**
* WC_Admin_Settings_General
* WC_Admin_Settings_General.
*/
class WC_Settings_General extends WC_Settings_Page {
@ -33,7 +33,7 @@ class WC_Settings_General extends WC_Settings_Page {
}
/**
* Get settings array
* Get settings array.
*
* @return array
*/
@ -206,7 +206,7 @@ class WC_Settings_General extends WC_Settings_Page {
}
/**
* Save settings
* Save settings.
*/
public function save() {
$settings = $this->get_settings();

View File

@ -1,6 +1,6 @@
<?php
/**
* WooCommerce Integration Settings
* WooCommerce Integration Settings.
*
* @author WooThemes
* @category Admin
@ -15,7 +15,7 @@ if ( ! defined( 'ABSPATH' ) ) {
if ( ! class_exists( 'WC_Settings_Integrations' ) ) :
/**
* WC_Settings_Integrations
* WC_Settings_Integrations.
*/
class WC_Settings_Integrations extends WC_Settings_Page {
@ -36,7 +36,7 @@ class WC_Settings_Integrations extends WC_Settings_Page {
}
/**
* Get sections
* Get sections.
*
* @return array
*/
@ -64,7 +64,7 @@ class WC_Settings_Integrations extends WC_Settings_Page {
}
/**
* Output the settings
* Output the settings.
*/
public function output() {
global $current_section;

View File

@ -1,6 +1,6 @@
<?php
/**
* WooCommerce Settings Page/Tab
* WooCommerce Settings Page/Tab.
*
* @author WooThemes
* @category Admin
@ -15,7 +15,7 @@ if ( ! defined( 'ABSPATH' ) ) {
if ( ! class_exists( 'WC_Settings_Page' ) ) :
/**
* WC_Settings_Page
* WC_Settings_Page.
*/
abstract class WC_Settings_Page {
@ -23,7 +23,7 @@ abstract class WC_Settings_Page {
protected $label = '';
/**
* Constructor
* Constructor.
*/
public function __construct() {
add_filter( 'woocommerce_settings_tabs_array', array( $this, 'add_settings_page' ), 20 );
@ -33,7 +33,7 @@ abstract class WC_Settings_Page {
}
/**
* Add this page to settings
* Add this page to settings.
*/
public function add_settings_page( $pages ) {
$pages[ $this->id ] = $this->label;
@ -42,7 +42,7 @@ abstract class WC_Settings_Page {
}
/**
* Get settings array
* Get settings array.
*
* @return array
*/
@ -51,7 +51,7 @@ abstract class WC_Settings_Page {
}
/**
* Get sections
* Get sections.
*
* @return array
*/
@ -60,7 +60,7 @@ abstract class WC_Settings_Page {
}
/**
* Output sections
* Output sections.
*/
public function output_sections() {
global $current_section;
@ -83,7 +83,7 @@ abstract class WC_Settings_Page {
}
/**
* Output the settings
* Output the settings.
*/
public function output() {
$settings = $this->get_settings();
@ -92,7 +92,7 @@ abstract class WC_Settings_Page {
}
/**
* Save settings
* Save settings.
*/
public function save() {
global $current_section;

View File

@ -1,6 +1,6 @@
<?php
/**
* WooCommerce Product Settings
* WooCommerce Product Settings.
*
* @author WooThemes
* @category Admin
@ -15,7 +15,7 @@ if ( ! defined( 'ABSPATH' ) ) {
if ( ! class_exists( 'WC_Settings_Products' ) ) :
/**
* WC_Settings_Products
* WC_Settings_Products.
*/
class WC_Settings_Products extends WC_Settings_Page {
@ -34,7 +34,7 @@ class WC_Settings_Products extends WC_Settings_Page {
}
/**
* Get sections
* Get sections.
*
* @return array
*/
@ -51,7 +51,7 @@ class WC_Settings_Products extends WC_Settings_Page {
}
/**
* Output the settings
* Output the settings.
*/
public function output() {
global $current_section;
@ -62,7 +62,7 @@ class WC_Settings_Products extends WC_Settings_Page {
}
/**
* Save settings
* Save settings.
*/
public function save() {
global $current_section;
@ -72,7 +72,7 @@ class WC_Settings_Products extends WC_Settings_Page {
}
/**
* Get settings array
* Get settings array.
*
* @return array
*/

View File

@ -1,6 +1,6 @@
<?php
/**
* WooCommerce Shipping Settings
* WooCommerce Shipping Settings.
*
* @author WooThemes
* @category Admin
@ -15,7 +15,7 @@ if ( ! defined( 'ABSPATH' ) ) {
if ( ! class_exists( 'WC_Settings_Shipping' ) ) :
/**
* WC_Settings_Shipping
* WC_Settings_Shipping.
*/
class WC_Settings_Shipping extends WC_Settings_Page {
@ -34,7 +34,7 @@ class WC_Settings_Shipping extends WC_Settings_Page {
}
/**
* Get sections
* Get sections.
*
* @return array
*/
@ -60,7 +60,7 @@ class WC_Settings_Shipping extends WC_Settings_Page {
}
/**
* Get settings array
* Get settings array.
*
* @return array
*/
@ -163,7 +163,7 @@ class WC_Settings_Shipping extends WC_Settings_Page {
}
/**
* Output the settings
* Output the settings.
*/
public function output() {
global $current_section;
@ -246,7 +246,7 @@ class WC_Settings_Shipping extends WC_Settings_Page {
}
/**
* Save settings
* Save settings.
*/
public function save() {
global $current_section;

View File

@ -1,6 +1,6 @@
<?php
/**
* WooCommerce Tax Settings
* WooCommerce Tax Settings.
*
* @author WooThemes
* @category Admin
@ -15,7 +15,7 @@ if ( ! defined( 'ABSPATH' ) ) {
if ( ! class_exists( 'WC_Settings_Tax' ) ) :
/**
* WC_Settings_Tax
* WC_Settings_Tax.
*/
class WC_Settings_Tax extends WC_Settings_Page {
@ -30,7 +30,7 @@ class WC_Settings_Tax extends WC_Settings_Page {
}
/**
* Get sections
* Get sections.
*
* @return array
*/
@ -51,7 +51,7 @@ class WC_Settings_Tax extends WC_Settings_Page {
}
/**
* Get settings array
* Get settings array.
*
* @return array
*/
@ -67,7 +67,7 @@ class WC_Settings_Tax extends WC_Settings_Page {
}
/**
* Output the settings
* Output the settings.
*/
public function output() {
global $current_section;
@ -84,7 +84,7 @@ class WC_Settings_Tax extends WC_Settings_Page {
}
/**
* Save settings
* Save settings.
*/
public function save() {
global $current_section, $wpdb;
@ -101,7 +101,7 @@ class WC_Settings_Tax extends WC_Settings_Page {
}
/**
* Output tax rate tables
* Output tax rate tables.
*/
public function output_tax_rates() {
global $wpdb,
@ -178,7 +178,7 @@ class WC_Settings_Tax extends WC_Settings_Page {
}
/**
* Get tax class being edited
* Get tax class being edited.
* @return string
*/
private static function get_current_tax_class() {
@ -197,7 +197,7 @@ class WC_Settings_Tax extends WC_Settings_Page {
}
/**
* Get a posted tax rate
* Get a posted tax rate.
* @param string $key Key of tax rate in the post data array
* @param int $order Position/order of rate
* @param string $class Tax class for rate
@ -228,7 +228,7 @@ class WC_Settings_Tax extends WC_Settings_Page {
}
/**
* Save tax rates
* Save tax rates.
*/
public function save_tax_rates() {
global $wpdb;

View File

@ -1,6 +1,6 @@
<?php
/**
* Admin View: Page - Addons
* Admin View: Page - Addons.
*
* @var string $view
* @var object $addons

View File

@ -1,6 +1,6 @@
<?php
/**
* Admin View: Page - Reports
* Admin View: Page - Reports.
*/
if ( ! defined( 'ABSPATH' ) ) {
@ -62,4 +62,4 @@ if ( ! defined( 'ABSPATH' ) ) {
call_user_func( $report['callback'], $current_report );
}
?>
</div>
</div>

View File

@ -1,6 +1,6 @@
<?php
/**
* Admin View: Page - Status Logs
* Admin View: Page - Status Logs.
*/
if ( ! defined( 'ABSPATH' ) ) {

View File

@ -1,6 +1,6 @@
<?php
/**
* Admin View: Page - Status Report
* Admin View: Page - Status Report.
*/
if ( ! defined( 'ABSPATH' ) ) {

View File

@ -1,6 +1,6 @@
<?php
/**
* Admin View: Page - Status Tools
* Admin View: Page - Status Tools.
*/
if ( ! defined( 'ABSPATH' ) ) {

View File

@ -1,6 +1,6 @@
<?php
/**
* Admin View: Page - Status
* Admin View: Page - Status.
*/
if ( ! defined( 'ABSPATH' ) ) {
@ -37,4 +37,4 @@ $current_tab = ! empty( $_REQUEST['tab'] ) ? sanitize_title( $_REQUEST['tab'] )
break;
}
?>
</div>
</div>

View File

@ -1,6 +1,6 @@
<?php
/**
* Admin View: Settings
* Admin View: Settings.
*/
if ( ! defined( 'ABSPATH' ) ) {

View File

@ -1,6 +1,6 @@
<?php
/**
* Admin View: Bulk Edit Products
* Admin View: Bulk Edit Products.
*/
if ( ! defined( 'ABSPATH' ) ) {

View File

@ -1,6 +1,6 @@
<?php
/**
* Admin View: Email Template Preview
* Admin View: Email Template Preview.
*/
if ( ! defined( 'ABSPATH' ) ) {
@ -15,4 +15,4 @@ if ( ! defined( 'ABSPATH' ) ) {
<h2>Lorem ipsum dolor</h2>
<p>Fusce eu euismod leo, a accumsan tellus. Quisque vitae dolor eu justo cursus egestas. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed sit amet sapien odio. Sed pellentesque arcu mi, quis malesuada lectus lacinia et. Cras a tempor leo.</p>
<p>Fusce eu euismod leo, a accumsan tellus. Quisque vitae dolor eu justo cursus egestas. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed sit amet sapien odio. Sed pellentesque arcu mi, quis malesuada lectus lacinia et. Cras a tempor leo.</p>

View File

@ -1,6 +1,6 @@
<?php
/**
* Admin View: Notice - Install
* Admin View: Notice - Install.
*/
if ( ! defined( 'ABSPATH' ) ) {

View File

@ -1,6 +1,6 @@
<?php
/**
* Admin View: Notice - Template Check
* Admin View: Notice - Template Check.
*/
if ( ! defined( 'ABSPATH' ) ) {

View File

@ -1,6 +1,6 @@
<?php
/**
* Admin View: Notice - Theme Support
* Admin View: Notice - Theme Support.
*/
if ( ! defined( 'ABSPATH' ) ) {

View File

@ -1,6 +1,6 @@
<?php
/**
* Admin View: Notice - Tracking
* Admin View: Notice - Tracking.
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;

View File

@ -1,6 +1,6 @@
<?php
/**
* Admin View: Notice - Update
* Admin View: Notice - Update.
*/
if ( ! defined( 'ABSPATH' ) ) {

View File

@ -1,6 +1,6 @@
<?php
/**
* Admin View: Quick Edit Product
* Admin View: Quick Edit Product.
*/
if ( ! defined( 'ABSPATH' ) ) {

View File

@ -1,6 +1,6 @@
<?php
/**
* Admin View: Report by Date (with date filters)
* Admin View: Report by Date (with date filters).
*/
if ( ! defined( 'ABSPATH' ) ) {

View File

@ -1,6 +1,6 @@
<?php
/**
* WooCommerce Admin Functions
* WooCommerce Admin Functions.
*
* @author WooThemes
* @category Core
@ -13,7 +13,7 @@ if ( ! defined( 'ABSPATH' ) ) {
}
/**
* Get all WooCommerce screen ids
* Get all WooCommerce screen ids.
*
* @return array
*/
@ -171,7 +171,7 @@ function woocommerce_settings_get_option( $option_name, $default = '' ) {
}
/**
* Save order items
* Save order items.
*
* @since 2.2
* @param int $order_id Order ID
@ -378,7 +378,7 @@ function wc_save_order_items( $order_id, $items ) {
}
/**
* Add help tips
* Add help tips.
* Display a WooCommerce help tip.
*
* @since 2.5.0

View File

@ -5,9 +5,9 @@ if ( ! defined( 'ABSPATH' ) ) {
}
/**
* WooCommerce WC_AJAX
* WooCommerce WC_AJAX.
*
* AJAX Event Handler
* AJAX Event Handler.
*
* @class WC_AJAX
* @version 2.4.0
@ -18,7 +18,7 @@ if ( ! defined( 'ABSPATH' ) ) {
class WC_AJAX {
/**
* Hook in ajax handlers
* Hook in ajax handlers.
*/
public static function init() {
add_action( 'init', array( __CLASS__, 'define_ajax'), 0 );
@ -27,7 +27,7 @@ class WC_AJAX {
}
/**
* Get WC Ajax Endpoint
* Get WC Ajax Endpoint.
* @param string $request Optional
* @return string
*/
@ -60,7 +60,7 @@ class WC_AJAX {
}
/**
* Check for WC Ajax request and fire action
* Check for WC Ajax request and fire action.
*/
public static function do_wc_ajax() {
global $wp_query;
@ -76,7 +76,7 @@ class WC_AJAX {
}
/**
* Hook in methods - uses WordPress ajax handlers (admin-ajax)
* Hook in methods - uses WordPress ajax handlers (admin-ajax).
*/
public static function add_ajax_events() {
// woocommerce_EVENT => nopriv
@ -147,7 +147,7 @@ class WC_AJAX {
}
/**
* Get a refreshed cart fragment
* Get a refreshed cart fragment.
*/
public static function get_refreshed_fragments() {
@ -172,7 +172,7 @@ class WC_AJAX {
}
/**
* AJAX apply coupon on checkout page
* AJAX apply coupon on checkout page.
*/
public static function apply_coupon() {
@ -190,7 +190,7 @@ class WC_AJAX {
}
/**
* AJAX remove coupon on cart and checkout page
* AJAX remove coupon on cart and checkout page.
*/
public static function remove_coupon() {
@ -214,7 +214,7 @@ class WC_AJAX {
}
/**
* AJAX update shipping method on cart page
* AJAX update shipping method on cart page.
*/
public static function update_shipping_method() {
@ -242,7 +242,7 @@ class WC_AJAX {
}
/**
* AJAX update order review on checkout
* AJAX update order review on checkout.
*/
public static function update_order_review() {
ob_start();
@ -390,7 +390,7 @@ class WC_AJAX {
}
/**
* AJAX add to cart
* AJAX add to cart.
*/
public static function add_to_cart() {
ob_start();
@ -427,7 +427,7 @@ class WC_AJAX {
}
/**
* Process ajax checkout form
* Process ajax checkout form.
*/
public static function checkout() {
if ( ! defined( 'WOOCOMMERCE_CHECKOUT' ) ) {
@ -440,7 +440,7 @@ class WC_AJAX {
}
/**
* Get a matching variation based on posted attributes
* Get a matching variation based on posted attributes.
*/
public static function get_variation() {
ob_start();
@ -463,7 +463,7 @@ class WC_AJAX {
}
/**
* Feature a product from admin
* Feature a product from admin.
*/
public static function feature_product() {
if ( current_user_can( 'edit_products' ) && check_admin_referer( 'woocommerce-feature-product' ) ) {
@ -481,7 +481,7 @@ class WC_AJAX {
}
/**
* Mark an order with a status
* Mark an order with a status.
*/
public static function mark_order_status() {
if ( current_user_can( 'edit_shop_orders' ) && check_admin_referer( 'woocommerce-mark-order-status' ) ) {
@ -500,7 +500,7 @@ class WC_AJAX {
}
/**
* Add an attribute row
* Add an attribute row.
*/
public static function add_attribute() {
ob_start();
@ -540,7 +540,7 @@ class WC_AJAX {
}
/**
* Add a new attribute via ajax function
* Add a new attribute via ajax function.
*/
public static function add_new_attribute() {
ob_start();
@ -576,7 +576,7 @@ class WC_AJAX {
}
/**
* Delete variations via ajax function
* Delete variations via ajax function.
*/
public static function remove_variations() {
check_ajax_referer( 'delete-variations', 'security' );
@ -599,7 +599,7 @@ class WC_AJAX {
}
/**
* Save attributes via ajax
* Save attributes via ajax.
*/
public static function save_attributes() {
@ -730,7 +730,7 @@ class WC_AJAX {
}
/**
* Add variation via ajax function
* Add variation via ajax function.
*/
public static function add_variation() {
@ -873,7 +873,7 @@ class WC_AJAX {
}
/**
* Link all variations via ajax function
* Link all variations via ajax function.
*/
public static function link_all_variations() {
@ -1047,7 +1047,7 @@ class WC_AJAX {
}
/**
* Delete download permissions via ajax function
* Delete download permissions via ajax function.
*/
public static function revoke_access_to_download() {
@ -1071,7 +1071,7 @@ class WC_AJAX {
}
/**
* Grant download permissions via ajax function
* Grant download permissions via ajax function.
*/
public static function grant_access_to_download() {
@ -1128,7 +1128,7 @@ class WC_AJAX {
}
/**
* Get customer details via ajax
* Get customer details via ajax.
*/
public static function get_customer_details() {
ob_start();
@ -1162,7 +1162,7 @@ class WC_AJAX {
}
/**
* Add order item via ajax
* Add order item via ajax.
*/
public static function add_order_item() {
check_ajax_referer( 'order-item', 'security' );
@ -1247,7 +1247,7 @@ class WC_AJAX {
}
/**
* Add order fee via ajax
* Add order fee via ajax.
*/
public static function add_order_fee() {
@ -1279,7 +1279,7 @@ class WC_AJAX {
}
/**
* Add order shipping cost via ajax
* Add order shipping cost via ajax.
*/
public static function add_order_shipping() {
@ -1310,7 +1310,7 @@ class WC_AJAX {
}
/**
* Add order tax column via ajax
* Add order tax column via ajax.
*/
public static function add_order_tax() {
global $wpdb;
@ -1336,7 +1336,7 @@ class WC_AJAX {
}
/**
* Remove an order item
* Remove an order item.
*/
public static function remove_order_item() {
check_ajax_referer( 'order-item', 'security' );
@ -1361,7 +1361,7 @@ class WC_AJAX {
}
/**
* Remove an order tax
* Remove an order tax.
*/
public static function remove_order_tax() {
@ -1385,7 +1385,7 @@ class WC_AJAX {
}
/**
* Reduce order item stock
* Reduce order item stock.
*/
public static function reduce_order_item_stock() {
check_ajax_referer( 'order-item', 'security' );
@ -1437,7 +1437,7 @@ class WC_AJAX {
}
/**
* Increase order item stock
* Increase order item stock.
*/
public static function increase_order_item_stock() {
check_ajax_referer( 'order-item', 'security' );
@ -1489,7 +1489,7 @@ class WC_AJAX {
}
/**
* Add some meta to a line item
* Add some meta to a line item.
*/
public static function add_order_item_meta() {
check_ajax_referer( 'order-item', 'security' );
@ -1508,7 +1508,7 @@ class WC_AJAX {
}
/**
* Remove meta from a line item
* Remove meta from a line item.
*/
public static function remove_order_item_meta() {
global $wpdb;
@ -1527,7 +1527,7 @@ class WC_AJAX {
}
/**
* Calc line tax
* Calc line tax.
*/
public static function calc_line_taxes() {
global $wpdb;
@ -1686,7 +1686,7 @@ class WC_AJAX {
}
/**
* Save order items via ajax
* Save order items via ajax.
*/
public static function save_order_items() {
check_ajax_referer( 'order-item', 'security' );
@ -1715,7 +1715,7 @@ class WC_AJAX {
}
/**
* Load order items via ajax
* Load order items via ajax.
*/
public static function load_order_items() {
check_ajax_referer( 'order-item', 'security' );
@ -1734,7 +1734,7 @@ class WC_AJAX {
}
/**
* Add order note via ajax
* Add order note via ajax.
*/
public static function add_order_note() {
@ -1769,7 +1769,7 @@ class WC_AJAX {
}
/**
* Delete order note via ajax
* Delete order note via ajax.
*/
public static function delete_order_note() {
@ -1790,7 +1790,7 @@ class WC_AJAX {
}
/**
* Search for products and echo json
* Search for products and echo json.
*
* @param string $x (default: '')
* @param string $post_types (default: array('product'))
@ -1865,7 +1865,7 @@ class WC_AJAX {
}
/**
* Search for product variations and return json
* Search for product variations and return json.
*
* @see WC_AJAX::json_search_products()
*/
@ -1874,7 +1874,7 @@ class WC_AJAX {
}
/**
* Search for gruoped products and return json
* Search for gruoped products and return json.
*/
public static function json_search_grouped_products() {
ob_start();
@ -1936,7 +1936,7 @@ class WC_AJAX {
}
/**
* Search for downloadable product variations and return json
* Search for downloadable product variations and return json.
*
* @see WC_AJAX::json_search_products()
*/
@ -1987,7 +1987,7 @@ class WC_AJAX {
}
/**
* Search for customers and return json
* Search for customers and return json.
*/
public static function json_search_customers() {
ob_start();
@ -2029,7 +2029,7 @@ class WC_AJAX {
}
/**
* When searching using the WP_User_Query, search names (user meta) too
* When searching using the WP_User_Query, search names (user meta) too.
* @param object $query
* @return object
*/
@ -2048,7 +2048,7 @@ class WC_AJAX {
}
/**
* Ajax request handling for categories ordering
* Ajax request handling for categories ordering.
*/
public static function term_ordering() {
@ -2077,9 +2077,9 @@ class WC_AJAX {
}
/**
* Ajax request handling for product ordering
* Ajax request handling for product ordering.
*
* Based on Simple Page Ordering by 10up (http://wordpress.org/extend/plugins/simple-page-ordering/)
* Based on Simple Page Ordering by 10up (http://wordpress.org/extend/plugins/simple-page-ordering/).
*/
public static function product_ordering() {
global $wpdb;
@ -2167,7 +2167,7 @@ class WC_AJAX {
}
/**
* Handle a refund via the edit order screen
* Handle a refund via the edit order screen.
*/
public static function refund_line_items() {
ob_start();
@ -2266,10 +2266,10 @@ class WC_AJAX {
// Trigger notifications and status changes
if ( $order->get_remaining_refund_amount() > 0 || ( $order->has_free_item() && $order->get_remaining_refund_items() > 0 ) ) {
/**
* woocommerce_order_partially_refunded
* woocommerce_order_partially_refunded.
*
* @since 2.4.0
* Note: 3rd arg was added in err. Kept for bw compat. 2.4.3
* Note: 3rd arg was added in err. Kept for bw compat. 2.4.3.
*/
do_action( 'woocommerce_order_partially_refunded', $order_id, $refund->id, $refund->id );
} else {
@ -2295,7 +2295,7 @@ class WC_AJAX {
}
/**
* Delete a refund
* Delete a refund.
*/
public static function delete_refund() {
check_ajax_referer( 'order-item', 'security' );
@ -2330,7 +2330,7 @@ class WC_AJAX {
}
/**
* Create/Update API key
* Create/Update API key.
*/
public static function update_api_key() {
ob_start();
@ -2422,7 +2422,7 @@ class WC_AJAX {
}
/**
* Locate user via AJAX
* Locate user via AJAX.
*/
public static function get_customer_location() {
$location_hash = WC_Cache_Helper::geolocation_ajax_get_location_hash();
@ -2430,7 +2430,7 @@ class WC_AJAX {
}
/**
* Load variations via AJAX
* Load variations via AJAX.
*/
public static function load_variations() {
ob_start();
@ -2589,7 +2589,7 @@ class WC_AJAX {
}
/**
* Save variations via AJAX
* Save variations via AJAX.
*/
public static function save_variations() {
ob_start();
@ -2638,7 +2638,7 @@ class WC_AJAX {
}
/**
* Bulk action - Toggle Enabled
* Bulk action - Toggle Enabled.
* @access private
* @param array $variations
* @param array $data
@ -2654,7 +2654,7 @@ class WC_AJAX {
}
/**
* Bulk action - Toggle Downloadable Checkbox
* Bulk action - Toggle Downloadable Checkbox.
* @access private
* @param array $variations
* @param array $data
@ -2668,7 +2668,7 @@ class WC_AJAX {
}
/**
* Bulk action - Toggle Virtual Checkbox
* Bulk action - Toggle Virtual Checkbox.
* @access private
* @param array $variations
* @param array $data
@ -2682,7 +2682,7 @@ class WC_AJAX {
}
/**
* Bulk action - Toggle Manage Stock Checkbox
* Bulk action - Toggle Manage Stock Checkbox.
* @access private
* @param array $variations
* @param array $data
@ -2696,7 +2696,7 @@ class WC_AJAX {
}
/**
* Bulk action - Set Regular Prices
* Bulk action - Set Regular Prices.
* @access private
* @param array $variations
* @param array $data
@ -2722,7 +2722,7 @@ class WC_AJAX {
}
/**
* Bulk action - Set Sale Prices
* Bulk action - Set Sale Prices.
* @access private
* @param array $variations
* @param array $data
@ -2748,7 +2748,7 @@ class WC_AJAX {
}
/**
* Bulk action - Set Stock
* Bulk action - Set Stock.
* @access private
* @param array $variations
* @param array $data
@ -2770,7 +2770,7 @@ class WC_AJAX {
}
/**
* Bulk action - Set Weight
* Bulk action - Set Weight.
* @access private
* @param array $variations
* @param array $data
@ -2780,7 +2780,7 @@ class WC_AJAX {
}
/**
* Bulk action - Set Length
* Bulk action - Set Length.
* @access private
* @param array $variations
* @param array $data
@ -2790,7 +2790,7 @@ class WC_AJAX {
}
/**
* Bulk action - Set Width
* Bulk action - Set Width.
* @access private
* @param array $variations
* @param array $data
@ -2800,7 +2800,7 @@ class WC_AJAX {
}
/**
* Bulk action - Set Height
* Bulk action - Set Height.
* @access private
* @param array $variations
* @param array $data
@ -2810,7 +2810,7 @@ class WC_AJAX {
}
/**
* Bulk action - Set Download Limit
* Bulk action - Set Download Limit.
* @access private
* @param array $variations
* @param array $data
@ -2820,7 +2820,7 @@ class WC_AJAX {
}
/**
* Bulk action - Set Download Expiry
* Bulk action - Set Download Expiry.
* @access private
* @param array $variations
* @param array $data
@ -2830,7 +2830,7 @@ class WC_AJAX {
}
/**
* Bulk action - Delete all
* Bulk action - Delete all.
* @access private
* @param array $variations
* @param array $data
@ -2844,7 +2844,7 @@ class WC_AJAX {
}
/**
* Bulk action - Sale Schedule
* Bulk action - Sale Schedule.
* @access private
* @param array $variations
* @param array $data
@ -2880,7 +2880,7 @@ class WC_AJAX {
}
/**
* Bulk action - Increase Regular Prices
* Bulk action - Increase Regular Prices.
* @access private
* @param array $variations
* @param array $data
@ -2890,7 +2890,7 @@ class WC_AJAX {
}
/**
* Bulk action - Decrease Regular Prices
* Bulk action - Decrease Regular Prices.
* @access private
* @param array $variations
* @param array $data
@ -2900,7 +2900,7 @@ class WC_AJAX {
}
/**
* Bulk action - Increase Sale Prices
* Bulk action - Increase Sale Prices.
* @access private
* @param array $variations
* @param array $data
@ -2910,7 +2910,7 @@ class WC_AJAX {
}
/**
* Bulk action - Decrease Sale Prices
* Bulk action - Decrease Sale Prices.
* @access private
* @param array $variations
* @param array $data
@ -2920,7 +2920,7 @@ class WC_AJAX {
}
/**
* Bulk action - Set Price
* Bulk action - Set Price.
* @access private
* @param array $variations
* @param string $operator + or -
@ -2948,7 +2948,7 @@ class WC_AJAX {
}
/**
* Bulk action - Set Meta
* Bulk action - Set Meta.
* @access private
* @param array $variations
* @param string $field
@ -2962,7 +2962,7 @@ class WC_AJAX {
/**
* Bulk edit variations via AJAX
* Bulk edit variations via AJAX.
*/
public static function bulk_edit_variations() {
ob_start();

View File

@ -1,8 +1,8 @@
<?php
/**
* WooCommerce API
* WooCommerce API.
*
* Handles WC-API endpoint requests
* Handles WC-API endpoint requests.
*
* @author WooThemes
* @category API
@ -19,7 +19,7 @@ if ( ! class_exists( 'WC_API' ) ) :
class WC_API {
/** This is the major version for the REST API and takes
* first-order position in endpoint URLs
* first-order position in endpoint URLs.
*/
const VERSION = '3.0.0';
@ -30,7 +30,7 @@ class WC_API {
public $authentication;
/**
* Setup class
* Setup class.
*
* @since 2.0
* @return WC_API
@ -83,7 +83,7 @@ class WC_API {
/**
* Handle REST API requests
* Handle REST API requests.
*
* @since 2.2
*/
@ -126,7 +126,7 @@ class WC_API {
}
/**
* Include required files for REST API request
* Include required files for REST API request.
*
* @since 2.1
*/
@ -156,7 +156,7 @@ class WC_API {
}
/**
* Register available API resources
* Register available API resources.
*
* @since 2.1
* @param WC_API_Server $server the REST server

View File

@ -1,8 +1,8 @@
<?php
/**
* WooCommerce Auth
* WooCommerce Auth.
*
* Handles wc-auth endpoint requests
* Handles wc-auth endpoint requests.
*
* @author WooThemes
* @category API
@ -19,12 +19,12 @@ if ( ! class_exists( 'WC_Auth' ) ) :
class WC_Auth {
/**
* Version
* Version.
*/
const VERSION = 1;
/**
* Setup class
* Setup class.
*
* @since 2.4.0
*/
@ -40,7 +40,7 @@ class WC_Auth {
}
/**
* Add query vars
* Add query vars.
*
* @since 2.4.0
*
@ -55,7 +55,7 @@ class WC_Auth {
}
/**
* Add auth endpoint
* Add auth endpoint.
*
* @since 2.4.0
*/
@ -83,7 +83,7 @@ class WC_Auth {
}
/**
* Return a list of permissions a scope allows
* Return a list of permissions a scope allows.
*
* @since 2.4.0
*
@ -119,7 +119,7 @@ class WC_Auth {
}
/**
* Build auth urls
* Build auth urls.
*
* @since 2.4.0
*
@ -141,7 +141,7 @@ class WC_Auth {
}
/**
* Make validation
* Make validation.
*
* @since 2.4.0
*/
@ -257,7 +257,7 @@ class WC_Auth {
}
/**
* Handle auth requests
* Handle auth requests.
*
* @since 2.4.0
*/
@ -279,7 +279,7 @@ class WC_Auth {
}
/**
* Auth endpoint
* Auth endpoint.
*
* @since 2.4.0
*
@ -355,7 +355,7 @@ class WC_Auth {
}
/**
* Maybe delete key
* Maybe delete key.
*
* @since 2.4.0
*

View File

@ -16,14 +16,14 @@ if ( ! defined( 'ABSPATH' ) ) {
class WC_Breadcrumb {
/**
* Breadcrumb trail
* Breadcrumb trail.
*
* @var array
*/
private $crumbs = array();
/**
* Add a crumb so we don't get lost
* Add a crumb so we don't get lost.
*
* @param string $name
* @param string $link
@ -36,14 +36,14 @@ class WC_Breadcrumb {
}
/**
* Reset crumbs
* Reset crumbs.
*/
public function reset() {
$this->crumbs = array();
}
/**
* Get the breadcrumb
* Get the breadcrumb.
*
* @return array
*/
@ -52,7 +52,7 @@ class WC_Breadcrumb {
}
/**
* Generate breadcrumb trail
* Generate breadcrumb trail.
*
* @return array of breadcrumbs
*/
@ -92,7 +92,7 @@ class WC_Breadcrumb {
}
/**
* Prepend the shop page to shop breadcrumbs
* Prepend the shop page to shop breadcrumbs.
*/
private function prepend_shop_page() {
$permalinks = get_option( 'woocommerce_permalinks' );
@ -106,21 +106,21 @@ class WC_Breadcrumb {
}
/**
* is home trail
* is home trail.
*/
private function add_crumbs_home() {
$this->add_crumb( single_post_title( '', false ) );
}
/**
* 404 trail
* 404 trail.
*/
private function add_crumbs_404() {
$this->add_crumb( __( 'Error 404', 'woocommerce' ) );
}
/**
* attachment trail
* attachment trail.
*/
private function add_crumbs_attachment() {
global $post;
@ -130,7 +130,7 @@ class WC_Breadcrumb {
}
/**
* Single post trail
* Single post trail.
*
* @param int $post_id
* @param string $permalink
@ -164,7 +164,7 @@ class WC_Breadcrumb {
}
/**
* Page trail
* Page trail.
*/
private function add_crumbs_page() {
global $post;
@ -191,7 +191,7 @@ class WC_Breadcrumb {
}
/**
* Product category trail
* Product category trail.
*/
private function add_crumbs_product_category() {
$current_term = $GLOBALS['wp_query']->get_queried_object();
@ -202,7 +202,7 @@ class WC_Breadcrumb {
}
/**
* Product tag trail
* Product tag trail.
*/
private function add_crumbs_product_tag() {
$current_term = $GLOBALS['wp_query']->get_queried_object();
@ -212,7 +212,7 @@ class WC_Breadcrumb {
}
/**
* Shop breadcrumb
* Shop breadcrumb.
*/
private function add_crumbs_shop() {
if ( get_option( 'page_on_front' ) == wc_get_page_id( 'shop' ) ) {
@ -230,7 +230,7 @@ class WC_Breadcrumb {
}
/**
* Post type archive trail
* Post type archive trail.
*/
private function add_crumbs_post_type_archive() {
$post_type = get_post_type_object( get_post_type() );
@ -241,7 +241,7 @@ class WC_Breadcrumb {
}
/**
* Category trail
* Category trail.
*/
private function add_crumbs_category() {
$this_category = get_category( $GLOBALS['wp_query']->get_queried_object() );
@ -255,7 +255,7 @@ class WC_Breadcrumb {
}
/**
* Tag trail
* Tag trail.
*/
private function add_crumbs_tag() {
$queried_object = $GLOBALS['wp_query']->get_queried_object();
@ -263,7 +263,7 @@ class WC_Breadcrumb {
}
/**
* Add crumbs for date based archives
* Add crumbs for date based archives.
*/
private function add_crumbs_date() {
if ( is_year() || is_month() || is_day() ) {
@ -278,7 +278,7 @@ class WC_Breadcrumb {
}
/**
* Add crumbs for date based archives
* Add crumbs for date based archives.
*/
private function add_crumbs_tax() {
$this_term = $GLOBALS['wp_query']->get_queried_object();
@ -295,7 +295,7 @@ class WC_Breadcrumb {
}
/**
* Add a breadcrumb for author archives
* Add a breadcrumb for author archives.
*/
private function add_crumbs_author() {
global $author;
@ -305,7 +305,7 @@ class WC_Breadcrumb {
}
/**
* Add crumbs for a term
* Add crumbs for a term.
* @param string $taxonomy
*/
private function term_ancestors( $term_id, $taxonomy ) {
@ -322,7 +322,7 @@ class WC_Breadcrumb {
}
/**
* Endpoints
* Endpoints.
*/
private function endpoint_trail() {
// Is an endpoint showing?
@ -332,7 +332,7 @@ class WC_Breadcrumb {
}
/**
* Add a breadcrumb for search results
* Add a breadcrumb for search results.
*/
private function search_trail() {
if ( is_search() ) {
@ -341,7 +341,7 @@ class WC_Breadcrumb {
}
/**
* Add a breadcrumb for pagination
* Add a breadcrumb for pagination.
*/
private function paged_trail() {
if ( get_query_var( 'paged' ) ) {

View File

@ -16,7 +16,7 @@ if ( ! defined( 'ABSPATH' ) ) {
class WC_Cache_Helper {
/**
* Hook in methods
* Hook in methods.
*/
public static function init() {
add_action( 'template_redirect', array( __CLASS__, 'geolocation_ajax_redirect' ) );
@ -26,7 +26,7 @@ class WC_Cache_Helper {
}
/**
* Get a hash of the customer location
* Get a hash of the customer location.
* @return string
*/
public static function geolocation_ajax_get_location_hash() {
@ -70,20 +70,20 @@ class WC_Cache_Helper {
}
/**
* Get transient version
* Get transient version.
*
* When using transients with unpredictable names, e.g. those containing an md5
* When using transients with unpredictable names, e.g. those containing an md5.
* hash in the name, we need a way to invalidate them all at once.
*
* When using default WP transients we're able to do this with a DB query to
* When using default WP transients we're able to do this with a DB query to.
* delete transients manually.
*
* With external cache however, this isn't possible. Instead, this function is used
* to append a unique string (based on time()) to each transient. When transients
* With external cache however, this isn't possible. Instead, this function is used.
* to append a unique string (based on time()) to each transient. When transients.
* are invalidated, the transient version will increment and data will be regenerated.
*
* Raised in issue https://github.com/woothemes/woocommerce/issues/5777
* Adapted from ideas in http://tollmanz.com/invalidation-schemes/
* Raised in issue https://github.com/woothemes/woocommerce/issues/5777.
* Adapted from ideas in http://tollmanz.com/invalidation-schemes/.
*
* @param string $group Name for the group of transients we need to invalidate
* @param boolean $refresh true to force a new version
@ -122,7 +122,7 @@ class WC_Cache_Helper {
}
/**
* Get the page name/id for a WC page
* Get the page name/id for a WC page.
* @param string $wc_page
* @return array
*/

View File

@ -1,6 +1,6 @@
<?php
/**
* WooCommerce cart
* WooCommerce cart.
*
* The WooCommerce cart class stores cart data and active coupons as well as handling customer sessions and some cart related urls.
* The cart class also has a price calculation function which calls upon other classes to calculate totals.
@ -166,7 +166,7 @@ class WC_Cart {
}
/**
* Will set cart cookies if needed, once, during WP hook
* Will set cart cookies if needed, once, during WP hook.
*/
public function maybe_set_cart_cookies() {
if ( ! headers_sent() && did_action( 'wp_loaded' ) ) {
@ -462,7 +462,7 @@ class WC_Cart {
$_product = $values['data'];
/**
* Check stock based on stock-status
* Check stock based on stock-status.
*/
if ( ! $_product->is_in_stock() ) {
$error->add( 'out-of-stock', sprintf(__( 'Sorry, "%s" is not in stock. Please edit your cart and try again. We apologise for any inconvenience caused.', 'woocommerce' ), $_product->get_title() ) );
@ -476,7 +476,7 @@ class WC_Cart {
$check_qty = $_product->is_type( 'variation' ) && true === $_product->managing_stock() ? $product_qty_in_cart[ $values['variation_id'] ] : $product_qty_in_cart[ $values['product_id'] ];
/**
* Check stock based on all items in the cart
* Check stock based on all items in the cart.
*/
if ( ! $_product->has_enough_stock( $check_qty ) ) {
$error->add( 'out-of-stock', sprintf(__( 'Sorry, we do not have enough "%s" in stock to fulfill your order (%s in stock). Please edit your cart and try again. We apologise for any inconvenience caused.', 'woocommerce' ), $_product->get_title(), $_product->get_stock_quantity() ) );
@ -484,7 +484,7 @@ class WC_Cart {
}
/**
* Finally consider any held stock, from pending orders
* Finally consider any held stock, from pending orders.
*/
if ( get_option( 'woocommerce_hold_stock_minutes' ) > 0 && ! $_product->backorders_allowed() ) {
$order_id = isset( WC()->session->order_awaiting_payment ) ? absint( WC()->session->order_awaiting_payment ) : 0;
@ -704,7 +704,7 @@ class WC_Cart {
}
/**
* Returns a specific item in the cart
* Returns a specific item in the cart.
*
* @return array item data
*/
@ -761,7 +761,7 @@ class WC_Cart {
}
/**
* Get all tax classes for items in the cart
* Get all tax classes for items in the cart.
* @return array
*/
public function get_cart_item_tax_classes() {
@ -913,7 +913,7 @@ class WC_Cart {
}
/**
* Check stock based on all items in the cart
* Check stock based on all items in the cart.
*/
if ( ! $product_data->has_enough_stock( $check_qty + $quantity ) ) {
throw new Exception( sprintf(
@ -959,7 +959,7 @@ class WC_Cart {
}
/**
* Remove a cart item
* Remove a cart item.
*
* @since 2.3.0
* @param string $cart_item_key
@ -985,7 +985,7 @@ class WC_Cart {
}
/**
* Restore a cart item
* Restore a cart item.
*
* @param string $cart_item_key
* @return bool
@ -1056,7 +1056,7 @@ class WC_Cart {
}
/**
* Sort by subtotal
* Sort by subtotal.
* @param array $a
* @param array $b
* @return int
@ -1106,7 +1106,7 @@ class WC_Cart {
$line_subtotal_tax = 0;
/**
* No tax to calculate
* No tax to calculate.
*/
if ( ! $_product->is_taxable() ) {
@ -1115,16 +1115,16 @@ class WC_Cart {
$this->subtotal_ex_tax += $line_price;
/**
* Prices include tax
* Prices include tax.
*
* To prevent rounding issues we need to work with the inclusive price where possible
* otherwise we'll see errors such as when working with a 9.99 inc price, 20% VAT which would
* be 8.325 leading to totals being 1p off
* To prevent rounding issues we need to work with the inclusive price where possible.
* otherwise we'll see errors such as when working with a 9.99 inc price, 20% VAT which would.
* be 8.325 leading to totals being 1p off.
*
* Pre tax coupons come off the price the customer thinks they are paying - tax is calculated
* Pre tax coupons come off the price the customer thinks they are paying - tax is calculated.
* afterwards.
*
* e.g. $100 bike with $10 coupon = customer pays $90 and tax worked backwards from that
* e.g. $100 bike with $10 coupon = customer pays $90 and tax worked backwards from that.
*/
} elseif ( $this->prices_include_tax ) {
@ -1142,7 +1142,7 @@ class WC_Cart {
$item_tax_rates = $tax_rates[ $_product->get_tax_class() ];
/**
* ADJUST TAX - Calculations when base tax is not equal to the item tax
* ADJUST TAX - Calculations when base tax is not equal to the item tax.
*
* The woocommerce_adjust_non_base_location_prices filter can stop base taxes being taken off when dealing with out of base locations.
* e.g. If a product costs 10 including tax, all users will pay 10 regardless of location and taxes.
@ -1161,7 +1161,7 @@ class WC_Cart {
$line_subtotal_tax = array_sum( $tax_result );
/**
* Regular tax calculation (customer inside base and the tax class is unmodified
* Regular tax calculation (customer inside base and the tax class is unmodified.
*/
} else {
@ -1172,7 +1172,7 @@ class WC_Cart {
}
/**
* Prices exclude tax
* Prices exclude tax.
*
* This calculation is simpler - work with the base, untaxed price.
*/
@ -1201,7 +1201,7 @@ class WC_Cart {
uasort( $cart, array( $this, 'sort_by_subtotal' ) );
/**
* Calculate totals for items
* Calculate totals for items.
*/
foreach ( $cart as $cart_item_key => $values ) {
@ -1216,7 +1216,7 @@ class WC_Cart {
$discounted_taxes = array();
/**
* No tax to calculate
* No tax to calculate.
*/
if ( ! $_product->is_taxable() ) {
@ -1228,7 +1228,7 @@ class WC_Cart {
$line_total = WC_Tax::round( $discounted_price * $values['quantity'] );
/**
* Prices include tax
* Prices include tax.
*/
} elseif ( $this->prices_include_tax ) {
@ -1236,7 +1236,7 @@ class WC_Cart {
$item_tax_rates = $tax_rates[ $_product->get_tax_class() ];
/**
* ADJUST TAX - Calculations when base tax is not equal to the item tax
* ADJUST TAX - Calculations when base tax is not equal to the item tax.
*
* The woocommerce_adjust_non_base_location_prices filter can stop base taxes being taken off when dealing with out of base locations.
* e.g. If a product costs 10 including tax, all users will pay 10 regardless of location and taxes.
@ -1262,7 +1262,7 @@ class WC_Cart {
$line_total = ( $discounted_price * $values['quantity'] ) - $line_tax;
/**
* Regular tax calculation (customer inside base and the tax class is unmodified
* Regular tax calculation (customer inside base and the tax class is unmodified.
*/
} else {
@ -1286,7 +1286,7 @@ class WC_Cart {
}
/**
* Prices exclude tax
* Prices exclude tax.
*/
} else {
@ -1427,7 +1427,7 @@ class WC_Cart {
*
* Shipping methods are responsible for looping through these packages.
*
* By default we pass the cart itself as a package - plugins can change this
* By default we pass the cart itself as a package - plugins can change this.
* through the filter and break it up.
*
* @since 1.5.4
@ -1484,7 +1484,7 @@ class WC_Cart {
}
/**
* Should the shipping address form be shown
* Should the shipping address form be shown.
*
* @return bool
*/
@ -1580,8 +1580,8 @@ class WC_Cart {
* Check for user coupons (now that we have billing email). If a coupon is invalid, add an error.
*
* Checks two types of coupons:
* 1. Where a list of customer emails are set (limits coupon usage to those defined)
* 2. Where a usage_limit_per_user is set (limits coupon usage to a number based on user ID and email)
* 1. Where a list of customer emails are set (limits coupon usage to those defined).
* 2. Where a usage_limit_per_user is set (limits coupon usage to a number based on user ID and email).
*
* @param array $posted
*/
@ -1761,7 +1761,7 @@ class WC_Cart {
}
/**
* Get the discount amount for a used coupon
* Get the discount amount for a used coupon.
* @param string $code coupon code
* @param bool inc or ex tax
* @return float discount amount
@ -1777,7 +1777,7 @@ class WC_Cart {
}
/**
* Get the discount tax amount for a used coupon (for tax inclusive prices)
* Get the discount tax amount for a used coupon (for tax inclusive prices).
* @param string $code coupon code
* @param bool inc or ex tax
* @return float discount amount
@ -1797,7 +1797,7 @@ class WC_Cart {
}
/**
* Remove a single coupon by code
* Remove a single coupon by code.
* @param string $coupon_code Code of the coupon to remove
* @return bool
*/
@ -1884,7 +1884,7 @@ class WC_Cart {
}
/**
* Store how many times each coupon is applied to cart/items
* Store how many times each coupon is applied to cart/items.
*
* @access private
* @param string $code
@ -1902,7 +1902,7 @@ class WC_Cart {
/*-----------------------------------------------------------------------------------*/
/**
* Add additional fee to the cart
* Add additional fee to the cart.
*
* @param string $name Unique name for the fee. Multiple fees of the same name cannot be added.
* @param float $amount Fee amount.
@ -1941,7 +1941,7 @@ class WC_Cart {
}
/**
* Calculate fees
* Calculate fees.
*/
public function calculate_fees() {
// Reset fees before calculation
@ -2080,7 +2080,7 @@ class WC_Cart {
*
* Gets the tax etc to avoid rounding issues.
*
* When on the checkout (review order), this will get the subtotal based on the customer's tax rate rather than the base rate
* When on the checkout (review order), this will get the subtotal based on the customer's tax rate rather than the base rate.
*
* @param WC_Product $_product
* @param int quantity
@ -2137,7 +2137,7 @@ class WC_Cart {
}
/**
* Get a tax amount
* Get a tax amount.
* @param string $tax_rate_id
* @return float amount
*/
@ -2146,7 +2146,7 @@ class WC_Cart {
}
/**
* Get a tax amount
* Get a tax amount.
* @param string $tax_rate_id
* @return float amount
*/
@ -2178,7 +2178,7 @@ class WC_Cart {
}
/**
* Get the total of all cart discounts
* Get the total of all cart discounts.
*
* @return float
*/
@ -2187,7 +2187,7 @@ class WC_Cart {
}
/**
* Get the total of all cart tax discounts (used for discounts on tax inclusive prices)
* Get the total of all cart tax discounts (used for discounts on tax inclusive prices).
*
* @return float
*/

View File

@ -1,6 +1,6 @@
<?php
/**
* Checkout
* Checkout.
*
* The WooCommerce checkout class handles the checkout process, collecting user data and processing the payment.
*
@ -46,7 +46,7 @@ class WC_Checkout {
public $enable_guest_checkout;
/**
* Main WC_Checkout Instance
* Main WC_Checkout Instance.
*
* Ensures only one instance of WC_Checkout is loaded or can be loaded.
*
@ -128,7 +128,7 @@ class WC_Checkout {
}
/**
* Checkout process
* Checkout process.
*/
public function check_cart_items() {
// When we process the checkout, lets ensure cart items are rechecked to prevent checkout
@ -136,14 +136,14 @@ class WC_Checkout {
}
/**
* Output the billing information form
* Output the billing information form.
*/
public function checkout_form_billing() {
wc_get_template( 'checkout/form-billing.php', array( 'checkout' => $this ) );
}
/**
* Output the shipping information form
* Output the shipping information form.
*/
public function checkout_form_shipping() {
wc_get_template( 'checkout/form-shipping.php', array( 'checkout' => $this ) );
@ -153,13 +153,13 @@ class WC_Checkout {
* Create an order.
*
* Error codes:
* 400 - Cannot insert order into the database
* 401 - Cannote update existing order
* 402 - Cannot create line item
* 403 - Cannot create fee item
* 404 - Cannot create shipping item
* 405 - Cannot create tax item
* 406 - Cannot create coupon item
* 400 - Cannot insert order into the database.
* 401 - Cannote update existing order.
* 402 - Cannot create line item.
* 403 - Cannot create fee item.
* 404 - Cannot create shipping item.
* 405 - Cannot create tax item.
* 406 - Cannot create coupon item.
*
* @access public
* @throws Exception
@ -336,7 +336,7 @@ class WC_Checkout {
}
/**
* Process the checkout after the confirm order button is pressed
* Process the checkout after the confirm order button is pressed.
*/
public function process_checkout() {
try {
@ -734,7 +734,7 @@ class WC_Checkout {
}
/**
* Gets the value either from the posted data, or from the users meta data
* Gets the value either from the posted data, or from the users meta data.
*
* @access public
* @param string $input

View File

@ -1,8 +1,8 @@
<?php
/**
* Comments
* Comments.
*
* Handle comments (reviews and order notes)
* Handle comments (reviews and order notes).
*
* @class WC_Comments
* @version 2.3.0
@ -50,10 +50,10 @@ class WC_Comments {
}
/**
* Exclude order comments from queries and RSS
* Exclude order comments from queries and RSS.
*
* This code should exclude shop_order comments from queries. Some queries (like the recent comments widget on the dashboard) are hardcoded
* and are not filtered, however, the code current_user_can( 'read_post', $comment->comment_post_ID ) should keep them safe since only admin and
* This code should exclude shop_order comments from queries. Some queries (like the recent comments widget on the dashboard) are hardcoded.
* and are not filtered, however, the code current_user_can( 'read_post', $comment->comment_post_ID ) should keep them safe since only admin and.
* shop managers can view orders anyway.
*
* The frontend view order pages get around this filter by using remove_filter('comments_clauses', array( 'WC_Comments' ,'exclude_order_comments'), 10, 1 );
@ -85,7 +85,7 @@ class WC_Comments {
}
/**
* Exclude order comments from queries and RSS
* Exclude order comments from queries and RSS.
* @param string $join
* @return string
*/
@ -100,7 +100,7 @@ class WC_Comments {
}
/**
* Exclude order comments from queries and RSS
* Exclude order comments from queries and RSS.
* @param string $where
* @return string
*/
@ -117,7 +117,7 @@ class WC_Comments {
}
/**
* Exclude webhook comments from queries and RSS
* Exclude webhook comments from queries and RSS.
* @since 2.2
* @param array $clauses
* @return array
@ -143,7 +143,7 @@ class WC_Comments {
}
/**
* Exclude webhook comments from queries and RSS
* Exclude webhook comments from queries and RSS.
* @since 2.2
* @param string $join
* @return string
@ -159,7 +159,7 @@ class WC_Comments {
}
/**
* Exclude webhook comments from queries and RSS
* Exclude webhook comments from queries and RSS.
* @since 2.1
* @param string $where
* @return string
@ -238,7 +238,7 @@ class WC_Comments {
}
/**
* Remove order notes from wp_count_comments()
* Remove order notes from wp_count_comments().
* @since 2.2
* @param object $stats
* @param int $post_id
@ -284,7 +284,7 @@ class WC_Comments {
}
/**
* Make sure WP displays avatars for comments with the `review` type
* Make sure WP displays avatars for comments with the `review` type.
* @since 2.3
* @param array $comment_types
* @return array

View File

@ -1,6 +1,6 @@
<?php
/**
* WooCommerce countries
* WooCommerce countries.
*
* The WooCommerce countries class stores country/state data.
*
@ -339,7 +339,7 @@ class WC_Countries {
}
/**
* Get country address formats
* Get country address formats.
* @return array
*/
public function get_address_formats() {
@ -935,7 +935,7 @@ class WC_Countries {
}
/**
* Apply locale and get address fields
* Apply locale and get address fields.
* @param mixed $country
* @param string $type (default: 'billing_')
* @return array

View File

@ -1,8 +1,8 @@
<?php
/**
* WooCommerce coupons
* WooCommerce coupons.
*
* The WooCommerce coupons class gets coupon data from storage and checks coupon validity
* The WooCommerce coupons class gets coupon data from storage and checks coupon validity.
*
* @class WC_Coupon
* @version 2.3.0
@ -138,7 +138,7 @@ class WC_Coupon {
}
/**
* Get a coupon ID from it's code
* Get a coupon ID from it's code.
* @param string $code
* @return int
*/
@ -188,8 +188,8 @@ class WC_Coupon {
// Try to load from meta if an ID is present
if ( ! empty( $this->id ) ) {
/**
* By not calling `get_post_meta()` individually, we may be breaking compatibility with
* some plugins that filter on `get_post_metadata` and erroneously override based solely
* By not calling `get_post_meta()` individually, we may be breaking compatibility with.
* some plugins that filter on `get_post_metadata` and erroneously override based solely.
* on $meta_key -- but don't override when querying for all as $meta_key is empty().
*/
$this->$key = isset( $postmeta[ $key ] ) ? maybe_unserialize( array_shift( $postmeta[ $key ] ) ) : '';
@ -219,7 +219,7 @@ class WC_Coupon {
}
/**
* Format loaded data as array
* Format loaded data as array.
* @param string|array $array
* @return array
*/
@ -290,7 +290,7 @@ class WC_Coupon {
if ( $used_by ) {
/**
* We're doing this the long way because `delete_post_meta( $id, $key, $value )` deletes
* We're doing this the long way because `delete_post_meta( $id, $key, $value )` deletes.
* all instances where the key and value match, and we only want to delete one.
*/
$meta_id = $wpdb->get_var( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE meta_key = '_used_by' AND meta_value = %s AND post_id = %d LIMIT 1;", $used_by, $this->id ) );
@ -314,7 +314,7 @@ class WC_Coupon {
}
/**
* Returns the error_message string
* Returns the error_message string.
*
* @access public
* @return string
@ -324,7 +324,7 @@ class WC_Coupon {
}
/**
* Ensure coupon exists or throw exception
* Ensure coupon exists or throw exception.
*/
private function validate_exists() {
if ( ! $this->exists ) {
@ -333,7 +333,7 @@ class WC_Coupon {
}
/**
* Ensure coupon usage limit is valid or throw exception
* Ensure coupon usage limit is valid or throw exception.
*/
private function validate_usage_limit() {
if ( $this->usage_limit > 0 && $this->usage_count >= $this->usage_limit ) {
@ -342,10 +342,10 @@ class WC_Coupon {
}
/**
* Ensure coupon user usage limit is valid or throw exception
* Ensure coupon user usage limit is valid or throw exception.
*
* Per user usage limit - check here if user is logged in (against user IDs)
* Checked again for emails later on in WC_Cart::check_customer_coupons()
* Per user usage limit - check here if user is logged in (against user IDs).
* Checked again for emails later on in WC_Cart::check_customer_coupons().
*
* @param int $user_id
*/
@ -368,7 +368,7 @@ class WC_Coupon {
}
/**
* Ensure coupon date is valid or throw exception
* Ensure coupon date is valid or throw exception.
*/
private function validate_expiry_date() {
if ( $this->expiry_date && current_time( 'timestamp' ) > $this->expiry_date ) {
@ -377,7 +377,7 @@ class WC_Coupon {
}
/**
* Ensure coupon amount is valid or throw exception
* Ensure coupon amount is valid or throw exception.
*/
private function validate_minimum_amount() {
if ( $this->minimum_amount > 0 && wc_format_decimal( $this->minimum_amount ) > wc_format_decimal( WC()->cart->subtotal ) ) {
@ -386,7 +386,7 @@ class WC_Coupon {
}
/**
* Ensure coupon amount is valid or throw exception
* Ensure coupon amount is valid or throw exception.
*/
private function validate_maximum_amount() {
if ( $this->maximum_amount > 0 && wc_format_decimal( $this->maximum_amount ) < wc_format_decimal( WC()->cart->subtotal ) ) {
@ -395,7 +395,7 @@ class WC_Coupon {
}
/**
* Ensure coupon is valid for products in the cart is valid or throw exception
* Ensure coupon is valid for products in the cart is valid or throw exception.
*/
private function validate_product_ids() {
if ( sizeof( $this->product_ids ) > 0 ) {
@ -414,7 +414,7 @@ class WC_Coupon {
}
/**
* Ensure coupon is valid for product categories in the cart is valid or throw exception
* Ensure coupon is valid for product categories in the cart is valid or throw exception.
*/
private function validate_product_categories() {
if ( sizeof( $this->product_categories ) > 0 ) {
@ -434,7 +434,7 @@ class WC_Coupon {
}
/**
* Ensure coupon is valid for sale items in the cart is valid or throw exception
* Ensure coupon is valid for sale items in the cart is valid or throw exception.
*/
private function validate_sale_items() {
if ( 'yes' === $this->exclude_sale_items && $this->is_type( array( 'fixed_product', 'percent_product' ) ) ) {
@ -459,7 +459,7 @@ class WC_Coupon {
}
/**
* Cart discounts cannot be added if non-eligble product is found in cart
* Cart discounts cannot be added if non-eligble product is found in cart.
*/
private function validate_cart_excluded_items() {
if ( ! $this->is_type( array( 'fixed_product', 'percent_product' ) ) ) {
@ -470,7 +470,7 @@ class WC_Coupon {
}
/**
* Exclude products from cart
* Exclude products from cart.
*/
private function validate_cart_excluded_product_ids() {
// Exclude Products
@ -490,7 +490,7 @@ class WC_Coupon {
}
/**
* Exclude categories from cart
* Exclude categories from cart.
*/
private function validate_cart_excluded_product_categories() {
if ( sizeof( $this->exclude_product_categories ) > 0 ) {
@ -512,7 +512,7 @@ class WC_Coupon {
}
/**
* Exclude sale items from cart
* Exclude sale items from cart.
*/
private function validate_cart_excluded_sale_items() {
if ( $this->exclude_sale_items == 'yes' ) {
@ -565,7 +565,7 @@ class WC_Coupon {
}
/**
* Check if a coupon is valid
* Check if a coupon is valid.
*
* @return bool
*/
@ -574,7 +574,7 @@ class WC_Coupon {
}
/**
* Check if a coupon is valid for a product
* Check if a coupon is valid for a product.
*
* @param WC_Product $product
* @return boolean
@ -637,7 +637,7 @@ class WC_Coupon {
}
/**
* Get discount amount for a cart item
* Get discount amount for a cart item.
*
* @param float $discounting_amount Amount the coupon is being applied to
* @param array|null $cart_item Cart item being discounted if applicable
@ -653,13 +653,13 @@ class WC_Coupon {
} elseif ( $this->is_type( 'fixed_cart' ) && ! is_null( $cart_item ) && WC()->cart->subtotal_ex_tax ) {
/**
* This is the most complex discount - we need to divide the discount between rows based on their price in
* proportion to the subtotal. This is so rows with different tax rates get a fair discount, and so rows
* This is the most complex discount - we need to divide the discount between rows based on their price in.
* proportion to the subtotal. This is so rows with different tax rates get a fair discount, and so rows.
* with no price (free) don't get discounted.
*
* Get item discount by dividing item cost by subtotal to get a %
* Get item discount by dividing item cost by subtotal to get a %.
*
* Uses price inc tax if prices include tax to work around https://github.com/woothemes/woocommerce/issues/7669 and https://github.com/woothemes/woocommerce/issues/8074
* Uses price inc tax if prices include tax to work around https://github.com/woothemes/woocommerce/issues/7669 and https://github.com/woothemes/woocommerce/issues/8074.
*/
if ( wc_prices_include_tax() ) {
$discount_percent = ( $cart_item['data']->get_price_including_tax() * $cart_item_qty ) / WC()->cart->subtotal;
@ -698,7 +698,7 @@ class WC_Coupon {
}
/**
* Converts one of the WC_Coupon message/error codes to a message string and
* Converts one of the WC_Coupon message/error codes to a message string and.
* displays the message/error.
*
* @param int $msg_code Message/error code.
@ -719,7 +719,7 @@ class WC_Coupon {
}
/**
* Map one of the WC_Coupon message codes to a message string
* Map one of the WC_Coupon message codes to a message string.
*
* @param integer $msg_code
* @return string| Message/error string
@ -740,7 +740,7 @@ class WC_Coupon {
}
/**
* Map one of the WC_Coupon error codes to a message string
* Map one of the WC_Coupon error codes to a message string.
*
* @param int $err_code Message/error code.
* @return string| Message/error string
@ -824,7 +824,7 @@ class WC_Coupon {
}
/**
* Map one of the WC_Coupon error codes to an error string
* Map one of the WC_Coupon error codes to an error string.
* No coupon instance will be available where a coupon does not exist,
* so this static method exists.
*

View File

@ -1,6 +1,6 @@
<?php
/**
* Customer
* Customer.
*
* The WooCommerce customer class handles storage of the current customer's data, such as location.
*
@ -28,14 +28,14 @@
class WC_Customer {
/**
* Stores customer data
* Stores customer data.
*
* @var array
*/
protected $_data = array();
/**
* Stores bool when data is changed
* Stores bool when data is changed.
*
* @var bool
*/
@ -116,7 +116,7 @@ class WC_Customer {
}
/**
* Get default country for a customer
* Get default country for a customer.
*
* @return string
*/
@ -126,7 +126,7 @@ class WC_Customer {
}
/**
* Get default state for a customer
* Get default state for a customer.
*
* @return string
*/
@ -217,7 +217,7 @@ class WC_Customer {
}
/**
* Gets the country from the current session
* Gets the country from the current session.
*
* @return string
*/
@ -352,7 +352,7 @@ class WC_Customer {
}
/**
* Set default data for a customer
* Set default data for a customer.
*/
public function set_default_data( $get_user_profile_data = true ) {
$this->_data = array(

View File

@ -5,7 +5,7 @@ if ( ! defined( 'ABSPATH' ) ) {
}
/**
* Download handler
* Download handler.
*
* Handle digital downloads.
*
@ -18,7 +18,7 @@ if ( ! defined( 'ABSPATH' ) ) {
class WC_Download_Handler {
/**
* Hook in methods
* Hook in methods.
*/
public static function init() {
if ( isset( $_GET['download_file'] ) && isset( $_GET['order'] ) && isset( $_GET['email'] ) ) {
@ -30,7 +30,7 @@ class WC_Download_Handler {
}
/**
* Check if we need to download a file and check validity
* Check if we need to download a file and check validity.
*/
public static function download_product() {
$product_id = absint( $_GET['download_file'] );
@ -77,7 +77,7 @@ class WC_Download_Handler {
}
/**
* Perform checks to see if the current user can download the file
* Perform checks to see if the current user can download the file.
* @param object $download_data
* @access private
*/
@ -89,7 +89,7 @@ class WC_Download_Handler {
}
/**
* Check if an order is valid for downloading from
* Check if an order is valid for downloading from.
* @param array $download_data
* @access private
*/
@ -100,7 +100,7 @@ class WC_Download_Handler {
}
/**
* Check if there are downloads remaining
* Check if there are downloads remaining.
* @param array $download_data
* @access private
*/
@ -111,7 +111,7 @@ class WC_Download_Handler {
}
/**
* Check if the download has expired
* Check if the download has expired.
* @param array $download_data
* @access private
*/
@ -122,7 +122,7 @@ class WC_Download_Handler {
}
/**
* Check if a download requires the user to login first
* Check if a download requires the user to login first.
* @param array $download_data
* @access private
*/
@ -142,7 +142,7 @@ class WC_Download_Handler {
}
/**
* Log the download + increase counts
* Log the download + increase counts.
* @param object $download_data
*/
public static function count_download( $download_data ) {
@ -189,7 +189,7 @@ class WC_Download_Handler {
}
/**
* Redirect to a file to start the download
* Redirect to a file to start the download.
* @param string $file_path
* @param string $filename
*/
@ -199,7 +199,7 @@ class WC_Download_Handler {
}
/**
* Parse file path and see if its remote or local
* Parse file path and see if its remote or local.
* @param string $file_path
* @return array
*/
@ -239,7 +239,7 @@ class WC_Download_Handler {
}
/**
* Download a file using X-Sendfile, X-Lighttpd-Sendfile, or X-Accel-Redirect if available
* Download a file using X-Sendfile, X-Lighttpd-Sendfile, or X-Accel-Redirect if available.
* @param string $file_path
* @param string $filename
*/
@ -266,7 +266,7 @@ class WC_Download_Handler {
}
/**
* Force download - this is the default method
* Force download - this is the default method.
* @param string $file_path
* @param string $filename
*/
@ -287,7 +287,7 @@ class WC_Download_Handler {
}
/**
* Get content type of a download
* Get content type of a download.
* @param string $file_path
* @return string
* @access private
@ -308,7 +308,7 @@ class WC_Download_Handler {
}
/**
* Set headers for the download
* Set headers for the download.
* @param string $file_path
* @param string $filename
* @access private
@ -347,9 +347,9 @@ class WC_Download_Handler {
}
/**
* Clean all output buffers
* Clean all output buffers.
*
* Can prevent errors, for example: transfer closed with 3 bytes remaining to read
* Can prevent errors, for example: transfer closed with 3 bytes remaining to read.
*
* @access private
*/
@ -365,9 +365,9 @@ class WC_Download_Handler {
}
/**
* readfile_chunked
* readfile_chunked.
*
* Reads file in chunks so big downloads are possible without changing PHP.INI - http://codeigniter.com/wiki/Download_helper_for_large_files/
* Reads file in chunks so big downloads are possible without changing PHP.INI - http://codeigniter.com/wiki/Download_helper_for_large_files/.
*
* @param string $file
* @return bool Success or fail
@ -393,7 +393,7 @@ class WC_Download_Handler {
}
/**
* Filter headers for IE to fix issues over SSL
* Filter headers for IE to fix issues over SSL.
*
* IE bug prevents download via SSL when Cache Control and Pragma no-cache headers set.
*
@ -409,7 +409,7 @@ class WC_Download_Handler {
}
/**
* Die with an error message if the download fails
* Die with an error message if the download fails.
* @param string $message
* @param string $title
* @param integer $status

View File

@ -1,6 +1,6 @@
<?php
/**
* Transactional Emails Controller
* Transactional Emails Controller.
*
* WooCommerce Emails Class which handles the sending on transactional emails and email templates. This class loads in available emails.
*
@ -19,7 +19,7 @@ class WC_Emails {
protected static $_instance = null;
/**
* Main WC_Emails Instance
* Main WC_Emails Instance.
*
* Ensures only one instance of WC_Emails is loaded or can be loaded.
*
@ -53,7 +53,7 @@ class WC_Emails {
}
/**
* Hook in all transactional emails
* Hook in all transactional emails.
*/
public static function init_transactional_emails() {
$email_actions = apply_filters( 'woocommerce_email_actions', array(
@ -115,7 +115,7 @@ class WC_Emails {
}
/**
* Init email classes
* Init email classes.
*/
public function init() {
// Include email classes
@ -267,7 +267,7 @@ class WC_Emails {
$fields = apply_filters( 'woocommerce_email_order_meta_fields', $fields, $sent_to_admin, $order );
/**
* Deprecated woocommerce_email_order_meta_keys filter
* Deprecated woocommerce_email_order_meta_keys filter.
*
* @since 2.3.0
*/
@ -362,7 +362,7 @@ class WC_Emails {
}
/**
* Get blog name formatted for emails
* Get blog name formatted for emails.
* @return string
*/
private function get_blogname() {

View File

@ -5,7 +5,7 @@ if ( ! defined( 'ABSPATH' ) ) {
}
/**
* Handle frontend forms
* Handle frontend forms.
*
* @class WC_Form_Handler
* @version 2.2.0
@ -16,7 +16,7 @@ if ( ! defined( 'ABSPATH' ) ) {
class WC_Form_Handler {
/**
* Hook in methods
* Hook in methods.
*/
public static function init() {
add_action( 'template_redirect', array( __CLASS__, 'save_address' ) );
@ -37,7 +37,7 @@ class WC_Form_Handler {
}
/**
* Save and and update a billing or shipping address if the
* Save and and update a billing or shipping address if the.
* form was submitted through the user account page.
*/
public static function save_address() {
@ -586,7 +586,7 @@ class WC_Form_Handler {
}
/**
* Add to cart action
* Add to cart action.
*
* Checks for a valid request, does validation (via hooks) and then redirects if valid.
*
@ -638,7 +638,7 @@ class WC_Form_Handler {
}
/**
* Handle adding simple products to the cart
* Handle adding simple products to the cart.
* @since 2.4.6 Split from add_to_cart_action
* @param int $product_id
* @return bool success or not
@ -655,7 +655,7 @@ class WC_Form_Handler {
}
/**
* Handle adding grouped products to the cart
* Handle adding grouped products to the cart.
* @since 2.4.6 Split from add_to_cart_action
* @param int $product_id
* @return bool success or not
@ -697,7 +697,7 @@ class WC_Form_Handler {
}
/**
* Handle adding variable products to the cart
* Handle adding variable products to the cart.
* @since 2.4.6 Split from add_to_cart_action
* @param int $product_id
* @return bool success or not
@ -832,7 +832,7 @@ class WC_Form_Handler {
}
/**
* Handle lost password form
* Handle lost password form.
*/
public static function process_lost_password() {
if ( isset( $_POST['wc_reset_password'] ) && isset( $_POST['user_login'] ) && isset( $_POST['_wpnonce'] ) && wp_verify_nonce( $_POST['_wpnonce'], 'lost_password' ) ) {
@ -841,7 +841,7 @@ class WC_Form_Handler {
}
/**
* Handle reset password form
* Handle reset password form.
*/
public static function process_reset_password() {
$posted_fields = array( 'wc_reset_password', 'password_1', 'password_2', 'reset_key', 'reset_login', '_wpnonce' );

View File

@ -1,6 +1,6 @@
<?php
/**
* Handle frontend scripts
* Handle frontend scripts.
*
* @class WC_Frontend_Scripts
* @version 2.3.0
@ -14,24 +14,24 @@ if ( ! defined( 'ABSPATH' ) ) {
}
/**
* WC_Frontend_Scripts Class
* WC_Frontend_Scripts Class.
*/
class WC_Frontend_Scripts {
/**
* Contains an array of script handles registered by WC
* Contains an array of script handles registered by WC.
* @var array
*/
private static $scripts = array();
/**
* Contains an array of script handles registered by WC
* Contains an array of script handles registered by WC.
* @var array
*/
private static $styles = array();
/**
* Contains an array of script handles localized by WC
* Contains an array of script handles localized by WC.
* @var array
*/
private static $wp_localize_scripts = array();

View File

@ -15,7 +15,7 @@ if ( ! defined( 'ABSPATH' ) ) {
}
/**
* WC_Geolocation Class
* WC_Geolocation Class.
*/
class WC_Geo_IP {
@ -1105,7 +1105,7 @@ class WC_Geo_IP {
);
/**
* Open geoip file
* Open geoip file.
*
* @param string $filename
* @param int $flags
@ -1126,7 +1126,7 @@ class WC_Geo_IP {
}
/**
* Setup segments
* Setup segments.
*
* @return WC_Geo_IP instance
*/
@ -1281,7 +1281,7 @@ class WC_Geo_IP {
}
/**
* Close geoip file
* Close geoip file.
*
* @return bool
*/
@ -1294,7 +1294,7 @@ class WC_Geo_IP {
}
/**
* Common get record
* Common get record.
*
* @param string $seek_country
* @return WC_Geo_IP_Record instance
@ -1409,7 +1409,7 @@ class WC_Geo_IP {
}
/**
* Get record
* Get record.
*
* @param int $ipnum
* @return WC_Geo_IP_Record instance
@ -1424,7 +1424,7 @@ class WC_Geo_IP {
}
/**
* Seek country IPv6
* Seek country IPv6.
*
* @param int $ipnum [description]
* @return bool|int
@ -1484,7 +1484,7 @@ class WC_Geo_IP {
}
/**
* Seek country
* Seek country.
*
* @param int $ipnum
* @return bool|int
@ -1538,7 +1538,7 @@ class WC_Geo_IP {
}
/**
* Record by addr
* Record by addr.
*
* @param string $addr
* @return int
@ -1553,7 +1553,7 @@ class WC_Geo_IP {
}
/**
* Country ID by addr IPv6
* Country ID by addr IPv6.
*
* @param string $addr
* @return int
@ -1564,7 +1564,7 @@ class WC_Geo_IP {
}
/**
* Country ID by addr
* Country ID by addr.
*
* @param string $addr
* @return int
@ -1575,7 +1575,7 @@ class WC_Geo_IP {
}
/**
* Country code by addr IPv6
* Country code by addr IPv6.
*
* @param string $addr
* @return bool|int
@ -1590,7 +1590,7 @@ class WC_Geo_IP {
}
/**
* Country code by addr
* Country code by addr.
*
* @param string $addr
* @return bool|int
@ -1612,7 +1612,7 @@ class WC_Geo_IP {
}
/**
* Encode string
* Encode string.
*
* @param string $string
* @param int $start
@ -1641,7 +1641,7 @@ class WC_Geo_IP {
}
/**
* Geo IP Record class
* Geo IP Record class.
*/
class WC_Geo_IP_Record {
public $country_code;

View File

@ -17,7 +17,7 @@ if ( ! defined( 'ABSPATH' ) ) {
}
/**
* WC_Geolocation Class
* WC_Geolocation Class.
*/
class WC_Geolocation {
@ -54,7 +54,7 @@ class WC_Geolocation {
}
/**
* Maybe trigger a DB update for the first time
* Maybe trigger a DB update for the first time.
* @param string $new_value
* @param string $old_value
* @return string
@ -67,7 +67,7 @@ class WC_Geolocation {
}
/**
* Get current user IP Address
* Get current user IP Address.
* @return string
*/
public static function get_ip_address() {
@ -84,7 +84,7 @@ class WC_Geolocation {
}
/**
* Get user IP Address using a service
* Get user IP Address using a service.
* @return string
*/
public static function get_external_ip_address() {
@ -114,7 +114,7 @@ class WC_Geolocation {
}
/**
* Geolocate an IP address
* Geolocate an IP address.
* @param string $ip_address
* @return array
*/
@ -150,7 +150,7 @@ class WC_Geolocation {
}
/**
* Path to our local db
* Path to our local db.
* @param string $version
* @return string
*/
@ -275,7 +275,7 @@ class WC_Geolocation {
}
/**
* Test if is IPv6
* Test if is IPv6.
*
* @since 2.4.0
*

View File

@ -65,7 +65,7 @@ class WC_HTTPS {
}
/**
* Force a post link to be SSL if needed
* Force a post link to be SSL if needed.
*
* @return string
*/
@ -79,7 +79,7 @@ class WC_HTTPS {
}
/**
* Template redirect - if we end up on a page ensure it has the correct http/https url
* Template redirect - if we end up on a page ensure it has the correct http/https url.
*/
public static function force_https_template_redirect() {
if ( ! is_ssl() && ( is_checkout() || is_account_page() || apply_filters( 'woocommerce_force_ssl_checkout', false ) ) ) {
@ -95,7 +95,7 @@ class WC_HTTPS {
}
/**
* Template redirect - if we end up on a page ensure it has the correct http/https url
* Template redirect - if we end up on a page ensure it has the correct http/https url.
*/
public static function unforce_https_template_redirect() {
if ( function_exists( 'is_customize_preview' ) && is_customize_preview() ) {

View File

@ -13,7 +13,7 @@ if ( ! defined( 'ABSPATH' ) ) {
}
/**
* WC_Install Class
* WC_Install Class.
*/
class WC_Install {
@ -74,7 +74,7 @@ class WC_Install {
}
/**
* Install WC
* Install WC.
*/
public static function install() {
global $wpdb;
@ -134,8 +134,8 @@ class WC_Install {
delete_transient( 'wc_attribute_taxonomies' );
/*
* Deletes all expired transients. The multi-table delete syntax is used
* to delete the transient record from table a, and the corresponding
* Deletes all expired transients. The multi-table delete syntax is used.
* to delete the transient record from table a, and the corresponding.
* transient_timeout record from table b.
*
* Based on code inside core's upgrade_network() function.
@ -152,7 +152,7 @@ class WC_Install {
}
/**
* Update WC version to current
* Update WC version to current.
*/
private static function update_wc_version() {
delete_option( 'woocommerce_version' );
@ -160,7 +160,7 @@ class WC_Install {
}
/**
* Update DB version to current
* Update DB version to current.
*/
private static function update_db_version( $version = null ) {
delete_option( 'woocommerce_db_version' );
@ -168,7 +168,7 @@ class WC_Install {
}
/**
* Handle updates
* Handle updates.
*/
private static function update() {
$current_db_version = get_option( 'woocommerce_db_version' );
@ -184,7 +184,7 @@ class WC_Install {
}
/**
* Add more cron schedules
* Add more cron schedules.
* @param array $schedules
* @return array
*/
@ -197,7 +197,7 @@ class WC_Install {
}
/**
* Create cron jobs (clear them first)
* Create cron jobs (clear them first).
*/
private static function create_cron_jobs() {
wp_clear_scheduled_hook( 'woocommerce_scheduled_sales' );
@ -256,9 +256,9 @@ class WC_Install {
}
/**
* Default options
* Default options.
*
* Sets up the default options used on the settings page
* Sets up the default options used on the settings page.
*/
private static function create_options() {
// Include settings so that we can run through defaults
@ -326,7 +326,7 @@ class WC_Install {
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
/**
* Before updating with DBDELTA, remove any primary keys which could be modified due to schema updates
* Before updating with DBDELTA, remove any primary keys which could be modified due to schema updates.
*/
if ( $wpdb->get_var( "SHOW TABLES LIKE '{$wpdb->prefix}woocommerce_downloadable_product_permissions';" ) ) {
if ( ! $wpdb->get_var( "SHOW COLUMNS FROM `{$wpdb->prefix}woocommerce_downloadable_product_permissions` LIKE 'permission_id';" ) ) {
@ -344,7 +344,7 @@ class WC_Install {
}
/**
* Get Table schema
* Get Table schema.
* @return string
*/
private static function get_schema() {
@ -467,7 +467,7 @@ CREATE TABLE {$wpdb->prefix}woocommerce_tax_rate_locations (
}
/**
* Create roles and capabilities
* Create roles and capabilities.
*/
public static function create_roles() {
global $wp_roles;
@ -540,7 +540,7 @@ CREATE TABLE {$wpdb->prefix}woocommerce_tax_rate_locations (
}
/**
* Get capabilities for WooCommerce - these are assigned to admin/shop manager during installation or reset
* Get capabilities for WooCommerce - these are assigned to admin/shop manager during installation or reset.
*
* @return array
*/
@ -611,7 +611,7 @@ CREATE TABLE {$wpdb->prefix}woocommerce_tax_rate_locations (
}
/**
* Create files/directories
* Create files/directories.
*/
private static function create_files() {
// Install files and folders for uploading files and prevent hotlinking
@ -673,7 +673,7 @@ CREATE TABLE {$wpdb->prefix}woocommerce_tax_rate_locations (
}
/**
* Parse update notice from readme file
* Parse update notice from readme file.
* @param string $content
* @return string
*/

View File

@ -1,6 +1,6 @@
<?php
/**
* WooCommerce Integrations class
* WooCommerce Integrations class.
*
* Loads Integrations into WooCommerce.
*

View File

@ -1,8 +1,8 @@
<?php
/**
* Order Factory Class
* Order Factory Class.
*
* The WooCommerce order factory creating the right order objects
* The WooCommerce order factory creating the right order objects.
*
* @class WC_Order_Factory
* @version 2.2.0

View File

@ -1,8 +1,8 @@
<?php
/**
* Order Item Meta
* Order Item Meta.
*
* A Simple class for managing order item meta so plugins add it in the correct format
* A Simple class for managing order item meta so plugins add it in the correct format.
*
* @class order_item_meta
* @version 2.4
@ -24,7 +24,7 @@ class WC_Order_Item_Meta {
public $product = null;
/**
* Constructor
* Constructor.
*
* @param array $item defaults to array()
* @param \WC_Product $product defaults to null
@ -44,7 +44,7 @@ class WC_Order_Item_Meta {
}
/**
* Display meta in a formatted list
* Display meta in a formatted list.
*
* @param bool $flat (default: false)
* @param bool $return (default: false)
@ -138,7 +138,7 @@ class WC_Order_Item_Meta {
/**
* Return an array of formatted item meta in format e.g.
* Handles @deprecated args
* Handles @deprecated args.
* @return array
*/
public function get_formatted_legacy( $hideprefix = '_' ) {

View File

@ -1,6 +1,6 @@
<?php
/**
* Order refund
* Order refund.
*
* @class WC_Order_Refund
* @version 2.2.0
@ -42,7 +42,7 @@ class WC_Order_Refund extends WC_Abstract_Order {
}
/**
* Gets an refund from the database
* Gets an refund from the database.
*
* @since 2.2
* @param int $id
@ -63,7 +63,7 @@ class WC_Order_Refund extends WC_Abstract_Order {
}
/**
* Populates an refund from the loaded post data
* Populates an refund from the loaded post data.
*
* @param mixed $result
*/
@ -76,7 +76,7 @@ class WC_Order_Refund extends WC_Abstract_Order {
}
/**
* Get refunded amount
* Get refunded amount.
*
* @since 2.2
* @return int|float
@ -86,7 +86,7 @@ class WC_Order_Refund extends WC_Abstract_Order {
}
/**
* Get formatted refunded amount
* Get formatted refunded amount.
*
* @since 2.4
* @return string
@ -97,7 +97,7 @@ class WC_Order_Refund extends WC_Abstract_Order {
/**
* Get refunded amount
* Get refunded amount.
*
* @since 2.2
* @return int|float

View File

@ -1,6 +1,6 @@
<?php
/**
* Order
* Order.
*
* @class WC_Order
* @version 2.2.0
@ -52,7 +52,7 @@ class WC_Order extends WC_Abstract_Order {
}
/**
* Get order refunds
* Get order refunds.
*
* @since 2.2
* @return array
@ -80,7 +80,7 @@ class WC_Order extends WC_Abstract_Order {
}
/**
* Get amount already refunded
* Get amount already refunded.
*
* @since 2.2
* @return int|float
@ -100,7 +100,7 @@ class WC_Order extends WC_Abstract_Order {
}
/**
* Get the total tax refunded
* Get the total tax refunded.
*
* @since 2.3
* @return float
@ -121,7 +121,7 @@ class WC_Order extends WC_Abstract_Order {
}
/**
* Get the total shipping refunded
* Get the total shipping refunded.
*
* @since 2.4
* @return float
@ -184,7 +184,7 @@ class WC_Order extends WC_Abstract_Order {
}
/**
* Get the refunded amount for a line item
* Get the refunded amount for a line item.
*
* @param int $item_id ID of the item we're checking
* @param string $item_type type of the item we're checking, if not a line_item
@ -203,7 +203,7 @@ class WC_Order extends WC_Abstract_Order {
}
/**
* Get the refunded amount for a line item
* Get the refunded amount for a line item.
*
* @param int $item_id ID of the item we're checking
* @param string $item_type type of the item we're checking, if not a line_item
@ -229,7 +229,7 @@ class WC_Order extends WC_Abstract_Order {
}
/**
* Get the refunded amount for a line item
* Get the refunded amount for a line item.
*
* @param int $item_id ID of the item we're checking
* @param int $tax_id ID of the tax we're checking

View File

@ -1,6 +1,6 @@
<?php
/**
* WooCommerce Payment Gateways class
* WooCommerce Payment Gateways class.
*
* Loads payment gateways via hooks for use in the store.
*
@ -22,7 +22,7 @@ class WC_Payment_Gateways {
protected static $_instance = null;
/**
* Main WC_Payment_Gateways Instance
* Main WC_Payment_Gateways Instance.
*
* Ensures only one instance of WC_Payment_Gateways is loaded or can be loaded.
*
@ -152,7 +152,7 @@ class WC_Payment_Gateways {
}
/**
* Set the current, active gateway
* Set the current, active gateway.
*/
public function set_current_gateway( $gateways ) {
$current = WC()->session->get( 'chosen_payment_method' );

View File

@ -5,7 +5,7 @@ if ( ! defined( 'ABSPATH' ) ) {
}
/**
* Post Data
* Post Data.
*
* Standardises certain post data on save.
*
@ -20,7 +20,7 @@ class WC_Post_Data {
private static $editing_term = null;
/**
* Hook in methods
* Hook in methods.
*/
public static function init() {
add_action( 'set_object_terms', array( __CLASS__, 'set_object_terms' ), 10, 6 );
@ -39,7 +39,7 @@ class WC_Post_Data {
}
/**
* Delete transients when terms are set
* Delete transients when terms are set.
*/
public static function set_object_terms( $object_id, $terms, $tt_ids, $taxonomy, $append, $old_tt_ids ) {
foreach ( array_merge( $tt_ids, $old_tt_ids ) as $id ) {
@ -48,7 +48,7 @@ class WC_Post_Data {
}
/**
* When a post status changes
* When a post status changes.
*/
public static function transition_post_status( $new_status, $old_status, $post ) {
if ( ( 'publish' === $new_status || 'publish' === $old_status ) && in_array( $post->post_type, array( 'product', 'product_variation' ) ) ) {
@ -78,7 +78,7 @@ class WC_Post_Data {
}
/**
* When editing a term, check for product attributes
* When editing a term, check for product attributes.
* @param id $term_id
* @param id $tt_id
* @param string $taxonomy
@ -92,7 +92,7 @@ class WC_Post_Data {
}
/**
* When a term is edited, check for product attributes and update variations
* When a term is edited, check for product attributes and update variations.
* @param id $term_id
* @param id $tt_id
* @param string $taxonomy
@ -112,7 +112,7 @@ class WC_Post_Data {
}
/**
* Ensure floats are correctly converted to strings based on PHP locale
* Ensure floats are correctly converted to strings based on PHP locale.
*
* @param null $check
* @param int $object_id
@ -137,7 +137,7 @@ class WC_Post_Data {
}
/**
* Ensure floats are correctly converted to strings based on PHP locale
* Ensure floats are correctly converted to strings based on PHP locale.
*
* @param null $check
* @param int $object_id
@ -162,7 +162,7 @@ class WC_Post_Data {
}
/**
* When setting stock level, ensure the stock status is kept in sync
* When setting stock level, ensure the stock status is kept in sync.
* @param int $meta_id
* @param int $object_id
* @param string $meta_key

View File

@ -1,8 +1,8 @@
<?php
/**
* Post Types
* Post Types.
*
* Registers post types and taxonomies
* Registers post types and taxonomies.
*
* @class WC_Post_types
* @version 2.3.0
@ -16,7 +16,7 @@ if ( ! defined( 'ABSPATH' ) ) {
}
/**
* WC_Post_types Class
* WC_Post_types Class.
*/
class WC_Post_types {
@ -488,7 +488,7 @@ class WC_Post_types {
}
/**
* Added product for Jetpack related posts
* Added product for Jetpack related posts.
*
* @param array $post_types
* @return array

View File

@ -5,7 +5,7 @@ if ( ! defined( 'ABSPATH' ) ) {
}
/**
* External Product Class
* External Product Class.
*
* External products cannot be bought; they link offsite. Extends simple products.
*
@ -49,7 +49,7 @@ class WC_Product_External extends WC_Product {
}
/**
* Get the add to cart button text for the single page
* Get the add to cart button text for the single page.
*
* @access public
* @return string
@ -59,7 +59,7 @@ class WC_Product_External extends WC_Product {
}
/**
* Get the add to cart button text
* Get the add to cart button text.
*
* @access public
* @return string

View File

@ -1,8 +1,8 @@
<?php
/**
* Product Factory Class
* Product Factory Class.
*
* The WooCommerce product factory creating the right product object
* The WooCommerce product factory creating the right product object.
*
* @class WC_Product_Factory
* @version 2.3.0
@ -36,7 +36,7 @@ class WC_Product_Factory {
}
/**
* Create a WC coding standards compliant class name e.g. WC_Product_Type_Class instead of WC_Product_type-class
* Create a WC coding standards compliant class name e.g. WC_Product_Type_Class instead of WC_Product_type-class.
* @param string $product_type
* @return string|false
*/
@ -45,7 +45,7 @@ class WC_Product_Factory {
}
/**
* Get the product class name
* Get the product class name.
* @param WP_Post $the_product
* @param array $args (default: array())
* @return string
@ -74,7 +74,7 @@ class WC_Product_Factory {
}
/**
* Get the product object
* Get the product object.
* @param mixed $the_product
* @uses WP_Post
* @return WP_Post|bool false on failure

View File

@ -5,7 +5,7 @@ if ( ! defined( 'ABSPATH' ) ) {
}
/**
* Grouped Product Class
* Grouped Product Class.
*
* Grouped products cannot be purchased - they are wrappers for other products.
*
@ -35,7 +35,7 @@ class WC_Product_Grouped extends WC_Product {
}
/**
* Get the add to cart button text
* Get the add to cart button text.
*
* @access public
* @return string

View File

@ -5,7 +5,7 @@ if ( ! defined( 'ABSPATH' ) ) {
}
/**
* Simple Product Class
* Simple Product Class.
*
* The default product type kinda product.
*
@ -40,7 +40,7 @@ class WC_Product_Simple extends WC_Product {
}
/**
* Get the add to cart button text
* Get the add to cart button text.
*
* @return string
*/

View File

@ -5,7 +5,7 @@ if ( ! defined( 'ABSPATH' ) ) {
}
/**
* Variable Product Class
* Variable Product Class.
*
* The WooCommerce product class handles individual product data.
*
@ -27,7 +27,7 @@ class WC_Product_Variable extends WC_Product {
private $prices_array = array();
/**
* Constructor
* Constructor.
*
* @param mixed $product
*/
@ -37,7 +37,7 @@ class WC_Product_Variable extends WC_Product {
}
/**
* Get the add to cart button text
* Get the add to cart button text.
*
* @access public
* @return string
@ -89,7 +89,7 @@ class WC_Product_Variable extends WC_Product {
}
/**
* Performed after a stock level change at product level
* Performed after a stock level change at product level.
*/
public function check_stock_status() {
$set_child_stock_status = '';
@ -473,7 +473,7 @@ class WC_Product_Variable extends WC_Product {
}
/**
* Check if variable product has default attributes set
* Check if variable product has default attributes set.
*
* @access public
* @return bool
@ -498,7 +498,7 @@ class WC_Product_Variable extends WC_Product {
}
/**
* Match a variation to a given set of attributes using a WP_Query
* Match a variation to a given set of attributes using a WP_Query.
* @since 2.4.0
* @param $match_attributes
* @return int Variation ID which matched, 0 is no match was found
@ -542,7 +542,7 @@ class WC_Product_Variable extends WC_Product {
/**
* Pre 2.4 handling where 'slugs' were saved instead of the full text attribute.
* Fallback is here because there are cases where data will be 'synced' but the product version will remain the same. @see WC_Product_Variable::sync_attributes
* Fallback is here because there are cases where data will be 'synced' but the product version will remain the same. @see WC_Product_Variable::sync_attributes.
*/
} elseif ( version_compare( get_post_meta( $this->id, '_product_version', true ), '2.4.0', '<' ) ) {
return $match_attributes === array_map( 'sanitize_title', $match_attributes ) ? 0 : $this->get_matching_variation( array_map( 'sanitize_title', $match_attributes ) );
@ -660,7 +660,7 @@ class WC_Product_Variable extends WC_Product {
}
/**
* Sync variable product stock status with children
* Sync variable product stock status with children.
* @param int $product_id
*/
public static function sync_stock_status( $product_id ) {
@ -687,7 +687,7 @@ class WC_Product_Variable extends WC_Product {
}
/**
* Sync the variable product's attributes with the variations
* Sync the variable product's attributes with the variations.
*/
public static function sync_attributes( $product_id, $children = false ) {
if ( ! $children ) {
@ -734,7 +734,7 @@ class WC_Product_Variable extends WC_Product {
}
/**
* Sync the variable product with it's children
* Sync the variable product with it's children.
*/
public static function sync( $product_id ) {
global $wpdb;

View File

@ -5,7 +5,7 @@ if ( ! defined( 'ABSPATH' ) ) {
}
/**
* Product Variation Class
* Product Variation Class.
*
* The WooCommerce product variation class handles product variation data.
*
@ -179,7 +179,7 @@ class WC_Product_Variation extends WC_Product {
}
/**
* Get the add to cart button text
* Get the add to cart button text.
*
* @return string
*/
@ -249,7 +249,7 @@ class WC_Product_Variation extends WC_Product {
}
/**
* Get variation ID
* Get variation ID.
*
* @return int
*/
@ -258,7 +258,7 @@ class WC_Product_Variation extends WC_Product {
}
/**
* Get variation attribute values
* Get variation attribute values.
*
* @return array of attributes and their values for this variation
*/
@ -267,7 +267,7 @@ class WC_Product_Variation extends WC_Product {
}
/**
* Check if all variation's attributes are set
* Check if all variation's attributes are set.
*
* @return boolean
*/
@ -739,7 +739,7 @@ class WC_Product_Variation extends WC_Product {
}
/**
* Get product variation description
* Get product variation description.
*
* @return string
*/

View File

@ -16,7 +16,7 @@ if ( ! defined( 'ABSPATH' ) ) {
if ( ! class_exists( 'WC_Query' ) ) :
/**
* WC_Query Class
* WC_Query Class.
*/
class WC_Query {
@ -68,7 +68,7 @@ class WC_Query {
}
/**
* Get any errors from querystring
* Get any errors from querystring.
*/
public function get_errors() {
if ( ! empty( $_GET['wc_error'] ) && ( $error = sanitize_text_field( $_GET['wc_error'] ) ) && ! wc_has_notice( $error, 'error' ) ) {
@ -97,7 +97,7 @@ class WC_Query {
}
/**
* Get page title for an endpoint
* Get page title for an endpoint.
* @param string
* @return string
*/
@ -135,7 +135,7 @@ class WC_Query {
}
/**
* Add endpoints for query vars
* Add endpoints for query vars.
*/
public function add_endpoints() {
foreach ( $this->query_vars as $key => $var ) {
@ -159,7 +159,7 @@ class WC_Query {
}
/**
* Get query vars
* Get query vars.
*
* @return array
*/
@ -168,7 +168,7 @@ class WC_Query {
}
/**
* Get query current active query var
* Get query current active query var.
*
* @return string
*/
@ -183,7 +183,7 @@ class WC_Query {
}
/**
* Parse the request and look for query vars - endpoints may not be supported
* Parse the request and look for query vars - endpoints may not be supported.
*/
public function parse_request() {
global $wp;
@ -201,7 +201,7 @@ class WC_Query {
}
/**
* Hook into pre_get_posts to do the main product query
* Hook into pre_get_posts to do the main product query.
*
* @param mixed $q query object
*/
@ -326,7 +326,7 @@ class WC_Query {
/**
* wpseo_metadesc function.
* Hooked into wpseo_ hook already, so no need for function_exist
* Hooked into wpseo_ hook already, so no need for function_exist.
*
* @access public
* @return string
@ -339,7 +339,7 @@ class WC_Query {
/**
* wpseo_metakey function.
* Hooked into wpseo_ hook already, so no need for function_exist
* Hooked into wpseo_ hook already, so no need for function_exist.
*
* @access public
* @return string
@ -350,7 +350,7 @@ class WC_Query {
/**
* Hook into the_posts to do the main product query if needed - relevanssi compatibility
* Hook into the_posts to do the main product query if needed - relevanssi compatibility.
*
* @access public
* @param array $posts
@ -406,7 +406,7 @@ class WC_Query {
/**
* Query the products, applying sorting/ordering etc. This applies to the main wordpress loop
* Query the products, applying sorting/ordering etc. This applies to the main wordpress loop.
*
* @param mixed $q
*/
@ -445,14 +445,14 @@ class WC_Query {
/**
* Remove the query
* Remove the query.
*/
public function remove_product_query() {
remove_action( 'pre_get_posts', array( $this, 'pre_get_posts' ) );
}
/**
* Remove ordering queries
* Remove ordering queries.
*/
public function remove_ordering_args() {
remove_filter( 'posts_clauses', array( $this, 'order_by_popularity_post_clauses' ) );
@ -460,7 +460,7 @@ class WC_Query {
}
/**
* Remove the posts_where filter
* Remove the posts_where filter.
*/
public function remove_posts_where() {
remove_filter( 'posts_where', array( $this, 'search_post_excerpt' ) );
@ -527,7 +527,7 @@ class WC_Query {
/**
* Returns an array of arguments for ordering products based on the selected values
* Returns an array of arguments for ordering products based on the selected values.
*
* @access public
* @return array
@ -587,7 +587,7 @@ class WC_Query {
}
/**
* WP Core doens't let us change the sort direction for invidual orderby params - http://core.trac.wordpress.org/ticket/17065
* WP Core doens't let us change the sort direction for invidual orderby params - http://core.trac.wordpress.org/ticket/17065.
*
* This lets us sort by meta value desc, and have a second orderby param.
*
@ -646,7 +646,7 @@ class WC_Query {
}
/**
* Returns a meta query to handle product visibility
* Returns a meta query to handle product visibility.
*
* @access public
* @param string $compare (default: 'IN')
@ -668,7 +668,7 @@ class WC_Query {
}
/**
* Returns a meta query to handle product stock status
* Returns a meta query to handle product stock status.
*
* @access public
* @param string $status (default: 'instock')
@ -687,7 +687,7 @@ class WC_Query {
}
/**
* Layered Nav Init
* Layered Nav Init.
*/
public function layered_nav_init( ) {
@ -724,7 +724,7 @@ class WC_Query {
}
/**
* Layered Nav post filter
* Layered Nav post filter.
*
* @param array $filtered_posts
* @return array
@ -816,7 +816,7 @@ class WC_Query {
}
/**
* Price filter Init
* Price filter Init.
*/
public function price_filter_init() {
if ( apply_filters( 'woocommerce_is_price_filter_active', is_active_widget( false, false, 'woocommerce_price_filter', true ) ) && ! is_admin() ) {
@ -838,7 +838,7 @@ class WC_Query {
}
/**
* Price Filter post filter
* Price Filter post filter.
*
* @param array $filtered_posts
* @return array

View File

@ -33,7 +33,7 @@ class WC_Session_Handler extends WC_Session {
private $_table;
/**
* Constructor for the session class
* Constructor for the session class.
*/
public function __construct() {
global $wpdb;
@ -72,11 +72,11 @@ class WC_Session_Handler extends WC_Session {
}
/**
* Sets the session cookie on-demand (usually after adding an item to the cart)
* Sets the session cookie on-demand (usually after adding an item to the cart).
*
* Since the cookie name (as of 2.1) is prepended with wp, cache systems like batcache will not cache pages when set
* Since the cookie name (as of 2.1) is prepended with wp, cache systems like batcache will not cache pages when set.
*
* Warning: Cookies will only be set if this is called before the headers are sent
* Warning: Cookies will only be set if this is called before the headers are sent.
*/
public function set_customer_session_cookie( $set ) {
if ( $set ) {
@ -92,7 +92,7 @@ class WC_Session_Handler extends WC_Session {
}
/**
* Return true if the current user has an active session, i.e. a cookie to retrieve values
* Return true if the current user has an active session, i.e. a cookie to retrieve values.
*
* @return bool
*/
@ -104,14 +104,14 @@ class WC_Session_Handler extends WC_Session {
* Set session expiration.
*/
public function set_session_expiration() {
$this->_session_expiring = time() + intval( apply_filters( 'wc_session_expiring', 60 * 60 * 47 ) ); // 47 Hours
$this->_session_expiration = time() + intval( apply_filters( 'wc_session_expiration', 60 * 60 * 48 ) ); // 48 Hours
$this->_session_expiring = time() + intval( apply_filters( 'wc_session_expiring', 60 * 60 * 47 ) ); // 47 Hours.
$this->_session_expiration = time() + intval( apply_filters( 'wc_session_expiration', 60 * 60 * 48 ) ); // 48 Hours.
}
/**
* Generate a unique customer ID for guests, or return user ID if logged in
* Generate a unique customer ID for guests, or return user ID if logged in.
*
* Uses Portable PHP password hashing framework to generate a unique cryptographically strong ID
* Uses Portable PHP password hashing framework to generate a unique cryptographically strong ID.
*
* @return int|string
*/
@ -126,7 +126,7 @@ class WC_Session_Handler extends WC_Session {
}
/**
* Get session cookie
* Get session cookie.
*
* @return bool|array
*/
@ -149,7 +149,7 @@ class WC_Session_Handler extends WC_Session {
}
/**
* Get session data
* Get session data.
*
* @return array
*/
@ -158,7 +158,7 @@ class WC_Session_Handler extends WC_Session {
}
/**
* Gets a cache prefix. This is used in session names so the entire cache can be invalidated with 1 function call
* Gets a cache prefix. This is used in session names so the entire cache can be invalidated with 1 function call.
*
* @return string
*/
@ -173,7 +173,7 @@ class WC_Session_Handler extends WC_Session {
}
/**
* Save data
* Save data.
*/
public function save_data() {
// Dirty if something changed - prevents saving nothing new
@ -223,7 +223,7 @@ class WC_Session_Handler extends WC_Session {
}
/**
* Destroy all session data
* Destroy all session data.
*/
public function destroy_session() {
// Clear cookie
@ -241,7 +241,7 @@ class WC_Session_Handler extends WC_Session {
}
/**
* When a user is logged out, ensure they have a unique nonce by using the customer/session ID
* When a user is logged out, ensure they have a unique nonce by using the customer/session ID.
*
* @return string
*/
@ -250,7 +250,7 @@ class WC_Session_Handler extends WC_Session {
}
/**
* Cleanup sessions
* Cleanup sessions.
*/
public function cleanup_sessions() {
global $wpdb;
@ -266,7 +266,7 @@ class WC_Session_Handler extends WC_Session {
}
/**
* Returns the session
* Returns the session.
*
* @param string $customer_id
* @param mixed $default
@ -296,7 +296,7 @@ class WC_Session_Handler extends WC_Session {
}
/**
* Delete the session from the cache and database
* Delete the session from the cache and database.
*
* @param int $customer_id
*/
@ -314,7 +314,7 @@ class WC_Session_Handler extends WC_Session {
}
/**
* Update the session expiry timestamp
* Update the session expiry timestamp.
*
* @param string $customer_id
* @param int $timestamp

View File

@ -5,7 +5,7 @@ if ( ! defined( 'ABSPATH' ) ) {
}
/**
* WooCommerce Shipping Rate Class
* WooCommerce Shipping Rate Class.
*
* Simple Class for storing rates.
*
@ -33,7 +33,7 @@ class WC_Shipping_Rate {
public $method_id = '';
/**
* Constructor
* Constructor.
*
* @param string $id
* @param string $label
@ -63,7 +63,7 @@ class WC_Shipping_Rate {
}
/**
* Get label
* Get label.
*
* @return string
*/

View File

@ -1,6 +1,6 @@
<?php
/**
* WooCommerce Shipping Class
* WooCommerce Shipping Class.
*
* Handles shipping and loads shipping methods via hooks.
*
@ -42,7 +42,7 @@ class WC_Shipping {
protected static $_instance = null;
/**
* Main WC_Shipping Instance
* Main WC_Shipping Instance.
*
* Ensures only one instance of WC_Shipping is loaded or can be loaded.
*
@ -217,7 +217,7 @@ class WC_Shipping {
}
/**
* Get the default method
* Get the default method.
* @param array $available_methods
* @param boolean $current_chosen_method
* @return string
@ -391,7 +391,7 @@ class WC_Shipping {
}
/**
* Get packages
* Get packages.
*
* @return array
*/
@ -438,7 +438,7 @@ class WC_Shipping {
}
/**
* Register a shipping method
* Register a shipping method.
*
* Registers a shipping method ready to be loaded. Accepts a class name (string) or a class object.
*

View File

@ -11,7 +11,7 @@
class WC_Shortcodes {
/**
* Init shortcodes
* Init shortcodes.
*/
public static function init() {
$shortcodes = array(
@ -45,7 +45,7 @@ class WC_Shortcodes {
}
/**
* Shortcode Wrapper
* Shortcode Wrapper.
*
* @param string[] $function
* @param array $atts (default: array())
@ -70,7 +70,7 @@ class WC_Shortcodes {
}
/**
* Loop over found products
* Loop over found products.
* @param array $query_args
* @param array $atts
* @param string $loop_name
@ -149,7 +149,7 @@ class WC_Shortcodes {
}
/**
* List products in a category shortcode
* List products in a category shortcode.
*
* @param array $atts
* @return string
@ -197,7 +197,7 @@ class WC_Shortcodes {
/**
* List all (or limited) product categories
* List all (or limited) product categories.
*
* @param array $atts
* @return string
@ -278,7 +278,7 @@ class WC_Shortcodes {
}
/**
* Recent Products shortcode
* Recent Products shortcode.
*
* @param array $atts
* @return string
@ -309,7 +309,7 @@ class WC_Shortcodes {
}
/**
* List multiple products shortcode
* List multiple products shortcode.
*
* @param array $atts
* @return string
@ -349,7 +349,7 @@ class WC_Shortcodes {
}
/**
* Display a single product
* Display a single product.
*
* @param array $atts
* @return string
@ -411,7 +411,7 @@ class WC_Shortcodes {
}
/**
* Display a single product price + cart button
* Display a single product price + cart button.
*
* @param array $atts
* @return string
@ -466,7 +466,7 @@ class WC_Shortcodes {
}
/**
* Get the add to cart URL for a product
* Get the add to cart URL for a product.
*
* @param array $atts
* @return string
@ -497,7 +497,7 @@ class WC_Shortcodes {
}
/**
* List all products on sale
* List all products on sale.
*
* @param array $atts
* @return string
@ -525,7 +525,7 @@ class WC_Shortcodes {
}
/**
* List best selling products on sale
* List best selling products on sale.
*
* @param array $atts
* @return string
@ -554,7 +554,7 @@ class WC_Shortcodes {
}
/**
* List top rated products on sale
* List top rated products on sale.
*
* @param array $atts
* @return string
@ -593,7 +593,7 @@ class WC_Shortcodes {
}
/**
* Output featured products
* Output featured products.
*
* @param array $atts
* @return string
@ -630,7 +630,7 @@ class WC_Shortcodes {
}
/**
* Show a single product page
* Show a single product page.
*
* @param array $atts
* @return string
@ -721,7 +721,7 @@ class WC_Shortcodes {
}
/**
* Show messages
* Show messages.
*
* @return string
*/
@ -749,8 +749,8 @@ class WC_Shortcodes {
}
/**
* List products with an attribute shortcode
* Example [product_attribute attribute='color' filter='black']
* List products with an attribute shortcode.
* Example [product_attribute attribute='color' filter='black'].
*
* @param array $atts
* @return string

View File

@ -14,7 +14,7 @@ class WC_Tax {
public static $round_at_subtotal;
/**
* Load options
* Load options.
*
* @access public
*/
@ -24,7 +24,7 @@ class WC_Tax {
}
/**
* Calculate tax for a line
* Calculate tax for a line.
* @param float $price Price to calc tax on
* @param array $rates Rates to apply
* @param boolean $price_includes_tax Whether the passed price has taxes included
@ -65,7 +65,7 @@ class WC_Tax {
}
/**
* Multiply cost by pow precision
* Multiply cost by pow precision.
* @param float $price
* @return float
*/
@ -74,7 +74,7 @@ class WC_Tax {
}
/**
* Divide cost by pow precision
* Divide cost by pow precision.
* @param float $price
* @return float
*/
@ -98,7 +98,7 @@ class WC_Tax {
}
/**
* Calc tax from inclusive price
* Calc tax from inclusive price.
*
* @param float $price
* @param array $rates
@ -142,7 +142,7 @@ class WC_Tax {
}
/**
* Calc tax from exclusive price
* Calc tax from exclusive price.
*
* @param float $price
* @param array $rates
@ -251,7 +251,7 @@ class WC_Tax {
}
/**
* Loop through a set of tax rates and get the matching rates (1 per priority)
* Loop through a set of tax rates and get the matching rates (1 per priority).
*
* @param string $country
* @param string $state
@ -327,9 +327,9 @@ class WC_Tax {
}
/**
* Get the customer tax location based on their status and the current page
* Get the customer tax location based on their status and the current page.
*
* Used by get_rates(), get_shipping_rates()
* Used by get_rates(), get_shipping_rates().
*
* @param $tax_class string Optional, passed to the filter for advanced tax setups.
* @return array
@ -393,7 +393,7 @@ class WC_Tax {
}
/**
* Alias for get_base_tax_rates()
* Alias for get_base_tax_rates().
*
* @deprecated 2.3
* @param string Tax Class
@ -535,7 +535,7 @@ class WC_Tax {
}
/**
* Get a rates code. Code is made up of COUNTRY-STATE-NAME-Priority. E.g GB-VAT-1, US-AL-TAX-1
* Get a rates code. Code is made up of COUNTRY-STATE-NAME-Priority. E.g GB-VAT-1, US-AL-TAX-1.
*
* @access public
* @param mixed $key_or_rate Tax rate ID, or the db row itself in object format
@ -577,7 +577,7 @@ class WC_Tax {
}
/**
* Get store tax classes
* Get store tax classes.
* @return array
*/
public static function get_tax_classes() {
@ -585,7 +585,7 @@ class WC_Tax {
}
/**
* format the postcodes
* format the postcodes.
* @param string $postcode
* @return string
*/
@ -594,7 +594,7 @@ class WC_Tax {
}
/**
* format the city
* format the city.
* @param string $city
* @return string
*/
@ -603,7 +603,7 @@ class WC_Tax {
}
/**
* format the state
* format the state.
* @param string $state
* @return string
*/
@ -613,7 +613,7 @@ class WC_Tax {
}
/**
* format the country
* format the country.
* @param string $country
* @return string
*/
@ -623,7 +623,7 @@ class WC_Tax {
}
/**
* format the tax rate name
* format the tax rate name.
* @param string $name
* @return string
*/
@ -632,7 +632,7 @@ class WC_Tax {
}
/**
* format the rate
* format the rate.
* @param double $rate
* @return string
*/
@ -641,7 +641,7 @@ class WC_Tax {
}
/**
* format the priority
* format the priority.
* @param string $priority
* @return int
*/
@ -650,7 +650,7 @@ class WC_Tax {
}
/**
* format the class
* format the class.
* @param string $class
* @return string
*/
@ -664,7 +664,7 @@ class WC_Tax {
}
/**
* Prepare and format tax rate for DB insertion
* Prepare and format tax rate for DB insertion.
* @param array $tax_rate
* @return array
*/
@ -678,7 +678,7 @@ class WC_Tax {
}
/**
* Insert a new tax rate
* Insert a new tax rate.
*
* Internal use only.
*
@ -700,7 +700,7 @@ class WC_Tax {
}
/**
* Get tax rate
* Get tax rate.
*
* Internal use only.
*
@ -722,7 +722,7 @@ class WC_Tax {
}
/**
* Update a tax rate
* Update a tax rate.
*
* Internal use only.
*
@ -749,7 +749,7 @@ class WC_Tax {
}
/**
* Delete a tax rate from the database
* Delete a tax rate from the database.
*
* Internal use only.
*
@ -768,7 +768,7 @@ class WC_Tax {
}
/**
* Update postcodes for a tax rate in the DB
* Update postcodes for a tax rate in the DB.
*
* Internal use only.
*
@ -790,7 +790,7 @@ class WC_Tax {
}
/**
* Update cities for a tax rate in the DB
* Update cities for a tax rate in the DB.
*
* Internal use only.
*
@ -811,7 +811,7 @@ class WC_Tax {
}
/**
* Updates locations (postcode and city)
* Updates locations (postcode and city).
*
* Internal use only.
*
@ -844,7 +844,7 @@ class WC_Tax {
}
/**
* Expands ranges in an array (used for zipcodes). e.g. 101-105 would expand to 101, 102, 103, 104, 105
* Expands ranges in an array (used for zipcodes). e.g. 101-105 would expand to 101, 102, 103, 104, 105.
*
* Internal use only.
*
@ -874,7 +874,7 @@ class WC_Tax {
}
/**
* Get postcode wildcards in array format
* Get postcode wildcards in array format.
*
* Internal use only.
*

View File

@ -1,6 +1,6 @@
<?php
/**
* Template Loader
* Template Loader.
*
* @class WC_Template
* @version 2.2.0
@ -11,7 +11,7 @@
class WC_Template_Loader {
/**
* Hook in methods
* Hook in methods.
*/
public static function init() {
add_filter( 'template_include', array( __CLASS__, 'template_loader' ) );
@ -23,11 +23,11 @@ class WC_Template_Loader {
*
* Handles template usage so that we can use our own templates instead of the themes.
*
* Templates are in the 'templates' folder. woocommerce looks for theme
* overrides in /theme/woocommerce/ by default
* Templates are in the 'templates' folder. woocommerce looks for theme.
* overrides in /theme/woocommerce/ by default.
*
* For beginners, it also looks for a woocommerce.php template first. If the user adds
* this to the theme (containing a woocommerce() inside) this will be used for all
* For beginners, it also looks for a woocommerce.php template first. If the user adds.
* this to the theme (containing a woocommerce() inside) this will be used for all.
* woocommerce templates.
*
* @param mixed $template

View File

@ -1,6 +1,6 @@
<?php
/**
* WooCommerce Tracker
* WooCommerce Tracker.
*
* The WooCommerce tracker class adds functionality to track WooCommerce usage based on if the customer opted in.
* No personal infomation is tracked, only general WooCommerce settings, general product, order and user counts and admin email for discount code.
@ -19,20 +19,20 @@ if ( ! defined( 'ABSPATH' ) ) {
class WC_Tracker {
/**
* URL to the WooThemes Tracker API endpoint
* URL to the WooThemes Tracker API endpoint.
* @var string
*/
private static $api_url = 'https://tracking.woocommerce.com/v1/';
/**
* Hook into cron event
* Hook into cron event.
*/
public static function init() {
add_action( 'woocommerce_tracker_send_event', array( __CLASS__, 'send_tracking_data' ) );
}
/**
* Decide whether to send tracking data or not
* Decide whether to send tracking data or not.
*
* @param boolean $override
*/
@ -74,7 +74,7 @@ class WC_Tracker {
}
/**
* Get the last time tracking data was sent
* Get the last time tracking data was sent.
* @return int|bool
*/
private static function get_last_send_time() {
@ -82,7 +82,7 @@ class WC_Tracker {
}
/**
* Get all the tracking data
* Get all the tracking data.
* @return array
*/
private static function get_tracking_data() {
@ -125,7 +125,7 @@ class WC_Tracker {
}
/**
* Get the current theme info, theme name and version
* Get the current theme info, theme name and version.
* @return array
*/
public static function get_theme_info() {
@ -164,7 +164,7 @@ class WC_Tracker {
}
/**
* Get server related info
* Get server related info.
* @return array
*/
private static function get_server_info() {
@ -198,7 +198,7 @@ class WC_Tracker {
}
/**
* Get all plugins grouped into activated or not
* Get all plugins grouped into activated or not.
* @return array
*/
private static function get_all_plugins() {
@ -240,7 +240,7 @@ class WC_Tracker {
}
/**
* Get user totals based on user role
* Get user totals based on user role.
* @return array
*/
private static function get_user_counts() {
@ -257,7 +257,7 @@ class WC_Tracker {
}
/**
* Get product totals based on product type
* Get product totals based on product type.
* @return array
*/
private static function get_product_counts() {
@ -274,7 +274,7 @@ class WC_Tracker {
}
/**
* Get order counts based on order status
* Get order counts based on order status.
* @return array
*/
private static function get_order_counts() {
@ -289,7 +289,7 @@ class WC_Tracker {
}
/**
* Get a list of all active payment gateways
* Get a list of all active payment gateways.
* @return array
*/
private static function get_active_payment_gateways() {
@ -305,7 +305,7 @@ class WC_Tracker {
}
/**
* Get a list of all active shipping methods
* Get a list of all active shipping methods.
* @return array
*/
private static function get_active_shipping_methods() {
@ -321,7 +321,7 @@ class WC_Tracker {
}
/**
* Get all options starting with woocommerce_ prefix
* Get all options starting with woocommerce_ prefix.
* @return array
*/
private static function get_all_woocommerce_options_values() {
@ -347,7 +347,7 @@ class WC_Tracker {
}
/**
* Look for any template override and return filenames
* Look for any template override and return filenames.
* @return array
*/
private static function get_all_template_overrides() {

View File

@ -1,6 +1,6 @@
<?php
/**
* Contains Validation functions
* Contains Validation functions.
*
* @class WC_Validation
* @version 2.4.0
@ -11,7 +11,7 @@
class WC_Validation {
/**
* Validates an email using wordpress native is_email function
* Validates an email using wordpress native is_email function.
*
* @param string email address
* @return bool
@ -21,7 +21,7 @@ class WC_Validation {
}
/**
* Validates a phone number using a regular expression
* Validates a phone number using a regular expression.
*
* @param string phone number
* @return bool
@ -35,7 +35,7 @@ class WC_Validation {
}
/**
* Checks for a valid postcode
* Checks for a valid postcode.
*
* @param string postcode
* @param string country
@ -131,7 +131,7 @@ class WC_Validation {
}
/**
* Format the postcode according to the country and length of the postcode
* Format the postcode according to the country and length of the postcode.
*
* @param string postcode
* @param string country

View File

@ -5,10 +5,10 @@ if ( ! defined( 'ABSPATH' ) ) {
}
/**
* WooCommerce Webhook class
* WooCommerce Webhook class.
*
* This class handles storing and retrieving webhook data from the associated
* `shop_webhook` custom post type, as well as delivery logs from the `webhook_delivery`
* This class handles storing and retrieving webhook data from the associated.
* `shop_webhook` custom post type, as well as delivery logs from the `webhook_delivery`.
* comment type.
*
* Webhooks are enqueued to their associated actions, delivered, and logged.
@ -24,7 +24,7 @@ class WC_Webhook {
public $id;
/**
* Setup webhook & load post data
* Setup webhook & load post data.
*
* @since 2.2
* @param string|int $id
@ -44,7 +44,7 @@ class WC_Webhook {
/**
* Magic isset as a wrapper around metadata_exists()
* Magic isset as a wrapper around metadata_exists().
*
* @since 2.2
* @param string $key
@ -59,7 +59,7 @@ class WC_Webhook {
/**
* Magic get, wraps get_post_meta() for all keys except $status
* Magic get, wraps get_post_meta() for all keys except $status.
*
* @since 2.2
* @param string $key
@ -78,7 +78,7 @@ class WC_Webhook {
/**
* Enqueue the hooks associated with the webhook
* Enqueue the hooks associated with the webhook.
*
* @since 2.2
*/
@ -95,8 +95,8 @@ class WC_Webhook {
/**
* Process the webhook for delivery by verifying that it should be delivered
* and scheduling the delivery (in the background by default, or immediately)
* Process the webhook for delivery by verifying that it should be delivered.
* and scheduling the delivery (in the background by default, or immediately).
*
* @since 2.2
* @param mixed $arg the first argument provided from the associated hooks
@ -124,7 +124,7 @@ class WC_Webhook {
}
/**
* Helper to check if the webhook should be delivered, as some hooks
* Helper to check if the webhook should be delivered, as some hooks.
* (like `wp_trash_post`) will fire for every post type, not just ours.
*
* @since 2.2
@ -176,7 +176,7 @@ class WC_Webhook {
/**
* Deliver the webhook payload using wp_safe_remote_request()
* Deliver the webhook payload using wp_safe_remote_request().
*
* @since 2.2
* @param mixed $arg first hook argument
@ -222,7 +222,7 @@ class WC_Webhook {
/**
* Build the payload data for the webhook
* Build the payload data for the webhook.
*
* @since 2.2
* @param mixed $resource_id first hook argument, typically the resource ID
@ -291,9 +291,9 @@ class WC_Webhook {
/**
* Generate a base64-encoded HMAC-SHA256 signature of the payload body so the
* recipient can verify the authenticity of the webhook. Note that the signature
* is calculated after the body has already been encoded (JSON by default)
* Generate a base64-encoded HMAC-SHA256 signature of the payload body so the.
* recipient can verify the authenticity of the webhook. Note that the signature.
* is calculated after the body has already been encoded (JSON by default).
*
* @since 2.2
* @param string $payload payload data to hash
@ -308,8 +308,8 @@ class WC_Webhook {
/**
* Create a new comment for log the delivery request/response and
* return the ID for inclusion in the webhook request
* Create a new comment for log the delivery request/response and.
* return the ID for inclusion in the webhook request.
*
* @since 2.2
* @return int delivery (comment) ID
@ -333,7 +333,7 @@ class WC_Webhook {
/**
* Log the delivery request/response
* Log the delivery request/response.
*
* @since 2.2
* @param int $delivery_id previously created comment ID
@ -399,9 +399,9 @@ class WC_Webhook {
}
/**
* Track consecutive delivery failures and automatically disable the webhook
* if more than 5 consecutive failures occur. A failure is defined as a
* non-2xx response
* Track consecutive delivery failures and automatically disable the webhook.
* if more than 5 consecutive failures occur. A failure is defined as a.
* non-2xx response.
*
* @since 2.2
*/
@ -421,7 +421,7 @@ class WC_Webhook {
/**
* Get the delivery logs for this webhook
* Get the delivery logs for this webhook.
*
* @since 2.2
* @return array
@ -494,7 +494,7 @@ class WC_Webhook {
}
/**
* Set the webhook topic and associated hooks. The topic resource & event
* Set the webhook topic and associated hooks. The topic resource & event.
* are also saved separately.
*
* @since 2.2
@ -523,7 +523,7 @@ class WC_Webhook {
}
/**
* Get the associated hook names for a topic
* Get the associated hook names for a topic.
*
* @since 2.2
* @param string $topic
@ -586,7 +586,7 @@ class WC_Webhook {
}
/**
* Send a test ping to the delivery URL, sent when the webhook is first created
* Send a test ping to the delivery URL, sent when the webhook is first created.
*
* @since 2.2
*/
@ -603,10 +603,10 @@ class WC_Webhook {
/**
* Get the webhook status:
*
* + `active` - delivers payload
* + `paused` - does not deliver payload, paused by admin
* + `disabled` - does not delivery payload, paused automatically due to
* consecutive failures
* + `active` - delivers payload.
* + `paused` - does not deliver payload, paused by admin.
* + `disabled` - does not delivery payload, paused automatically due to.
* consecutive failures.
*
* @since 2.2
* @return string status
@ -635,7 +635,7 @@ class WC_Webhook {
}
/**
* Get the webhook i18n status
* Get the webhook i18n status.
*
* @return string
*/
@ -647,7 +647,7 @@ class WC_Webhook {
}
/**
* Update the webhook status, see get_status() for valid statuses
* Update the webhook status, see get_status() for valid statuses.
*
* @since 2.2
* @param $status
@ -678,7 +678,7 @@ class WC_Webhook {
}
/**
* Set the delivery URL
* Set the delivery URL.
*
* @since 2.2
* @param string $url
@ -689,7 +689,7 @@ class WC_Webhook {
}
/**
* Get the delivery URL
* Get the delivery URL.
*
* @since 2.2
* @return string
@ -700,7 +700,7 @@ class WC_Webhook {
}
/**
* Set the secret used for generating the HMAC-SHA256 signature
* Set the secret used for generating the HMAC-SHA256 signature.
*
* @since 2.2
* @param string $secret
@ -711,7 +711,7 @@ class WC_Webhook {
}
/**
* Get the secret used for generating the HMAC-SHA256 signature
* Get the secret used for generating the HMAC-SHA256 signature.
*
* @since 2.2
* @return string
@ -721,7 +721,7 @@ class WC_Webhook {
}
/**
* Get the friendly name for the webhook
* Get the friendly name for the webhook.
*
* @since 2.2
* @return string
@ -731,7 +731,7 @@ class WC_Webhook {
}
/**
* Get the webhook topic, e.g. `order.created`
* Get the webhook topic, e.g. `order.created`.
*
* @since 2.2
* @return string
@ -741,7 +741,7 @@ class WC_Webhook {
}
/**
* Get the hook names for the webhook
* Get the hook names for the webhook.
*
* @since 2.2
* @return array hook names
@ -751,7 +751,7 @@ class WC_Webhook {
}
/**
* Get the resource for the webhook, e.g. `order`
* Get the resource for the webhook, e.g. `order`.
*
* @since 2.2
* @return string
@ -761,7 +761,7 @@ class WC_Webhook {
}
/**
* Get the event for the webhook, e.g. `created`
* Get the event for the webhook, e.g. `created`.
*
* @since 2.2
* @return string
@ -771,7 +771,7 @@ class WC_Webhook {
}
/**
* Get the failure count
* Get the failure count.
*
* @since 2.2
* @return int
@ -781,7 +781,7 @@ class WC_Webhook {
}
/**
* Get the user ID for this webhook
* Get the user ID for this webhook.
*
* @since 2.2
* @return int|string user ID
@ -791,7 +791,7 @@ class WC_Webhook {
}
/**
* Get the post data for the webhook
* Get the post data for the webhook.
*
* @since 2.2
* @return null|WP_Post

View File

@ -7,7 +7,7 @@ if ( ! defined( 'ABSPATH' ) ) {
if ( ! class_exists( 'WC_Email_Cancelled_Order' ) ) :
/**
* Cancelled Order Email
* Cancelled Order Email.
*
* An email sent to the admin when an order is cancelled.
*
@ -20,7 +20,7 @@ if ( ! class_exists( 'WC_Email_Cancelled_Order' ) ) :
class WC_Email_Cancelled_Order extends WC_Email {
/**
* Constructor
* Constructor.
*/
function __construct() {

View File

@ -7,7 +7,7 @@ if ( ! defined( 'ABSPATH' ) ) {
if ( ! class_exists( 'WC_Email_Customer_Completed_Order' ) ) :
/**
* Customer Completed Order Email
* Customer Completed Order Email.
*
* Order complete emails are sent to the customer when the order is marked complete and usual indicates that the order has been shipped.
*
@ -20,7 +20,7 @@ if ( ! class_exists( 'WC_Email_Customer_Completed_Order' ) ) :
class WC_Email_Customer_Completed_Order extends WC_Email {
/**
* Constructor
* Constructor.
*/
function __construct() {

View File

@ -7,7 +7,7 @@ if ( ! defined( 'ABSPATH' ) ) {
if ( ! class_exists( 'WC_Email_Customer_Invoice' ) ) :
/**
* Customer Invoice
* Customer Invoice.
*
* An email sent to the customer via admin.
*
@ -23,7 +23,7 @@ class WC_Email_Customer_Invoice extends WC_Email {
public $replace;
/**
* Constructor
* Constructor.
*/
function __construct() {
@ -138,7 +138,7 @@ class WC_Email_Customer_Invoice extends WC_Email {
}
/**
* Initialise settings form fields
* Initialise settings form fields.
*/
function init_form_fields() {
$this->form_fields = array(

View File

@ -7,7 +7,7 @@ if ( ! defined( 'ABSPATH' ) ) {
if ( ! class_exists( 'WC_Email_Customer_New_Account' ) ) :
/**
* Customer New Account
* Customer New Account.
*
* An email sent to the customer when they create an account.
*
@ -25,7 +25,7 @@ class WC_Email_Customer_New_Account extends WC_Email {
public $password_generated;
/**
* Constructor
* Constructor.
*/
function __construct() {

View File

@ -7,7 +7,7 @@ if ( ! defined( 'ABSPATH' ) ) {
if ( ! class_exists( 'WC_Email_Customer_Note' ) ) :
/**
* Customer Note Order Email
* Customer Note Order Email.
*
* Customer note emails are sent when you add a note to an order.
*
@ -22,7 +22,7 @@ class WC_Email_Customer_Note extends WC_Email {
public $customer_note;
/**
* Constructor
* Constructor.
*/
function __construct() {

View File

@ -7,7 +7,7 @@ if ( ! defined( 'ABSPATH' ) ) {
if ( ! class_exists( 'WC_Email_Customer_Processing_Order' ) ) :
/**
* Customer Processing Order Email
* Customer Processing Order Email.
*
* An email sent to the customer when a new order is received/paid for.
*
@ -20,7 +20,7 @@ if ( ! class_exists( 'WC_Email_Customer_Processing_Order' ) ) :
class WC_Email_Customer_Processing_Order extends WC_Email {
/**
* Constructor
* Constructor.
*/
function __construct() {

View File

@ -7,7 +7,7 @@ if ( ! defined( 'ABSPATH' ) ) {
if ( ! class_exists( 'WC_Email_Customer_Refunded_Order' ) ) :
/**
* Customer Refunded Order Email
* Customer Refunded Order Email.
*
* Order refunded emails are sent to the customer when the order is marked refunded.
*
@ -18,12 +18,12 @@ if ( ! class_exists( 'WC_Email_Customer_Refunded_Order' ) ) :
* @extends WC_Email
*/
class WC_Email_Customer_Refunded_Order extends WC_Email {
public $refund;
public $partial_refund;
/**
* Constructor
* Constructor.
*/
public function __construct() {
$this->set_email_strings();
@ -64,14 +64,14 @@ class WC_Email_Customer_Refunded_Order extends WC_Email {
}
/**
* Full refund notification
* Full refund notification.
*/
public function trigger_full( $order_id, $refund_id = null ) {
$this->trigger( $order_id, false, $refund_id );
}
/**
* Partial refund notification
* Partial refund notification.
*/
public function trigger_partial( $order_id, $refund_id = null ) {
$this->trigger( $order_id, true, $refund_id );

View File

@ -7,7 +7,7 @@ if ( ! defined( 'ABSPATH' ) ) {
if ( ! class_exists( 'WC_Email_Customer_Reset_Password' ) ) :
/**
* Customer Reset Password
* Customer Reset Password.
*
* An email sent to the customer when they reset their password.
*
@ -29,7 +29,7 @@ class WC_Email_Customer_Reset_Password extends WC_Email {
public $reset_key;
/**
* Constructor
* Constructor.
*/
function __construct() {

View File

@ -7,7 +7,7 @@ if ( ! defined( 'ABSPATH' ) ) {
if ( ! class_exists( 'WC_Email_New_Order' ) ) :
/**
* New Order Email
* New Order Email.
*
* An email sent to the admin when a new order is received/paid for.
*
@ -20,7 +20,7 @@ if ( ! class_exists( 'WC_Email_New_Order' ) ) :
class WC_Email_New_Order extends WC_Email {
/**
* Constructor
* Constructor.
*/
function __construct() {
@ -110,7 +110,7 @@ class WC_Email_New_Order extends WC_Email {
}
/**
* Initialise settings form fields
* Initialise settings form fields.
*/
function init_form_fields() {
$this->form_fields = array(

View File

@ -1,9 +1,9 @@
<?php
/**
* Email Class
* Email Class.
*
* WooCommerce Email Class which is extended by specific email template classes to add emails to WooCommerce
* WooCommerce Email Class which is extended by specific email template classes to add emails to WooCommerce.
*
* @class WC_Email
* @version 2.0.0
@ -20,7 +20,7 @@ if ( class_exists( 'WC_Email' ) ) {
}
/**
* WC_Email
* WC_Email.
*/
class WC_Email extends WC_Settings_API {
@ -137,12 +137,12 @@ class WC_Email extends WC_Settings_API {
public $sending;
/**
* List of preg* regular expression patterns to search for,
* used in conjunction with $replace.
* https://raw.github.com/ushahidi/wp-silcc/master/class.html2text.inc
* List of preg* regular expression patterns to search for,
* used in conjunction with $replace.
* https://raw.github.com/ushahidi/wp-silcc/master/class.html2text.inc.
*
* @var array $search
* @see $replace
* @var array $search
* @see $replace
*/
public $plain_search = array(
"/\r/", // Non-legal carriage return
@ -168,10 +168,10 @@ class WC_Email extends WC_Settings_API {
);
/**
* List of pattern replacements corresponding to patterns searched.
* List of pattern replacements corresponding to patterns searched.
*
* @var array $replace
* @see $search
* @var array $replace
* @see $search
*/
public $plain_replace = array(
'', // Non-legal carriage return
@ -197,7 +197,7 @@ class WC_Email extends WC_Settings_API {
);
/**
* Constructor
* Constructor.
*/
public function __construct() {
@ -500,7 +500,7 @@ class WC_Email extends WC_Settings_API {
}
/**
* Email type options
* Email type options.
*
* @return array
*/
@ -518,8 +518,8 @@ class WC_Email extends WC_Settings_API {
}
/**
* Admin Panel Options Processing
* - Saves the options to the DB
* Admin Panel Options Processing.
* - Saves the options to the DB.
*
* @since 1.0.0
* @return boolean|null
@ -558,7 +558,7 @@ class WC_Email extends WC_Settings_API {
}
/**
* Save the email templates
* Save the email templates.
*
* @since 2.4.0
* @param string $template_code
@ -622,7 +622,7 @@ class WC_Email extends WC_Settings_API {
copy( $template_file, $theme_file );
/**
* woocommerce_copy_email_template action hook
* woocommerce_copy_email_template action hook.
*
* @param string $template_type The copied template type
* @param string $email The email object
@ -651,7 +651,7 @@ class WC_Email extends WC_Settings_API {
unlink( $theme_file );
/**
* woocommerce_delete_email_template action hook
* woocommerce_delete_email_template action hook.
*
* @param string $template The deleted template type
* @param string $email The email object
@ -693,7 +693,7 @@ class WC_Email extends WC_Settings_API {
}
/**
* Admin Options
* Admin Options.
*
* Setup the email settings screen.
* Override this in your email.
@ -711,7 +711,7 @@ class WC_Email extends WC_Settings_API {
<?php
/**
* woocommerce_email_settings_before action hook
* woocommerce_email_settings_before action hook.
*
* @param string $email The email object
*/
@ -724,7 +724,7 @@ class WC_Email extends WC_Settings_API {
<?php
/**
* woocommerce_email_settings_after action hook
* woocommerce_email_settings_after action hook.
*
* @param string $email The email object
*/

View File

@ -5,7 +5,7 @@ if ( ! defined( 'ABSPATH' ) ) {
}
/**
* Bank Transfer Payment Gateway
* Bank Transfer Payment Gateway.
*
* Provides a Bank Transfer Payment Gateway. Based on code by Mike Pepper.
*
@ -65,7 +65,7 @@ class WC_Gateway_BACS extends WC_Payment_Gateway {
}
/**
* Initialise Gateway Settings Form Fields
* Initialise Gateway Settings Form Fields.
*/
public function init_form_fields() {
@ -187,7 +187,7 @@ class WC_Gateway_BACS extends WC_Payment_Gateway {
}
/**
* Save account details table
* Save account details table.
*/
public function save_account_details() {
@ -253,7 +253,7 @@ class WC_Gateway_BACS extends WC_Payment_Gateway {
}
/**
* Get bank details and place into a list format
* Get bank details and place into a list format.
*/
private function bank_details( $order_id = '' ) {
@ -275,7 +275,7 @@ class WC_Gateway_BACS extends WC_Payment_Gateway {
if ( ! empty( $bacs_accounts ) ) {
echo '<h2>' . __( 'Our Bank Details', 'woocommerce' ) . '</h2>' . PHP_EOL;
foreach ( $bacs_accounts as $bacs_account ) {
$bacs_account = (object) $bacs_account;
@ -319,7 +319,7 @@ class WC_Gateway_BACS extends WC_Payment_Gateway {
}
/**
* Process the payment and return the result
* Process the payment and return the result.
*
* @param int $order_id
* @return array
@ -346,7 +346,7 @@ class WC_Gateway_BACS extends WC_Payment_Gateway {
}
/**
* Get country locale if localized
* Get country locale if localized.
*
* @return array
*/

View File

@ -5,7 +5,7 @@ if ( ! defined( 'ABSPATH' ) ) {
}
/**
* Cheque Payment Gateway
* Cheque Payment Gateway.
*
* Provides a Cheque Payment Gateway, mainly for testing purposes.
*
@ -45,7 +45,7 @@ class WC_Gateway_Cheque extends WC_Payment_Gateway {
}
/**
* Initialise Gateway Settings Form Fields
* Initialise Gateway Settings Form Fields.
*/
public function init_form_fields() {
@ -103,7 +103,7 @@ class WC_Gateway_Cheque extends WC_Payment_Gateway {
}
/**
* Process the payment and return the result
* Process the payment and return the result.
*
* @param int $order_id
* @return array

View File

@ -5,7 +5,7 @@ if ( ! defined( 'ABSPATH' ) ) {
}
/**
* Cash on Delivery Gateway
* Cash on Delivery Gateway.
*
* Provides a Cash on Delivery Payment Gateway.
*
@ -46,7 +46,7 @@ class WC_Gateway_COD extends WC_Payment_Gateway {
}
/**
* Initialise Gateway Settings Form Fields
* Initialise Gateway Settings Form Fields.
*/
public function init_form_fields() {
$shipping_methods = array();
@ -108,7 +108,7 @@ class WC_Gateway_COD extends WC_Payment_Gateway {
}
/**
* Check If The Gateway Is Available For Use
* Check If The Gateway Is Available For Use.
*
* @return bool
*/
@ -190,7 +190,7 @@ class WC_Gateway_COD extends WC_Payment_Gateway {
/**
* Process the payment and return the result
* Process the payment and return the result.
*
* @param int $order_id
* @return array

View File

@ -5,7 +5,7 @@ if ( ! defined( 'ABSPATH' ) ) {
}
/**
* PayPal Standard Payment Gateway
* PayPal Standard Payment Gateway.
*
* Provides a PayPal Standard Payment Gateway.
*
@ -68,7 +68,7 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
}
/**
* Logging method
* Logging method.
* @param string $message
*/
public static function log( $message ) {
@ -99,7 +99,7 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
}
/**
* Get the link for an icon based on country
* Get the link for an icon based on country.
* @param string $country
* @return string
*/
@ -114,7 +114,7 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
}
/**
* Get PayPal images for a country
* Get PayPal images for a country.
* @param string $country
* @return array of image URLs
*/
@ -180,7 +180,7 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
}
/**
* Check if this gateway is enabled and available in the user's country
* Check if this gateway is enabled and available in the user's country.
*
* @return bool
*/
@ -189,8 +189,8 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
}
/**
* Admin Panel Options
* - Options for bits like 'title' and availability on a country-by-country basis
* Admin Panel Options.
* - Options for bits like 'title' and availability on a country-by-country basis.
*
* @since 1.0.0
*/
@ -205,7 +205,7 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
}
/**
* Initialise Gateway Settings Form Fields
* Initialise Gateway Settings Form Fields.
*/
public function init_form_fields() {
$this->form_fields = include( 'includes/settings-paypal.php' );
@ -228,7 +228,7 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
}
/**
* Process the payment and return the result
* Process the payment and return the result.
*
* @param int $order_id
* @return array
@ -255,7 +255,7 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
}
/**
* Process a refund if supported
* Process a refund if supported.
* @param int $order_id
* @param float $amount
* @param string $reason

View File

@ -7,7 +7,7 @@ if ( ! defined( 'ABSPATH' ) ) {
include_once( 'class-wc-gateway-paypal-response.php' );
/**
* Handles responses from PayPal IPN
* Handles responses from PayPal IPN.
*/
class WC_Gateway_Paypal_IPN_Handler extends WC_Gateway_Paypal_Response {
@ -15,7 +15,7 @@ class WC_Gateway_Paypal_IPN_Handler extends WC_Gateway_Paypal_Response {
protected $receiver_email;
/**
* Constructor
* Constructor.
*/
public function __construct( $sandbox = false, $receiver_email = '' ) {
add_action( 'woocommerce_api_wc_gateway_paypal', array( $this, 'check_response' ) );
@ -26,7 +26,7 @@ class WC_Gateway_Paypal_IPN_Handler extends WC_Gateway_Paypal_Response {
}
/**
* Check for PayPal IPN Response
* Check for PayPal IPN Response.
*/
public function check_response() {
if ( ! empty( $_POST ) && $this->validate_ipn() ) {
@ -39,7 +39,7 @@ class WC_Gateway_Paypal_IPN_Handler extends WC_Gateway_Paypal_Response {
}
/**
* There was a valid response
* There was a valid response.
* @param array $posted Post data after wp_unslash
*/
public function valid_response( $posted ) {
@ -63,7 +63,7 @@ class WC_Gateway_Paypal_IPN_Handler extends WC_Gateway_Paypal_Response {
}
/**
* Check PayPal IPN validity
* Check PayPal IPN validity.
*/
public function validate_ipn() {
WC_Gateway_Paypal::log( 'Checking IPN response is valid' );
@ -104,7 +104,7 @@ class WC_Gateway_Paypal_IPN_Handler extends WC_Gateway_Paypal_Response {
}
/**
* Check for a valid transaction type
* Check for a valid transaction type.
* @param string $txn_type
*/
protected function validate_transaction_type( $txn_type ) {
@ -117,7 +117,7 @@ class WC_Gateway_Paypal_IPN_Handler extends WC_Gateway_Paypal_Response {
}
/**
* Check currency from IPN matches the order
* Check currency from IPN matches the order.
* @param WC_Order $order
* @param string $currency
*/
@ -133,7 +133,7 @@ class WC_Gateway_Paypal_IPN_Handler extends WC_Gateway_Paypal_Response {
}
/**
* Check payment amount from IPN matches the order
* Check payment amount from IPN matches the order.
* @param WC_Order $order
*/
protected function validate_amount( $order, $amount ) {
@ -147,8 +147,8 @@ class WC_Gateway_Paypal_IPN_Handler extends WC_Gateway_Paypal_Response {
}
/**
* Check receiver email from PayPal. If the receiver email in the IPN is different than what is stored in
* WooCommerce -> Settings -> Checkout -> PayPal, it will log an error about it
* Check receiver email from PayPal. If the receiver email in the IPN is different than what is stored in.
* WooCommerce -> Settings -> Checkout -> PayPal, it will log an error about it.
* @param WC_Order $order
*/
protected function validate_receiver_email( $order, $receiver_email ) {
@ -163,7 +163,7 @@ class WC_Gateway_Paypal_IPN_Handler extends WC_Gateway_Paypal_Response {
}
/**
* Handle a completed payment
* Handle a completed payment.
* @param WC_Order $order
*/
protected function payment_status_completed( $order, $posted ) {
@ -192,7 +192,7 @@ class WC_Gateway_Paypal_IPN_Handler extends WC_Gateway_Paypal_Response {
}
/**
* Handle a pending payment
* Handle a pending payment.
* @param WC_Order $order
*/
protected function payment_status_pending( $order, $posted ) {
@ -200,7 +200,7 @@ class WC_Gateway_Paypal_IPN_Handler extends WC_Gateway_Paypal_Response {
}
/**
* Handle a failed payment
* Handle a failed payment.
* @param WC_Order $order
*/
protected function payment_status_failed( $order, $posted ) {
@ -208,7 +208,7 @@ class WC_Gateway_Paypal_IPN_Handler extends WC_Gateway_Paypal_Response {
}
/**
* Handle a denied payment
* Handle a denied payment.
* @param WC_Order $order
*/
protected function payment_status_denied( $order, $posted ) {
@ -216,7 +216,7 @@ class WC_Gateway_Paypal_IPN_Handler extends WC_Gateway_Paypal_Response {
}
/**
* Handle an expired payment
* Handle an expired payment.
* @param WC_Order $order
*/
protected function payment_status_expired( $order, $posted ) {
@ -224,7 +224,7 @@ class WC_Gateway_Paypal_IPN_Handler extends WC_Gateway_Paypal_Response {
}
/**
* Handle a voided payment
* Handle a voided payment.
* @param WC_Order $order
*/
protected function payment_status_voided( $order, $posted ) {
@ -232,7 +232,7 @@ class WC_Gateway_Paypal_IPN_Handler extends WC_Gateway_Paypal_Response {
}
/**
* Handle a refunded order
* Handle a refunded order.
* @param WC_Order $order
*/
protected function payment_status_refunded( $order, $posted ) {
@ -250,7 +250,7 @@ class WC_Gateway_Paypal_IPN_Handler extends WC_Gateway_Paypal_Response {
}
/**
* Handle a reveral
* Handle a reveral.
* @param WC_Order $order
*/
protected function payment_status_reversed( $order, $posted ) {
@ -263,7 +263,7 @@ class WC_Gateway_Paypal_IPN_Handler extends WC_Gateway_Paypal_Response {
}
/**
* Handle a cancelled reveral
* Handle a cancelled reveral.
* @param WC_Order $order
*/
protected function payment_status_canceled_reversal( $order, $posted ) {
@ -274,7 +274,7 @@ class WC_Gateway_Paypal_IPN_Handler extends WC_Gateway_Paypal_Response {
}
/**
* Save important data from the IPN to the order
* Save important data from the IPN to the order.
* @param WC_Order $order
*/
protected function save_paypal_meta_data( $order, $posted ) {

View File

@ -7,7 +7,7 @@ if ( ! defined( 'ABSPATH' ) ) {
include_once( 'class-wc-gateway-paypal-response.php' );
/**
* Handle PDT Responses from PayPal
* Handle PDT Responses from PayPal.
*/
class WC_Gateway_Paypal_PDT_Handler extends WC_Gateway_Paypal_Response {
@ -15,7 +15,7 @@ class WC_Gateway_Paypal_PDT_Handler extends WC_Gateway_Paypal_Response {
protected $identity_token;
/**
* Constructor
* Constructor.
*/
public function __construct( $sandbox = false, $identity_token = '' ) {
add_action( 'woocommerce_thankyou_paypal', array( $this, 'check_response' ) );
@ -25,7 +25,7 @@ class WC_Gateway_Paypal_PDT_Handler extends WC_Gateway_Paypal_Response {
}
/**
* Validate a PDT transaction to ensure its authentic
* Validate a PDT transaction to ensure its authentic.
* @param string $transaction
* @return bool
*/
@ -52,7 +52,7 @@ class WC_Gateway_Paypal_PDT_Handler extends WC_Gateway_Paypal_Response {
}
/**
* Check Response for PDT
* Check Response for PDT.
*/
public function check_response() {
if ( empty( $_REQUEST['cm'] ) || empty( $_REQUEST['tx'] ) || empty( $_REQUEST['st'] ) ) {

View File

@ -5,7 +5,7 @@ if ( ! defined( 'ABSPATH' ) ) {
}
/**
* Handles refunds
* Handles refunds.
*/
class WC_Gateway_Paypal_Refund {
@ -19,7 +19,7 @@ class WC_Gateway_Paypal_Refund {
public static $api_signature;
/**
* Get refund request args
* Get refund request args.
* @param WC_Order $order
* @param float $amount
* @param string $reason
@ -45,7 +45,7 @@ class WC_Gateway_Paypal_Refund {
}
/**
* Refund an order via PayPal
* Refund an order via PayPal.
* @param WC_Order $order
* @param float $amount
* @param string $reason

View File

@ -5,30 +5,30 @@ if ( ! defined( 'ABSPATH' ) ) {
}
/**
* Generates requests to send to PayPal
* Generates requests to send to PayPal.
*/
class WC_Gateway_Paypal_Request {
/**
* Stores line items to send to PayPal
* Stores line items to send to PayPal.
* @var array
*/
protected $line_items = array();
/**
* Pointer to gateway making the request
* Pointer to gateway making the request.
* @var WC_Gateway_Paypal
*/
protected $gateway;
/**
* Endpoint for requests from PayPal
* Endpoint for requests from PayPal.
* @var string
*/
protected $notify_url;
/**
* Constructor
* Constructor.
* @param WC_Gateway_Paypal $gateway
*/
public function __construct( $gateway ) {
@ -37,7 +37,7 @@ class WC_Gateway_Paypal_Request {
}
/**
* Get the PayPal request URL for an order
* Get the PayPal request URL for an order.
* @param WC_Order $order
* @param boolean $sandbox
* @return string
@ -53,7 +53,7 @@ class WC_Gateway_Paypal_Request {
}
/**
* Get PayPal Args for passing to PP
* Get PayPal Args for passing to PP.
*
* @param WC_Order $order
* @return array
@ -96,7 +96,7 @@ class WC_Gateway_Paypal_Request {
}
/**
* Get phone number args for paypal request
* Get phone number args for paypal request.
* @param WC_Order $order
* @return array
*/
@ -122,7 +122,7 @@ class WC_Gateway_Paypal_Request {
}
/**
* Get shipping args for paypal request
* Get shipping args for paypal request.
* @param WC_Order $order
* @return array
*/
@ -151,14 +151,14 @@ class WC_Gateway_Paypal_Request {
}
/**
* Get line item args for paypal request
* Get line item args for paypal request.
* @param WC_Order $order
* @return array
*/
protected function get_line_item_args( $order ) {
/**
* Try passing a line item per product if supported
* Try passing a line item per product if supported.
*/
if ( ( ! wc_tax_enabled() || ! wc_prices_include_tax() ) && $this->prepare_line_items( $order ) ) {
@ -170,9 +170,9 @@ class WC_Gateway_Paypal_Request {
}
/**
* Send order as a single item
* Send order as a single item.
*
* For shipping, we longer use shipping_1 because paypal ignores it if *any* shipping rules are within paypal, and paypal ignores anything over 5 digits (999.99 is the max)
* For shipping, we longer use shipping_1 because paypal ignores it if *any* shipping rules are within paypal, and paypal ignores anything over 5 digits (999.99 is the max).
*/
} else {
@ -189,7 +189,7 @@ class WC_Gateway_Paypal_Request {
}
/**
* Get order item names as a string
* Get order item names as a string.
* @param WC_Order $order
* @return string
*/
@ -204,7 +204,7 @@ class WC_Gateway_Paypal_Request {
}
/**
* Get order item names as a string
* Get order item names as a string.
* @param WC_Order $order
* @param array $item
* @return string
@ -221,21 +221,21 @@ class WC_Gateway_Paypal_Request {
}
/**
* Return all line items
* Return all line items.
*/
protected function get_line_items() {
return $this->line_items;
}
/**
* Remove all line items
* Remove all line items.
*/
protected function delete_line_items() {
$this->line_items = array();
}
/**
* Get line items to send to paypal
* Get line items to send to paypal.
*
* @param WC_Order $order
* @return bool
@ -276,7 +276,7 @@ class WC_Gateway_Paypal_Request {
}
/**
* Add PayPal Line Item
* Add PayPal Line Item.
* @param string $item_name
* @param integer $quantity
* @param integer $amount
@ -299,7 +299,7 @@ class WC_Gateway_Paypal_Request {
}
/**
* Get the state to send to paypal
* Get the state to send to paypal.
* @param string $cc
* @param string $state
* @return string
@ -319,7 +319,7 @@ class WC_Gateway_Paypal_Request {
}
/**
* Check if currency has decimals
* Check if currency has decimals.
*
* @param string $currency
*
@ -334,7 +334,7 @@ class WC_Gateway_Paypal_Request {
}
/**
* Round prices
* Round prices.
*
* @param float|int $price
* @param WC_Order $order
@ -352,7 +352,7 @@ class WC_Gateway_Paypal_Request {
}
/**
* Format prices
* Format prices.
*
* @param float|int $price
* @param WC_Order $order

View File

@ -5,7 +5,7 @@ if ( ! defined( 'ABSPATH' ) ) {
}
/**
* Handles refunds
* Handles refunds.
*/
abstract class WC_Gateway_Paypal_Response {
@ -13,7 +13,7 @@ abstract class WC_Gateway_Paypal_Response {
protected $sandbox = false;
/**
* Get the order from the PayPal 'Custom' variable
* Get the order from the PayPal 'Custom' variable.
*
* @param string $raw_custom JSON Data passed back by PayPal
* @return bool|WC_Order object
@ -50,7 +50,7 @@ abstract class WC_Gateway_Paypal_Response {
}
/**
* Complete order, add transaction ID and note
* Complete order, add transaction ID and note.
* @param WC_Order $order
* @param string $txn_id
* @param string $note
@ -61,7 +61,7 @@ abstract class WC_Gateway_Paypal_Response {
}
/**
* Hold order and add note
* Hold order and add note.
* @param WC_Order $order
* @param string $reason
*/

View File

@ -5,7 +5,7 @@ if ( ! defined( 'ABSPATH' ) ) {
}
/**
* Settings for PayPal Gateway
* Settings for PayPal Gateway.
*/
return array(
'enabled' => array(

View File

@ -5,7 +5,7 @@ if ( ! defined( 'ABSPATH' ) ) {
}
/**
* Simplify Commerce Gateway for Subscriptions < 2.0
* Simplify Commerce Gateway for Subscriptions < 2.0.
*
* @class WC_Addons_Gateway_Simplify_Commerce_Deprecated
* @extends WC_Addons_Gateway_Simplify_Commerce
@ -17,7 +17,7 @@ if ( ! defined( 'ABSPATH' ) ) {
class WC_Addons_Gateway_Simplify_Commerce_Deprecated extends WC_Addons_Gateway_Simplify_Commerce {
/**
* Constructor
* Constructor.
*/
public function __construct() {
parent::__construct();
@ -30,7 +30,7 @@ class WC_Addons_Gateway_Simplify_Commerce_Deprecated extends WC_Addons_Gateway_S
}
/**
* Store the customer and card IDs on the order and subscriptions in the order
* Store the customer and card IDs on the order and subscriptions in the order.
*
* @param int $order_id
* @param string $customer_id
@ -73,7 +73,7 @@ class WC_Addons_Gateway_Simplify_Commerce_Deprecated extends WC_Addons_Gateway_S
try {
// Charge the customer
$payment = Simplify_Payment::createPayment( array(
'amount' => $amount * 100, // In cents
'amount' => $amount * 100, // In cents.
'customer' => $customer_id,
'description' => trim( substr( $subscription_name, 0, 1024 ) ),
'currency' => strtoupper( get_woocommerce_currency() ),
@ -162,7 +162,7 @@ class WC_Addons_Gateway_Simplify_Commerce_Deprecated extends WC_Addons_Gateway_S
}
/**
* Update the customer_id for a subscription after using Simplify to complete a payment to make up for
* Update the customer_id for a subscription after using Simplify to complete a payment to make up for.
* an automatic renewal payment which previously failed.
*
* @param WC_Order $original_order The original order in which the subscription was purchased.

View File

@ -5,7 +5,7 @@ if ( ! defined( 'ABSPATH' ) ) {
}
/**
* Simplify Commerce Gateway for subscriptions
* Simplify Commerce Gateway for subscriptions.
*
* @class WC_Addons_Gateway_Simplify_Commerce
* @extends WC_Gateway_Simplify_Commerce
@ -17,7 +17,7 @@ if ( ! defined( 'ABSPATH' ) ) {
class WC_Addons_Gateway_Simplify_Commerce extends WC_Gateway_Simplify_Commerce {
/**
* Constructor
* Constructor.
*/
public function __construct() {
parent::__construct();
@ -42,7 +42,7 @@ class WC_Addons_Gateway_Simplify_Commerce extends WC_Gateway_Simplify_Commerce {
}
/**
* Hosted payment args
* Hosted payment args.
*
* @param array $args
* @param int $order_id
@ -79,7 +79,7 @@ class WC_Addons_Gateway_Simplify_Commerce extends WC_Gateway_Simplify_Commerce {
}
/**
* Process the subscription
* Process the subscription.
*
* @param WC_Order $order
* @param string $cart_token
@ -147,7 +147,7 @@ class WC_Addons_Gateway_Simplify_Commerce extends WC_Gateway_Simplify_Commerce {
}
/**
* Store the customer and card IDs on the order and subscriptions in the order
* Store the customer and card IDs on the order and subscriptions in the order.
*
* @param int $order_id
* @param string $customer_id
@ -165,7 +165,7 @@ class WC_Addons_Gateway_Simplify_Commerce extends WC_Gateway_Simplify_Commerce {
}
/**
* Process the pre-order
* Process the pre-order.
*
* @param WC_Order $order
* @param string $cart_token
@ -248,7 +248,7 @@ class WC_Addons_Gateway_Simplify_Commerce extends WC_Gateway_Simplify_Commerce {
}
/**
* Process the payment
* Process the payment.
*
* @param int $order_id
* @return array
@ -300,7 +300,7 @@ class WC_Addons_Gateway_Simplify_Commerce extends WC_Gateway_Simplify_Commerce {
try {
// Charge the customer
$payment = Simplify_Payment::createPayment( array(
'amount' => $amount * 100, // In cents
'amount' => $amount * 100, // In cents.
'customer' => $customer_id,
'description' => sprintf( __( '%s - Order #%s', 'woocommerce' ), esc_html( get_bloginfo( 'name', 'display' ) ), $order->get_order_number() ),
'currency' => strtoupper( get_woocommerce_currency() ),
@ -359,7 +359,7 @@ class WC_Addons_Gateway_Simplify_Commerce extends WC_Gateway_Simplify_Commerce {
}
/**
* Update the customer_id for a subscription after using Simplify to complete a payment to make up for
* Update the customer_id for a subscription after using Simplify to complete a payment to make up for.
* an automatic renewal payment which previously failed.
*
* @param WC_Subscription $subscription The subscription for which the failing payment method relates.
@ -370,7 +370,7 @@ class WC_Addons_Gateway_Simplify_Commerce extends WC_Gateway_Simplify_Commerce {
}
/**
* Include the payment meta data required to process automatic recurring payments so that store managers can
* Include the payment meta data required to process automatic recurring payments so that store managers can.
* manually set up automatic recurring payments for a customer via the Edit Subscription screen in Subscriptions v2.0+.
*
* @since 2.4
@ -393,7 +393,7 @@ class WC_Addons_Gateway_Simplify_Commerce extends WC_Gateway_Simplify_Commerce {
}
/**
* Validate the payment meta data required to process automatic recurring payments so that store managers can
* Validate the payment meta data required to process automatic recurring payments so that store managers can.
* manually set up automatic recurring payments for a customer via the Edit Subscription screen in Subscriptions 2.0+.
*
* @since 2.4
@ -421,7 +421,7 @@ class WC_Addons_Gateway_Simplify_Commerce extends WC_Gateway_Simplify_Commerce {
}
/**
* Process a pre-order payment when the pre-order is released
* Process a pre-order payment when the pre-order is released.
*
* @param WC_Order $order
* @return wp_error|null
@ -441,7 +441,7 @@ class WC_Addons_Gateway_Simplify_Commerce extends WC_Gateway_Simplify_Commerce {
// Charge the customer
$payment = Simplify_Payment::createPayment( array(
'amount' => $order->order_total * 100, // In cents
'amount' => $order->order_total * 100, // In cents.
'customer' => $customer_id,
'description' => trim( substr( $pre_order_name, 0, 1024 ) ),
'currency' => strtoupper( get_woocommerce_currency() ),
@ -477,7 +477,7 @@ class WC_Addons_Gateway_Simplify_Commerce extends WC_Gateway_Simplify_Commerce {
}
/**
* Return handler for Hosted Payments
* Return handler for Hosted Payments.
*/
public function return_handler() {
if ( ! isset( $_REQUEST['cardToken'] ) ) {

View File

@ -5,7 +5,7 @@ if ( ! defined( 'ABSPATH' ) ) {
}
/**
* Simplify Commerce Gateway
* Simplify Commerce Gateway.
*
* @class WC_Gateway_Simplify_Commerce
* @extends WC_Payment_Gateway
@ -17,7 +17,7 @@ if ( ! defined( 'ABSPATH' ) ) {
class WC_Gateway_Simplify_Commerce extends WC_Payment_Gateway {
/**
* Constructor
* Constructor.
*/
public function __construct() {
$this->id = 'simplify_commerce';
@ -81,8 +81,8 @@ class WC_Gateway_Simplify_Commerce extends WC_Payment_Gateway {
}
/**
* Admin Panel Options
* - Options for bits like 'title' and availability on a country-by-country basis
* Admin Panel Options.
* - Options for bits like 'title' and availability on a country-by-country basis.
*/
public function admin_options() {
?>
@ -132,7 +132,7 @@ class WC_Gateway_Simplify_Commerce extends WC_Payment_Gateway {
}
/**
* Check if SSL is enabled and notify the user
* Check if SSL is enabled and notify the user.
*/
public function checks() {
if ( 'no' == $this->enabled ) {
@ -156,7 +156,7 @@ class WC_Gateway_Simplify_Commerce extends WC_Payment_Gateway {
}
/**
* Check if this gateway is enabled
* Check if this gateway is enabled.
*/
public function is_available() {
if ( 'yes' !== $this->enabled ) {
@ -175,7 +175,7 @@ class WC_Gateway_Simplify_Commerce extends WC_Payment_Gateway {
}
/**
* Initialise Gateway Settings Form Fields
* Initialise Gateway Settings Form Fields.
*/
public function init_form_fields() {
$this->form_fields = array(
@ -257,7 +257,7 @@ class WC_Gateway_Simplify_Commerce extends WC_Payment_Gateway {
}
/**
* Payment form on checkout page
* Payment form on checkout page.
*/
public function payment_fields() {
$description = $this->get_description();
@ -278,7 +278,7 @@ class WC_Gateway_Simplify_Commerce extends WC_Payment_Gateway {
/**
* payment_scripts function.
*
* Outputs scripts used for simplify payment
* Outputs scripts used for simplify payment.
*/
public function payment_scripts() {
if ( ! is_checkout() || ! $this->is_available() ) {
@ -301,7 +301,7 @@ class WC_Gateway_Simplify_Commerce extends WC_Payment_Gateway {
}
/**
* Process standard payments
* Process standard payments.
*
* @param WC_Order $order
* @param string $cart_token
@ -323,7 +323,7 @@ class WC_Gateway_Simplify_Commerce extends WC_Payment_Gateway {
}
$payment = Simplify_Payment::createPayment( array(
'amount' => $order->order_total * 100, // In cents
'amount' => $order->order_total * 100, // In cents.
'token' => $cart_token,
'description' => sprintf( __( '%s - Order #%s', 'woocommerce' ), esc_html( get_bloginfo( 'name', 'display' ) ), $order->get_order_number() ),
'currency' => strtoupper( get_woocommerce_currency() ),
@ -367,7 +367,7 @@ class WC_Gateway_Simplify_Commerce extends WC_Payment_Gateway {
}
/**
* Process standard payments
* Process standard payments.
*
* @param WC_Order $order
* @return array
@ -380,7 +380,7 @@ class WC_Gateway_Simplify_Commerce extends WC_Payment_Gateway {
}
/**
* Process the payment
* Process the payment.
*
* @param integer $order_id
*/
@ -418,7 +418,7 @@ class WC_Gateway_Simplify_Commerce extends WC_Payment_Gateway {
}
/**
* Receipt page
* Receipt page.
*
* @param int $order_id
*/
@ -439,7 +439,7 @@ class WC_Gateway_Simplify_Commerce extends WC_Payment_Gateway {
}
/**
* Return handler for Hosted Payments
* Return handler for Hosted Payments.
*/
public function return_handler() {
@ob_clean();
@ -467,7 +467,7 @@ class WC_Gateway_Simplify_Commerce extends WC_Payment_Gateway {
}
/**
* Process the order status
* Process the order status.
*
* @param WC_Order $order
* @param string $payment_id
@ -494,8 +494,8 @@ class WC_Gateway_Simplify_Commerce extends WC_Payment_Gateway {
}
/**
* Process refunds
* WooCommerce 2.2 or later
* Process refunds.
* WooCommerce 2.2 or later.
*
* @param int $order_id
* @param float $amount
@ -509,7 +509,7 @@ class WC_Gateway_Simplify_Commerce extends WC_Payment_Gateway {
$payment_id = get_post_meta( $order_id, '_transaction_id', true );
$refund = Simplify_Refund::createRefund( array(
'amount' => $amount * 100, // In cents
'amount' => $amount * 100, // In cents.
'payment' => $payment_id,
'reason' => $reason,
'reference' => $order_id

View File

@ -35,14 +35,14 @@ class Emogrifier {
const CACHE_KEY_CSS_DECLARATION_BLOCK = 3;
/**
* for calculating nth-of-type and nth-child selectors
* for calculating nth-of-type and nth-child selectors.
*
* @var integer
*/
const INDEX = 0;
/**
* for calculating nth-of-type and nth-child selectors
* for calculating nth-of-type and nth-child selectors.
*
* @var integer
*/
@ -84,15 +84,15 @@ class Emogrifier {
);
/**
* the visited nodes with the XPath paths as array keys
* the visited nodes with the XPath paths as array keys.
*
* @var array<\DOMNode>
*/
private $visitedNodes = array();
/**
* the styles to apply to the nodes with the XPath paths as array keys for the outer array and the attribute names/values
* as key/value pairs for the inner array
* the styles to apply to the nodes with the XPath paths as array keys for the outer array and the attribute names/values.
* as key/value pairs for the inner array.
*
* @var array<array><string>
*/
@ -354,9 +354,9 @@ class Emogrifier {
/**
* This method merges old or existing name/value array with new name/value array
* This method merges old or existing name/value array with new name/value array.
* and then generates a string of the combined style suitable for placing inline.
* This becomes the single point for CSS string generation allowing for consistent
* This becomes the single point for CSS string generation allowing for consistent.
* CSS output no matter where the CSS originally came from.
* @param array $oldStyles
* @param array $newStyles
@ -444,12 +444,12 @@ class Emogrifier {
/**
* Splits input CSS code to an array where:
*
* - key "css" will be contains clean CSS code
* - key "media" will be contains all valuable media queries
* - key "css" will be contains clean CSS code.
* - key "media" will be contains all valuable media queries.
*
* Example:
*
* The CSS code
* The CSS code.
*
* "@import "file.css"; h1 { color:red; } @media { h1 {}} @media tv { h1 {}}"
*
@ -752,9 +752,9 @@ class Emogrifier {
*
* Example:
*
* The declaration block
* The declaration block.
*
* "color: #000; font-weight: bold;"
* "color: #000; font-weight: bold;".
*
* will be parsed into the following array:
*

Some files were not shown because too many files have changed in this diff Show More