Home Forums Basel support forum Shortcodes Removed With Ajax filter

Shortcodes Removed With Ajax filter

Viewing 30 posts - 1 through 30 (of 57 total)
  • Author
    Posts
  • #3928

    robertarrow
    Participant

    I’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?

    Expand Maker Plugin

    Category Description

    Filtered Category

    #3940

    Artem Temos
    Keymaster

    Hello,

    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

    #3959

    robertarrow
    Participant

    No 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?

    #3960

    Artem Temos
    Keymaster

    Please, double check FTP access, we can’t connect.

    #3968

    robertarrow
    Participant

    Just changed the password and it worked for me.

    #3969

    Artem Temos
    Keymaster

    Please 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);
    #3971

    robertarrow
    Participant

    That’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>';
        }
        }
    
    
    #3972

    Artem Temos
    Keymaster

    Try 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>';
        }
        }
    
    #3980

    robertarrow
    Participant

    Unfortunately, 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?

    Catalog Visibility Options

    #3991

    Artem Temos
    Keymaster

    We have changed the code a bit, please take a look now.

    #4007

    robertarrow
    Participant

    That’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?

    #4010

    Artem Temos
    Keymaster

    We 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.

    #4067

    robertarrow
    Participant

    I 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/

    #4068

    Artem Temos
    Keymaster

    Unfortunately, it is not possible with our posts carousel. Probably we will add this function in our future updates.

    #4264

    robertarrow
    Participant

    Completely 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!

    #4268

    Artem Temos
    Keymaster

    Try 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

    #4269

    robertarrow
    Participant

    Received 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 33

    where do I put it exactly?

    #4270

    robertarrow
    Participant

    Got 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.

    #4271

    robertarrow
    Participant

    Where do you want me to leave the review?

    #4272

    Artem Temos
    Keymaster

    Do 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 🙂

    #4273

    robertarrow
    Participant

    Posted it for you.

    #4274

    Artem Temos
    Keymaster

    It is the best review for our theme. You can’t even imagine how we are happy now 🙂 Thank you very much!

    #4276

    robertarrow
    Participant

    You are beyond welcome!

    #4280

    Artem Temos
    Keymaster

    Web-site looks very nice, good job 🙂 Of course, we would be glad to help you with our theme.

    Thank you once more 🙂

    #4327

    robertarrow
    Participant

    The 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.

    #4334

    Artem Temos
    Keymaster

    Hello,

    We just visited your web-site in incognito tab trying to reproduce the bug. But it works well for us, see the gif

    Regards

    #4335

    robertarrow
    Participant

    Sorry, I meant the hairterprise.com site.

    #4337

    Artem Temos
    Keymaster

    But 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.

    #4338

    robertarrow
    Participant

    I’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.

    Wishlist
    Product Category

    #4339

    robertarrow
    Participant

    When 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.

Viewing 30 posts - 1 through 30 (of 57 total)