Forum Replies Created

Viewing 15 replies - 1 through 15 (of 21 total)
  • Thread Starter Beginner9

    (@beginner9)

    Hi,
    Thanks for taking note of my feedback.

    Just one more point related to the Class Generator code for widgets. We do not have selection for:
    – Timing (linear or easein etc.)
    – Animation Repeat (twice, thrice etc.)

    These are available when we do animation for Pages.

    Will appreciate if you can keep me updated on the progress.

    Thanks & Regards,
    Sailen

    Thread Starter Beginner9

    (@beginner9)

    Hi,
    I am on the development server, hence you may not be able to view.

    However, I did manage to create a workaround in the last 2 days with another plugin. I created two sets of ALL my buttons & content boxes. In the widgets, one set I created exclusively for mobiles, and the other for tabs & desktop (with the help of another plugin). Then, on the set for desktops, I added widget animations created with your class generator. It has not given me a problem in last 24 hours…

    I am a non coder, but this seems to reinforce my view that your plugin does not actually cut off animations on mobile even when disabled from your settings page. The other plugin did that correctly when I selected the – hide from mobile view, in the widgets. Pl see if any changes are warranted.

    Another small issue is with the type of entry. If you choose linear it is ok, but if you choose easein, it doesn’t work. The short code spells it as ease-in, but is ineffective. If you change the spelling to easeIn (with a capital I), it works but hangs after some time. It seems to work correctly only with the word – ease.

    Anyway, appreciate you support.

    Regards & Best,

    Thread Starter Beginner9

    (@beginner9)

    Sorry, forgot to share one more observation….
    This problem happens only when I create an animation through the ‘Animation Class Generator’ for Widgets.
    Animations created for pages etc. are correctly not displayed on Nokia mobile, if I disable the mobile setting in Settings Section.

    Regards,
    Sailen

    • This reply was modified 8 years, 3 months ago by Beginner9.

    Thank you Sir(s), was struggling with this for the last few hours.
    Finally landed here and resolved the issue… ??

    Kind regards,

    Thread Starter Beginner9

    (@beginner9)

    Excellent, Sir. Working fine !!!
    Implemented and tested rigorously….
    Heartfelt Thanks.

    Just one last help on this issue, related to styling.
    You already resolved the custom field search box width issue

    However, in the search form, the default boxes (for keyword etc.) you provided are
    Colour #F2F2F2
    Thickness: Approx. 13-14 mm

    The single select boxes we are getting are
    Colour #FFFFFF
    Thickness: Approx. 6-7 mm

    Pl advise, how to get the single select box to match the original ‘keyword’ box in colour/thickness.

    Many thanks in advance.

    Thread Starter Beginner9

    (@beginner9)

    Hi Greg,
    Thanks, that worked as far as the box size is concerned.

    However, there seems to be a logical flaw, when using single select fields in the search form, rendering it un-usable. The issue is this:

    When you select max_value = 1, the first choice from the drop-down is shown in the field box by default. Now, if the user searches only by keyword or only by Location (like a normal OR function in filters) and leaves the other filters untouched, the default value in the ‘single-select’ drop-down will skew the search results.
    For e.g., if I am searching for CAR ads in New Delhi, I will type car in ‘keyword’ & New Delhi in ‘location’. BUT if the category filter is set to ‘property’ as a first choice by default, then there will be no results as there will be a clash between ‘cars’ & ‘property’ (both being disjoint sets).

    In MULTI-SELECT max_value = 2, this issue is resolved, because there is no default selection in category/custom field. There is a ‘placeholder’ text, which does not impinge on the OR filter function.

    Not sure if there can be a solution to this immediately or my understanding is fully correct. In my opinion, if we can get to put a placeholder text even for max_value = 1 scenario, then the issue will be resolved, as there will be no default selection in drop-downs to skew the results.

    Will appreciate to have your thoughts on this.

    For the time being, I will implement all the category/custom drop-downs in the search form with max_value = 2

    Kind Regards,

    Thread Starter Beginner9

    (@beginner9)

    Hi Greg,
    Thanks.
    Actually I am working on my development server (localhost), so am unable to provide link
    I have taken a screen grab of the adverts list page but do not know where to put it. If you can help me with a email address I will be thankful.

    https://pastebin.com/xhzA4st0

    Above is pastebin link to additional code I have put in functions.php file on account of search. This was deleted by moderator above. If you putit in one of your R&D projects, you will experience the issue. Category & Country fields have max_value set to 1, while Subjects is multiple select.

    Just to describe, whenever I select max choices to 1, the display boxes become very small (just the size of the text, like ‘select options’)
    This happens in category search, as well as custom fields search.

    However, the same max_choices works CORRECTLY on the form side (trouble is only in search form)

    Also to eliminate any other plugin influence, I created a new project today morning, with just the wpadverts plugin, but the results were same.

    Many thanks for your help.

    Kind Regards,

    Thread Starter Beginner9

    (@beginner9)

    Hi Greg,
    An update !
    The issue causing this problem does not appear to be location drop-down code.
    Rather, whenever I select max_choices for any custom/original field to be = 1, the filter stops functioning and also gets distorted.

    Today, when I selected drop-downs for category, subjects, country to be 1, all three got distorted & filter stopped working.

    Am pasting all the extra code from functions.php file. Have removed the location drop-down code for now, as it does not appear to be the root cause.

    [Large code excerpt removed by moderator per forum rules. Please use Pastebin for all large code excerpts. It works better anyway.]

    I really need your support to proceed.
    Many thanks in advance.

    Kind Regards,

    Thread Starter Beginner9

    (@beginner9)

    Hi,
    Most of the time I type in the URLs.
    Sometimes though, I copy paste the link just below the ‘page’ title.

    Regards,

    Thread Starter Beginner9

    (@beginner9)

    Boss, you are great ! Hats off to you !!
    Many thanks for solving this ??

    Warm regards,

    Thread Starter Beginner9

    (@beginner9)

    Hi Greg,
    This is the code you advised for category search, which works well

    Part 1

    add_filter( 'adverts_form_load', 'search_by_category_form_load' );
    
    function search_by_category_form_load( $form ) {
    
        if( $form['name'] != 'search' ) {
            return $form;
        }
    
        $form['field'][] = array(
            "name" => "ad_category",
            "type" => "adverts_field_select",
            "order" => 20,
            "label" => __("Category", "adverts"),
            "max_choices" => 4,
            "options" => array(),
            "options_callback" => "adverts_taxonomies",
            "meta" => array(
                "search_group" => "visible",
                "search_type" => "half"
            )
        );
    
        add_action( "wp_footer", "search_by_category_footer" );
    
        return $form;
    }

    Part 2

    add_filter( 'adverts_list_query', 'search_by_category_query' );
    
    function search_by_category_query( $args ) {
    
        if( ! adverts_request( "ad_category" ) ) {
            return $args;
        }
    
        $args["tax_query"] = array(
            array(
                'taxonomy' => 'advert_category',
                'field'    => 'term_id',
                'terms'    => adverts_request( "ad_category" ),
            ),
        );
    
        return $args;
    }

    Now on similar lines, this is the code I put for custom field search
    Part 1

    add_filter( 'adverts_form_load', 'search_by_custom_fields_form_load' );
    
    function search_by_custom_fields_form_load( $form ) {
    
        if( $form['name'] != 'search' ) {
            return $form;
        }
    
        $form['field'][] = array(
            "name" => "my_custom_fabric",
            "type" => "adverts_field_select",
            "order" => 20,
            "label" => "Fabric",
    		"max_choices" => 4,
    		"meta" => array(
                "search_group" => "visible",
                "search_type" => "half"
    			)
    		"options" => array(
    		    array("value"=>"Silk", "text"=>"Silk"),
    			array("value"=>"Cotton", "text"=>"Cotton"),
                array("value"=>"Woollen", "text"=>"Woollen"),
    
    			)
    	);
    
    	add_action( "wp_footer", "search_by_custom_fields_footer" );
    
        return $form;
    }

    And code for Part 2 is

    add_filter( 'adverts_list_query', 'search_by_custom_fields' );
    
    function search_by_custom_fields( $args ) {
      $cz = array("my_custom_fabric"); // <- more fields here
      foreach($cz as $name) {
        if( ! adverts_request( $name ) ) {
          continue;
        }
    
        if( ! isset( $args["meta_query"] ) ) {
          $args["meta_query"] = array();
        }
    
        $args['meta_query'][] = array(
          'key'     => $name,
          'value'   => adverts_request( $name ),
        );
      }
    
      return $args;
    }

    The error message I get is

    Parse error: syntax error, unexpected ‘”options”‘ (T_CONSTANT_ENCAPSED_STRING), expecting ‘)’ in C:\xampp\htdocs\ad\wp-content\plugins\wpadverts\includes\functions.php on line 1834

    Probably, the meta is giving some problem. In the category search, there was a callback function and there were no dropdown choices in options array…..

    Many thanks for your help.
    Kind Regards,

    Hi Rajdeep,
    A request please.
    Can you pl share the exact code you used for searching any one of the custom fields you used (adding the search box as well as for doing actual search)
    I seem to be doing something wrong, my display is not coming correctly.
    I am not able to insert meta data piece of code.

    Before bothering Greg again, I want to check our codes apple to apple.

    Many thanks in advance.

    Was struggling with this for the last 5 hours… Just chanced to see this as I was writing you a thank-you note, Greg.

    Greg, you owe Rajdeep & me a coffee. Of course, it will be a pleasure to host to here in India, when you come for that coffee. ??

    Thread Starter Beginner9

    (@beginner9)

    Have already given a 5 star rating some time ago.
    If the WordPress portal would allow, I would do it again, but it doesn’t. ??
    Many Thanks.

    Thread Starter Beginner9

    (@beginner9)

    It worked, Sir. Thanks a ton !! ??

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