JesperT
Forum Replies Created
-
I have the same issue. ??
Forum: Plugins
In reply to: [Favorites] Add_to_cart on list of Product FavoritesYes to copy your favorites to your cart create a button:
<button id="favorites_to_cart">Add favorites to cart</button>
Create an ajax function in your function.phpfunction favorites_to_cart() { global $woocommerce; $clips = get_user_favorites(); foreach ($products as $product) { $woocommerce->cart->add_to_cart( $product ); } echo 'Your favorites is copied to the cart.'; wp_die(); } add_action('wp_ajax_nopriv_favorites_to_cart', 'favorites_to_cart'); // ajax call for non-login user. add_action('wp_ajax_favorites_to_cart', 'favorites_to_cart'); // ajax call for login user.
Create a javascript function
jQuery(document).ready(function($) { var favorites_to_cart = function() { $.ajax({ url: favorites_data.ajaxurl, data: { 'action':'favorites_to_cart' }, success:function(data) { alert(data); }, error: function(errorThrown){ console.log('Error: ', errorThrown); } }); }; $( "#favorites_to_cart" ).on( "click", function() { favorites_to_cart(); }); });
Good luck!
- This reply was modified 4 years, 4 months ago by JesperT.
Forum: Reviews
In reply to: [Favorites] Plugin doesn’t work, Author unresponsiveIt has for sure nothing to do with the plugin. It has to be some conflict with your theme or another plugin. One star is quite unfair.
Forum: Reviews
In reply to: [Favorites] Not that good…It has for sure nothing to do with the plugin. It has to be some conflict with your theme or another plugin. One star is quite unfair.
Forum: Fixing WordPress
In reply to: Media Library won't load display imagesI got the same error in WP 4.4.2 and discovered that in my functions.php used the wrong hook to run remove_menu_page.
(admin_init instead of admin_menu)Exactly what is hidden from Authors? Do you even know how to use this plugin? The plugin is not made for amateurs. Please go back to your cradle and do your homework.
Forum: Reviews
In reply to: [Secure Custom Fields] Terrible1. Wrong, you can find all documentation well formatted here: https://www.advancedcustomfields.com/resources/
2. Wrong, in all my cases where I needed help Elliot answered me within 24 hours.
FAQ and Supportforum
3. It’s not, better than many others, maybe you are spoiled and lazy?
4. If you have this attitude – that does not surprise me.ACF is one of the most well build plugins for WordPress so please be careful with your statements.
Forum: Reviews
In reply to: [Bootstrap Basic] Nice but not 100%Nice, that what I call Polka. If you are interested I can send you som translation files in swedish.
Forum: Plugins
In reply to: Check if editing post or page?This?
if(strstr($_SERVER['REQUEST_URI'], 'wp-admin/post-new.php') || strstr($_SERVER['REQUEST_URI'], 'wp-admin/post.php') || strstr($_SERVER['REQUEST_URI'], 'wp-admin/edit.php')) { //Post }else{ //Page }
Forum: Plugins
In reply to: current_user_can() in the __construct?Tnx!
Forum: Fixing WordPress
In reply to: get_post_meta ads an extra “array”?Aha, of course. Thank you very much!