init class
This commit is contained in:
parent
0103e14f9b
commit
3bfb91ca0c
|
@ -39,11 +39,7 @@ class WC_ShareYourCart extends WC_Integration {
|
|||
if ( $this->enabled == 'yes' ) {
|
||||
add_action( 'wp_enqueue_scripts', array(&$this, 'styles') );
|
||||
|
||||
// Share your cart api class
|
||||
include_once('class-shareyourcart-woocommerce.php');
|
||||
|
||||
// Init the class
|
||||
$this->shareYourCartWooCommerce = new ShareYourCartWooCommerce( $this->settings );
|
||||
$this->init_share_your_cart();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -57,6 +53,24 @@ class WC_ShareYourCart extends WC_Integration {
|
|||
wp_enqueue_style( 'shareyourcart', plugins_url( 'css/style.css', __FILE__ ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* init_share_your_cart function.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function init_share_your_cart() {
|
||||
|
||||
if ( ! $this->shareYourCartWooCommerce ) {
|
||||
// Share your cart api class
|
||||
include_once('class-shareyourcart-woocommerce.php');
|
||||
|
||||
// Init the class
|
||||
$this->shareYourCartWooCommerce = new ShareYourCartWooCommerce( $this->settings );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* process_forms function.
|
||||
*
|
||||
|
@ -66,6 +80,8 @@ class WC_ShareYourCart extends WC_Integration {
|
|||
|
||||
if ( ! empty( $_REQUEST['syc-account'] ) && $_REQUEST['syc-account'] == 'create' ) {
|
||||
|
||||
$this->init_share_your_cart();
|
||||
|
||||
$error = $message = '';
|
||||
|
||||
$redirect = remove_query_arg( 'saved' );
|
||||
|
@ -106,6 +122,8 @@ class WC_ShareYourCart extends WC_Integration {
|
|||
|
||||
} elseif ( ! empty( $_REQUEST['syc-account'] ) && $_REQUEST['syc-account'] == 'recover' ) {
|
||||
|
||||
$this->init_share_your_cart();
|
||||
|
||||
$error = $message = '';
|
||||
|
||||
$redirect = remove_query_arg( 'saved' );
|
||||
|
|
Loading…
Reference in New Issue