Shortcode Recent Cars filter by new or used

Support Forums Support Forums CarDealer WordPress Theme Shortcode Recent Cars filter by new or used

This topic contains 5 replies, has 2 voices, and was last updated by  jack 5 years, 1 month ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #11034

    drbrahm
    Participant

    Hi,

    I want to create two pages in my site one to display a list/grid for new ones and other page to used ones.

    How do I set up this by recent cars shortcode?

    #11051

    jack
    Moderator

    The default shortcode function does not have an option for displaying either new cars or used one, how ever this option could be added additionally via editing the source files but these changes totally deal with customization. Unfortunately we do not provide our customers with any custom work due to our policy. We only do Support for our products if there are some issues in work, or some elements cause issues, etc.
    In case you need to make some customizations you could try to figure this out on your own, which needs some skills in coding and programming.
    In case if you believe our theme misses enough custom options to fully meet your needs you could involve/ask for help a third part developer to customize the theme the way you personally like.
    Thanks for understandings and sorry for any inconveniences!

    Regards,
    Jack

    #11059

    drbrahm
    Participant

    Please tell wich files sould I change and I can do it by my own.

    #11060

    jack
    Moderator

    If you could do it on your own then there shouldn’t be any problems to find that file, the file which is charge of recent cars shortcode is recent-cars.php

    Regards,
    Jack

    #11061

    drbrahm
    Participant

    hi Jack,

    thank you for your reply. In fact with a lot of things to be done in my end any help is too much appreciated.. sorry about annoying you.

    In meantime I was able to create a new parameter for shortcode to get it done.

    I want to share this with others and suggest to include this feature in news version of this amazing theme.

    In \tmm_shortcodes\views\cardealer\recent_cars.php

    After the block:

    if ( ! defined( ‘ICL_LANGUAGE_CODE’ ) ) {
    $args[‘meta_query’][] = array(
    ‘key’ => ‘_icl_lang_duplicate_of’,
    ‘value’ => ”,
    ‘compare’ => ‘NOT EXISTS’
    );
    }

    I have inserted this:

    if (isset ($car_condition))
    {
    if ($car_condition==’new’)
    {
    $args[‘meta_query’][] = array(
    ‘key’ => ‘car_is_new’,
    ‘value’ => ‘1’,
    ‘compare’ => ‘=’
    );
    }
    elseif($car_condition==’used’)
    {
    $args[‘meta_query’][] = array(
    ‘key’ => ‘used_car’,
    ‘value’ => ‘1’,
    ‘compare’ => ‘=’
    );
    }
    elseif($car_condition==’damaged’)
    {
    $args[‘meta_query’][] = array(
    ‘key’ => ‘car_is_damaged’,
    ‘value’ => ‘1’,
    ‘compare’ => ‘=’
    );
    }
    }

    The usage is something like this:

    [recent_cars title=”Motos Novas” show_details_button=”1″ car_condition=”new” show_view_all_cars_link=”1″ show_recent_cars_currency_converter=”0″ show_layout_switcher=”1″ set_featured_autoslide=”1″ sc_id=”sc178753897567″]12[/recent_cars]

    where

    car_condition would be: new, used or damaged

    #11068

    jack
    Moderator

    Hello drbrahm,

    Once again I would like to highlight that these changes you are seeking totally deal with customization and we do not provide our customers with any customization, If you don’t know how to achieve it on your own you would need to hire a freelancer who would be able to add required changes to match your specific needs.

    Regards,
    Jack

Viewing 6 posts - 1 through 6 (of 6 total)

The forum ‘CarDealer WordPress Theme’ is closed to new topics and replies.