bowenac
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce] set attribute as variation via csvNM I got it… had to change search to visible from the other example I was going off.
Forum: Reviews
In reply to: [WooCommerce Cloud Zoom Image Plugin] Not WorkingNo longer working on a clients site either. Seems woocommerce purposely broke all of the zoom plugins since they sell the same plugin now, I think they changed the built in fancybox code which this plugin relys on. As you can see the author has not replied to any questions for months.
All of the required arguments are showing up as object object so the function to grab those values is no longer working which all of these plugins seem to use.
I will post back a solution or a free working plugin if I find a solution.
Forum: Plugins
In reply to: [WooCommerce] Check if a customer has bought a productI decided to make a plugin for this… I made the plugin so that it could be controlled per item. So a setting shows up for each product to only allow it to be purchased once.
Forum: Plugins
In reply to: [WooCommerce] Check if a customer has bought a productUpdated Solution:
Note: It is better to create a folder structure so that your changes will override the default woocommerce files.
So create two folders, one called woocommerce and inside that folder make one called loop. Inside the loop folder create a new file called add-to-cart.php and use the code below.
<?php /** * Loop Add to Cart * * @author WooThemes * @package WooCommerce/Templates * @version 2.1.0 */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly global $product; $current_user = wp_get_current_user(); if ( wc_customer_bought_product( $current_user->user_email, $current_user->ID, $product->id)) { echo 'Purchased'; } else { echo apply_filters( 'woocommerce_loop_add_to_cart_link', sprintf( '<a href="%s" rel="nofollow" data-product_id="%s" data-product_sku="%s" class="button %s product_type_%s">%s</a>', esc_url( $product->add_to_cart_url() ), esc_attr( $product->id ), esc_attr( $product->get_sku() ), $product->is_purchasable() ? 'add_to_cart_button' : '', esc_attr( $product->product_type ), esc_html( $product->add_to_cart_text() ) ), $product ); }
Forum: Plugins
In reply to: [WooCommerce] Check if a customer has bought a productm3ndi3 does your solution no longer work? I just tried it and it seems they have updated some of the files. I changed a few things as well but it is not working.
I will update with an updated solution if I find one.
Thanks
Forum: Plugins
In reply to: [Tax Rate Upload] csv table errorThat is all you need to do… I sent you an email at the email you provided.
Thanks
Forum: Plugins
In reply to: [Tax Rate Upload] Plugin auto update?Sorry about that… I believe in an older version, there was a version naming issue… You had to uninstall the plugin and reinstall as it was not finding any of the updates due to the version number of the actual plugin. It always thought it was a newer version.
Forum: Plugins
In reply to: [Tax Rate Upload] csv table errorWhat error do you get. You do NOT need to edit anything from the csv you download from taxrates.com…
You are using the plugin to upload the csv and not woocommerce right?
And yes it is compatible with 3.8.1 I am from WA as well so same time zone. If you need help let me know and we could do a screen share or something.
Forum: Plugins
In reply to: [WooCommerce] is_user_logged_in causing woocommerce foreach error?Ended up hiding warnings… It was from the theme I am using is using global woocommerce in the header. Not sure how else to get around this warning other than hiding it.
Forum: Plugins
In reply to: [User Avatar] Add User Avatar upload to front-end profile editorHere is the full code I am using in a template page. Just create a new file and paste this code in it. Just to see if this works as this should work.
<?php /* Template Name: Test Avatar */ ?> <?php get_header()?> <?php wp_enqueue_script('jquery'); wp_enqueue_script('thickbox'); wp_enqueue_style('thickbox'); wp_head(); ?> <div id="user-avatar-display" > <span>Profile Picture</span> <p id="user-avatar-display-image"> <?php echo user_avatar_get_avatar( $current_user->ID, 150);?> </p> <a id="user-avatar-link" class="button thickbox" href="<?php echo admin_url('admin-ajax.php'); ?>?action=user_avatar_add_photo&step=1&uid=<?php echo $current_user->ID; ?>&TB_iframe=true&width=720&height=450" title="Customize your profile picture" >Update Picture</a> <input type="hidden" class="noimage" value="https://0.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=150"/> <input type="hidden" id="userid" value="<?php echo $current_user->ID ;?>"/> <input type="hidden" id="_nonce" value="<?php echo wp_create_nonce('delete_user_avatar') ;?>"/> <?php // Remove the User-Avatar button if there is uploaded image if ( user_avatar_avatar_exists($current_user->ID) ):?> <br> <a id="user-avatar-remove" href="#user-avatar-display" ><?php _e('Remove','user-avatar'); ?></a> <?php endif; ?> </div> <script type="text/javascript"> function user_avatar_refresh_image(img){ jQuery('#user-avatar-display-image').html(img); location.reload();//reloading the page after edit/add photo to display the delete link. } function add_remove_avatar_link(){ /*nothing to do here, cause we are going to use our own delete link later. This function still here because of the user avatar plugin still need this*/ } </script> <?php function delete_avatar() { $uid = $_POST['uid']; $nonce = $_POST['nonce']; $current_user = wp_get_current_user(); // If user clicks the remove avatar button, in URL deleter_avatar=true if( isset($uid) && wp_verify_nonce($nonce, 'delete_user_avatar') && $uid == $current_user->id ) { user_avatar_delete_files($uid);//here I using user avatar own plugin delete photo function. } echo '1';//sending back to the js script to notify that the photo is deleted. exit; } // need to add these action for ajax add_action( 'wp_ajax_nopriv_delete_avatar', 'delete_avatar'); add_action( 'wp_ajax_delete_avatar', 'delete_avatar'); //3rd step: The js files //You will need to enqueue this js file to the page you want to use this script. wp_register_script('profile', plugin_dir_url( __FILE__ ) .'js/profile.js',__FILE__ ); wp_enqueue_script('profile'); wp_localize_script( 'profile', 'Ajax', array( 'url' => admin_url( 'admin-ajax.php' ) ) );//this is wp ajax reference //here is the js in profile.js ?> <script> jQuery(document).ready(function($) { $( "#user-avatar-remove" ).click(function() { var uid = $('#userid').val(); var nonce = $('#_nonce').val(); jQuery.ajax({ type: 'POST', url: Ajax.url, data: ({action : 'delete_avatar',uid:uid,nonce:nonce }), success: function(html) { if(html){ var image = $('.noimage').val(); $("#user-avatar-display-image") .fadeOut(400, function() { $("#user-avatar-display-image").find('img').attr('src',$(".noimage").val()); }) .fadeIn(400); $('#user-avatar-remove').remove(); } } }); }); }); </script> <?php get_footer()?>
Let me know if that works for you. I ended up just disabling warning messages. I was getting a warning message because of the wp-admin and my theme uses woocommerce so the header is including woocommerce which was causing my error.
The only thing that doesn’t seem to be working is the delete. It deletes it from the view and shows the default image, I had to update the default image link once you clicked remove as the link was wrong. But if you click update after you remove the image it still shows your previous image so it doesn’t seem to actually be removing it.
Not sure the remove is really needed to begin with not sure why you would want to remove it rather than just update it again.
Forum: Plugins
In reply to: [User Avatar] Add User Avatar upload to front-end profile editorOk I found this… Add this code to where you want to include the Update Avatar on front end I put this in a custom template.
<?php wp_enqueue_script('jquery'); wp_enqueue_script('thickbox'); wp_enqueue_style('thickbox'); wp_head(); ?> <div id="user-avatar-display" > <span>Profile Picture</span> <p id="user-avatar-display-image"> <?php echo user_avatar_get_avatar( $current_user->ID, 150);?> </p> <a id="user-avatar-link" class="button thickbox" href="<?php echo admin_url('admin-ajax.php'); ?>?action=user_avatar_add_photo&step=1&uid=<?php echo $current_user->ID; ?>&TB_iframe=true&width=720&height=450" title="Customize your profile picture" >Update Picture</a> <input type="hidden" class="noimage" value="<?php echo plugins_url('/images/mystery-man.jpg', __FILE__) ;?>"/> <input type="hidden" id="userid" value="<?php echo $current_user->ID ;?>"/> <input type="hidden" id="_nonce" value="<?php echo wp_create_nonce('delete_user_avatar') ;?>"/> <?php // Remove the User-Avatar button if there is uploaded image if ( user_avatar_avatar_exists($current_user->ID) ):?> <br> <a id="user-avatar-remove" href="#user-avatar-display" ><?php _e('Remove','user-avatar'); ?></a> <?php endif; ?> </div> <script type="text/javascript"> function user_avatar_refresh_image(img){ jQuery('#user-avatar-display-image').html(img); location.reload();//reloading the page after edit/add photo to display the delete link. } function add_remove_avatar_link(){ /*nothing to do here, cause we are going to use our own delete link later. This function still here because of the user avatar plugin still need this*/ } </script> <?php function delete_avatar() { $uid = $_POST['uid']; $nonce = $_POST['nonce']; $current_user = wp_get_current_user(); // If user clicks the remove avatar button, in URL deleter_avatar=true if( isset($uid) && wp_verify_nonce($nonce, 'delete_user_avatar') && $uid == $current_user->id ) { user_avatar_delete_files($uid);//here I using user avatar own plugin delete photo function. } echo '1';//sending back to the js script to notify that the photo is deleted. exit; } // need to add these action for ajax add_action( 'wp_ajax_nopriv_delete_avatar', 'delete_avatar'); add_action( 'wp_ajax_delete_avatar', 'delete_avatar'); //3rd step: The js files //You will need to enqueue this js file to the page you want to use this script. wp_register_script('profile', plugin_dir_url( __FILE__ ) .'js/profile.js',__FILE__ ); wp_enqueue_script('profile'); wp_localize_script( 'profile', 'Ajax', array( 'url' => admin_url( 'admin-ajax.php' ) ) );//this is wp ajax reference //here is the js in profile.js ?> <script> jQuery(document).ready(function($) { $( "#user-avatar-remove" ).click(function() { var uid = $('#userid').val(); var nonce = $('#_nonce').val(); jQuery.ajax({ type: 'POST', url: Ajax.url, data: ({action : 'delete_avatar',uid:uid,nonce:nonce }), success: function(html) { if(html){ var image = $('.noimage').val(); $("#user-avatar-display-image") .fadeOut(400, function() { $("#user-avatar-display-image").find('img').attr('src',$(".noimage").val()); }) .fadeIn(400); $('#user-avatar-remove').remove(); } } }); }); }); </script>
Its working so far for me but I am having another issue in the iframe that is an invalid argument from woocommerce plugin. I think that has to do with loading wp-admin in the iframe etc.
Found the code from this closed post…
https://www.ads-software.com/support/topic/plugin-user-avatar-how-to-use-this-plugin-in-other-admin-page?replies=12Forum: Plugins
In reply to: [User Avatar] Add User Avatar upload to front-end profile editorI’m curious about this as well. Would be cool if it had shortcode to add to front end. I am going to look around and see what I can come up with. Will report back if I find anything.
Forum: Plugins
In reply to: [Tax Rate Upload] tax not showing up on checkout pageIf you could send me a test account I could take a look at whats going on. You could try the above fix for bluehost as it might be the same thing with Network Solutions.
If you want you can email me @ [email protected] since I do not know of a way to send a private message on this forum etc.
Forum: Plugins
In reply to: [Tax Rate Upload] tax not showing up on checkout pageWho is your hosting provider? Do you happen to use bluehost? This isn’t an issue with my plugin but I know of an issue with woocommerce and bluehost which causes taxes not to calculate at all.
When does it accept what? The standard tax page will always time out like I mentioned in the faq when you have hundreds/thousands of tax rates. This is not caused by my plugin. It is how woocommerce is pulling and displaying the data all at once from the db table instead of using pagination.
Let me know who your host is here is a different post I made on woocommerce support section.
https://www.ads-software.com/support/topic/tax-calculation-fix-with-blue-host
If you are using bluehost than this is the problem. Let me know and I can help you fix that if your not comfortable doing that.
Forum: Plugins
In reply to: [Tax Rate Upload] Priority Populating as NullCan you attach a screenshot. They both need to be done individually as they both have there own button to save the settings…