Home › Forums › Basel support forum › Shortcodes Removed With Ajax filter
Shortcodes Removed With Ajax filter
- This topic has 56 replies, 2 voices, and was last updated 8 years, 2 months ago by Artem Temos.
-
AuthorPosts
-
September 14, 2016 at 1:53 pm #3928
robertarrowParticipantI’ve added a plugin to my site to add a ‘Read More/Read Less’ tag to the content. When a user filters the item, the shortcodes functionality is stripped. Could you please provide assistance for this?
September 14, 2016 at 4:19 pm #3940
Artem TemosKeymasterHello,
It is hard to say why this plugin doesn’t work with our theme. But we would be glad to help you with your request and develop our own theme shortcode to fit your needs. It will be for free for you, the only thing we would like to ask is to leave 5 star review on themeforest 🙂
So please set up child theme and provide us your admin panel and FTP credentials.
Regards
September 14, 2016 at 6:05 pm #3959
robertarrowParticipantNo problem! I love your theme, this is the second client that I’ve used it on and it’s an amazing product. I have no problem writing a perfect review for you.
I already have a child theme. I need the shortcode to function like it does now, but it needs to continue to work when the user filters the products. If you could style it the same that would be great!
Additionally, I’m not a developer, so could you please remove the custom function I’ve added to hide the pricing and add one that hides just the pricing from non-logged in users but continues to show the variations?
September 14, 2016 at 6:42 pm #3960
Artem TemosKeymasterPlease, double check FTP access, we can’t connect.
September 14, 2016 at 8:28 pm #3968
robertarrowParticipantJust changed the password and it worked for me.
September 14, 2016 at 8:52 pm #3969
Artem TemosKeymasterPlease check now. We have added the following code snippets:
functions.php
// Toggle shortcode add_shortcode('basel_show_more', 'basel_show_more_shortcode'); function basel_show_more_shortcode( $atts = array(), $content = '') { extract( shortcode_atts( array( 'more' => 'Read more', 'less' => 'Read less' ), $atts) ); return ' <div class="toggle-more">' . do_shortcode( $content ) . '</div> <p data-more="' . $more . '" data-less="' . $less . '" class="toggle-open"><span class="toggle-text">' . $more . '</span></p>'; }
Custom CSS
/* BASEL MORE BUTTON */ .toggle-more { display:none; cursor:pointer; } .toggle-open { position: relative; display: block; cursor: pointer; vertical-align: middle; text-align: center; box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; margin: 10px 0 30px; min-height: 25px; } .toggle-open:before { border-top: 1px solid #dfdfdf; content: ""; margin: 0 auto; position: absolute; top: 50%; left: 0; right: 0; bottom: 0; width: 100%; z-index: 0; } .toggle-open .toggle-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 14px; font-family: Arial; background: white; padding: 10px; }
Custom JS
(function($){ $(document).on('click', '.toggle-open', function() { var panel = $(this).prev(); if($(this).hasClass('opened')) { panel.stop().slideUp(); $(this).removeClass('opened').find('.toggle-text').text($(this).data('more')); } else { panel.stop().slideDown(); $(this).addClass('opened').find('.toggle-text').text($(this).data('less')); } }); })(jQuery);
September 14, 2016 at 9:03 pm #3971
robertarrowParticipantThat’s perfect! Can you edit this function to hide the prices for users that are not logged in, but to still show the variations?
// Hide prices add_action('after_setup_theme','activate_filter') ; function activate_filter(){ add_filter('woocommerce_get_price_html', 'show_price_logged'); } function show_price_logged($price){ if(is_user_logged_in() ){ return $price; } else { remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart' ); remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 ); remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 ); remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 ); return '<a href="' . get_permalink(woocommerce_get_page_id('myaccount')) . '">Login to See Prices</a>'; } }
September 15, 2016 at 4:54 am #3972
Artem TemosKeymasterTry to use this one
// Hide prices add_action('after_setup_theme','activate_filter') ; function activate_filter(){ add_filter('woocommerce_get_price_html', 'show_price_logged'); } function show_price_logged($price){ if(is_user_logged_in() ){ return $price; } else { remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 ); remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 ); remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 ); return '<a href="' . get_permalink(woocommerce_get_page_id('myaccount')) . '">Login to See Prices</a>'; } }
September 15, 2016 at 1:19 pm #3980
robertarrowParticipantUnfortunately, that function did not work. Any other ideas? This is most important feature of the site for our client. If there’s no way to do it with a function, would you suggest purchasing this plugin?
September 15, 2016 at 3:53 pm #3991
Artem TemosKeymasterWe have changed the code a bit, please take a look now.
September 15, 2016 at 4:44 pm #4007
robertarrowParticipantThat’s perfect!! You guys are the best, the client just saw the site and he loves it, so we should be buying another license for his next project. One last request before I write the review is there any way to add a function that would allow the product variation images to appear as miniature thumbnails under the featured product image?
The user could then select the color and it would also change the dropdown menu to that color.
Is that possible?
September 15, 2016 at 4:52 pm #4010
Artem TemosKeymasterWe are glad to hear that!
Unfortunately, this request needs a bit more additional code customization and it is out of our support scope 🙂 Thank you for understanding.
September 16, 2016 at 6:55 pm #4067
robertarrowParticipantI completely understand. One last thing, is there a way to use the module “posts (products) carousel” to show items that are set as featured. I see tags and categories, but I would like remove this plugin that I’ve used: https://wordpress.org/plugins/woocommerce-products-slider/
September 16, 2016 at 11:57 pm #4068
Artem TemosKeymasterUnfortunately, it is not possible with our posts carousel. Probably we will add this function in our future updates.
September 20, 2016 at 5:08 pm #4264
robertarrowParticipantCompletely understand. I will continue to use the plugin that I’ve added. The function that you edited for the pricing for logged out users is not functioning correctly. If you add the item to the cart. It displays the pricing in the shopping cart. Is there any way to keep the variation shown but to remove the add the cart button completely for logged out users?
This is extremely important, I have the client here with me now and he noticed this bug over the weekend. Please get back to me as soon as possible. Thanks!
September 20, 2016 at 5:54 pm #4268
Artem TemosKeymasterTry to do the following. Add this code to your functions.php in the child theme
add_filter('body_class','nec_logged_in_filter'); function nec_logged_in_filter($classes) { if( is_user_logged_in() ) { $classes[] = 'logged-in'; } else { $classes[] = 'logged-out'; } // return the $classes array return $classes; }
And this one to the Custom CSS
.logged-out .single_add_to_cart_button, .logged-out .quantity, .logged-out .woocommerce-variation-add-to-cart { display:none!important;}
Regards
September 20, 2016 at 5:56 pm #4269
robertarrowParticipantReceived this error:
Parse error: syntax error, unexpected ‘function’ (T_FUNCTION) in /home/dh_khhu7v/hairterprise.com/wp-content/themes/basel-child/functions.php on line 33where do I put it exactly?
September 20, 2016 at 6:00 pm #4270
robertarrowParticipantGot it. I didn’t copy the function from here, I copied it from the email. My mistake.
Worked perfectly! Now they can see the options, but they can’t add anything to the cart.
September 20, 2016 at 6:01 pm #4271
robertarrowParticipantWhere do you want me to leave the review?
September 20, 2016 at 6:04 pm #4272
Artem TemosKeymasterDo you mean a review about our theme? You can leave it on themforest here https://themeforest.net/downloads
And would be also very kind of you to leave some comment in the “Comments area” also https://themeforest.net/item/basel-responsive-ecommerce-theme/14906749/comments
Thank you in advance 🙂
September 20, 2016 at 6:06 pm #4273
robertarrowParticipantPosted it for you.
September 20, 2016 at 6:08 pm #4274
Artem TemosKeymasterIt is the best review for our theme. You can’t even imagine how we are happy now 🙂 Thank you very much!
September 20, 2016 at 6:10 pm #4276
robertarrowParticipantYou are beyond welcome!
September 20, 2016 at 6:39 pm #4280
Artem TemosKeymasterWeb-site looks very nice, good job 🙂 Of course, we would be glad to help you with our theme.
Thank you once more 🙂
September 21, 2016 at 4:05 pm #4327
robertarrowParticipantThe owner of my agency found a bug that I’m hoping you guys can assist with. If you visit the site in an incognito window (as a logged out user) and add an item to the wishlist, then visit the wishlist page, you will receive a 404 error. Then from there, if you visit any other page, it will give you a 404 error. Any ideas?
We could disable the wishlist feature completely for logged out users, correct? And remove the icon on the product in the category pages and the add to wish list text and icon on the product page.
September 21, 2016 at 5:02 pm #4334
Artem TemosKeymasterHello,
We just visited your web-site in incognito tab trying to reproduce the bug. But it works well for us, see the gif
Regards
September 21, 2016 at 5:02 pm #4335
robertarrowParticipantSorry, I meant the hairterprise.com site.
September 21, 2016 at 5:06 pm #4337
Artem TemosKeymasterBut if it works well for another web-site so it is not a theme bug. And not even plugins issue. Something wrong on configuration. Try to compare these two sites and find what causes this problem because we see this problem first time.
September 21, 2016 at 5:14 pm #4338
robertarrowParticipantI’m confused. Remember that we took out the add to cart button and pricing on http://www.hairterprise.com, for some reason, the wishlist is now broken when a user that’s not logged in attempts to add something to the wishlist.
September 21, 2016 at 5:15 pm #4339
robertarrowParticipantWhen you add to the wishlist, then click view wishlist, you get a 404. Then if you try to click any other menu item, you see a 404.
-
AuthorPosts
Tagged: filtering, shortcodes
- You must be logged in to create new topics. Login / Register