Forum Replies Created

Viewing 15 replies - 1 through 15 (of 59 total)
  • Thread Starter scdwb

    (@scdwb)

    It turns out this plugin is not compatible with my version of VirtueMart and Frederic has refunded me.

    If I can add a suggestion I’d recommend having some sort of error handling so users are given some feedback on the problems they are facing when there is missing data and the migration is not successful.

    Federick refunded me as soon as he found out that I had the wrong version.

    Can the moderator delete this thread, as I was using an incompatible version of VirtueMart and therefore the above post is an unfair review of the plugin as I haven’t really been able to test it as it was intended.

    Thread Starter scdwb

    (@scdwb)

    Hi,

    Your email isn’t on the profile page :-/. The last time I worked on the plugin in question was almost a year ago at the time and I no longer work with it (would rather code registration/login forms myself as that plugin caused quite a few headaches).

    The forum post explains how I fixed the problem at the time and hopefully this will help if you implement those changes. I’m sorry if this does not help you. After just reading it again I don’t remember much about it so I’m not in a position to help much more.

    Thank you, you’re very kind ??

    Hello,

    I’m after the German .PO file for WooCommerce Subscriptions. Unfortunately the link at the top of the page says that the download is expired. Could you please make this .PO file available again?

    Many thanks,
    Steven

    Thread Starter scdwb

    (@scdwb)

    I’ve just solved this using a different method of telling WordPress how to sort the column. Instead of hooking into the “request” filter in my function, I’m using this function and hooking into the “pre_user_query” action:

    add_action('pre_user_query', 'status_column_orderby');
    function status_column_orderby($userquery){
    if('payment_pending_count'==$userquery->query_vars['orderby']) {
    global $wpdb;
    $userquery->query_from .= " LEFT OUTER JOIN $wpdb->usermeta AS alias ON ($wpdb->users.ID = alias.user_id) ";//note use of alias
    $userquery->query_where .= " AND alias.meta_key = 'payment_pending_count' ";//which meta are we sorting with?
    $userquery->query_orderby = " ORDER BY alias.meta_value ".($userquery->query_vars["order"] == "ASC" ? "asc " : "desc ");//set sort order
    }
    }

    Not as pretty as what I was trying before. I was trying to avoid calling the database in this way but it works. FYI, my custom user_meta name is ‘payment_pending_count’.

    Hope this helps others.

    Steven

    Hello,

    I’ve updated to the latest version of TML (currently 6.3.8) and since then my custom templates have also stopped working. The code I have to call the theme_my_login function is the following:

    <?php
    theme_my_login( array('instance' => '-account', 'default_action'=>'profile', 'profile_template' => 'account-form.php', 'show_title'=>false ) );
    ?>

    Nothing else has changes within my theme and it seems like that the “profile_template” parameter that is calling my custom “account-form.php” is no longer working.

    The custom “account-form.php” file is still within my theme root and downgrading the plugin picks it back up again. However, with the upgrade this function code is reverting to the default “profile-form.php” file.

    I have two areas on my website, one which relies on the default “profile-form.php” file and one which relies on my custom “account-form.php” file and for the life of me I can’t figure out what is happening.

    Was it intentional to change this feature in the upgrade or do you know what the issue may be?

    Many thanks,
    Steven

    Thread Starter scdwb

    (@scdwb)

    I actually managed to find a solution to this, so I thought I would share it.

    It doesn’t require making any changes to the hard code of the plugin, which is good. You simply just need to add this code in the profile-form.php template file that you place in your theme.

    Place it just above this line:

    template->the_action_template_message( 'profile' );

    Code:


    global $theme_my_login;
    $current_user = wp_get_current_user();

    $errors = edit_user( $current_user->ID );

    if ( !is_wp_error( $errors ) ) {
    $redirect = add_query_arg( array( ‘updated’ => ‘true’ ) );
    wp_redirect( $redirect );
    exit();
    }

    $theme_my_login->errors = $errors;

    if ( is_wp_error( $errors ) ) {
    $error_string = $errors->get_error_messages();
    echo ‘<p class=”error”>’;
    foreach ($error_string as $error_message) {
    echo $error_message . ”; }
    echo ‘</p>’;
    }
    endif;

    Used in conjunction with the user_profile_update_errors filter to add custom validation the code above validates the profile form fields perfectly.

    The only problem I’ve found is that once all validation has been passed and all fields are complete and saved correctly, it then ironically displays all error messages and the whole form fails validation (even though the form is complete and correct. I think this is because I’m using ‘$errors = edit_user( $current_user->ID );’ above.

    The edit_user() function for some reason not only updates a user but tries to create a new user too if there is no current user to update. So I think that when all the validation passes it then tries to create a new user and expects all the fields to be passed through again. This is what’s causing the new validation errors.

    This is where the add_query_arg comes in above, which appends an “update” parameter to the url when validation is first successful. I then include the code below so users are sent to an appropriate page as soon as they successfully complete the profile so they don’t see the new validation failures:

    <?php if ( isset($_GET['updated']) ) : wp_redirect( get_permalink( get_page_by_title('page')) ); ?>

    This isn’t ideal but works well for my needs. I think this problem is because I’m using the user_edit() function. It would be great to get some feedback on this method and if there are any improvements I could make.

    Many thanks,
    Steven

    Thread Starter scdwb

    (@scdwb)

    Thanks very much for replying. Is there a work around in the mean time?

    My profile page works and in fact the user_profile_update_errors hook actually does seem to validate the fields and stop the form saving if validation fails. But for the life of me I can’t seem to get the errors to appear.

    I’ll send over a thank you, whatever your fee is. I don’t want to get support for free and I’m more than happy to pay you for your support.

    This is very important so if there is a work around until the 6.3 release and it’s worth your time to help me for your fee, please let me know.

    Many thanks,
    Steven

    Thread Starter scdwb

    (@scdwb)

    Just an update on this, this code above works in the admin profile page. So it’s good to know it’s working as it should in native WordPress.

    However, I’m using the theme my login profile page on the front end. Is it possible for this validation code above to apply to the front end form? This would be perfect!

    Cheers,
    Steven

    Thread Starter scdwb

    (@scdwb)

    Hmm, actually this seems to have done the trick:

    function custom_widget_title($title) {
    $title = $title;
    return $title;
    }
    add_filter('widget_title', 'custom_widget_title');

    Not entirely sure how, but it’s working how I need it to. When I leave widgets titles blank they no longer appear with any default titles (just what I need) and when I fill in a widget title they appear.

    Great ??

    Steven

    Thread Starter scdwb

    (@scdwb)

    Hi cehwitham,

    I found a solution and I hope this solves your issue too.

    It was a little hard to find but there is an inbuilt function to find the ID of the featured image attached to a post:

    get_post_thumbnail_id( $post->ID );

    So I assigned this to a variable and then excluded this image in the “get_posts” function that I called into the slide show:

    $thumb_ID = get_post_thumbnail_id( $post->ID );
    
    if ( $images = get_posts(array(
    		'post_parent' => $post->ID,
    		'post_type' => 'attachment',
    		'numberposts' => -1,
    		'orderby'        => 'title',
    		'order'           => 'ASC',
    		'post_mime_type' => 'image',
    		'exclude' => $thumb_ID,
    		)))
    	{
    		foreach( $images as $image ) {......rest of code

    Hope this helps ??

    Thread Starter scdwb

    (@scdwb)

    Is there any chance some one can help me with the above as I’m still struggling to fine a solution with this one.

    Much thanks

    Thread Starter scdwb

    (@scdwb)

    Thanks for the link,

    The code with the else/if statements worked fine outside of the function so that was confusing me. Must be the global $post. I’ll google it and learn what that is.

    Thanks once again, really appreciate it ??

    Thread Starter scdwb

    (@scdwb)

    Michael, what made your code work and mine didn’t? As you were still using the get_post_meta.

    Is it something to do with the global $post;?

    Thread Starter scdwb

    (@scdwb)

    Beautiful Michael!

    There was just a missing semicolon on the third line, so the working code is:

    function WPLG_options($page_value,$theme_value) {
      global $post;
      $cvalue = get_post_meta($post->ID, $page_value, true);
      if (!$cvalue) {
        $cvalue = get_option($theme_value);
      }
      if (!$cvalue) {
        $cvalue = 'Please complete theme options';
      }
      echo $cvalue;
    }

    Thank you very much for the quick reply.

Viewing 15 replies - 1 through 15 (of 59 total)