Answer the question
In order to leave comments, you need to log in
How to combine the functionality of a theme and a wordpress plugin?
Hello! I have a wordpress+woocommerce store with a flatastic theme . I want to make it so that a person logs in through a pop-up modal window, which is now used in the original theme, and add the user's personal account with the ability to change fields and change the avatar (not through the wordpress admin panel!), which allows you to make the Theme My Login plugin . Everything would be fine, but this plugin replaces the login page and instead of logging in through a pop-up window - the user is redirected to the plugin page - how to link these 2 different functionalities?
Theme login functionality that calls the [woocommerce_my_account] shortcode
/* Login
/* --------------------------------------------------------------------- */
class MAD_FORM_LOGIN {
public $href;
function __construct($href) {
$this->href = $href;
}
public function html() {
$accountPage = get_permalink( get_option('woocommerce_myaccount_page_id') );
?>
<div id="modal-login" class="modal-inner-content modal-login">
<button class="popup-close"></button>
<div class="custom-scrollbar modal-product">
<div class="row">
<?php echo do_shortcode('[woocommerce_my_account]'); ?>
<footer class="foot-modal-login">
<h3 class="foot-modal-title"><?php _e('New Customer?', 'flatastic'); ?></h3>
<a class="foot-modal-button" href="<?php echo esc_url($accountPage) ?>"><?php _e('Register', 'flatastic'); ?></a>
</footer><!--/ .foot-modal-login-->
</div><!--/ .row-->
</div><!--/ .custom-scrollbar-->
</div><!--/ .modal-inner-content-->
<?php
}
}
public function mad_ajax_form_login() {
if (function_exists('check_ajax_referer')) {
check_ajax_referer($this->action_login, '_madnonce_ajax');
}
$form = new MAD_FORM_LOGIN($_POST['href']);
echo $form->html();
wp_die('exit');
}
add_action('wp_ajax_nopriv_' . $this->action_login, array(&$this, 'mad_ajax_form_login'), 30);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question