Plugin Directory

Changeset 1736171


Ignore:
Timestamp:
09/26/2017 10:56:47 AM (9 years ago)
Author:
agurghis
Message:

fixed sales issue

Location:
cardojo-lite/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • cardojo-lite/trunk/includes/cardojo-core-functions.php

    r1736135 r1736171  
    19531953    $current_year = date('Y');
    19541954    $current_month = $month;
    1955 
    19561955   
    19571956    $search_args = array(
    1958         'post_type'           => 'deal',
     1957        'post_type'           => 'vehicle',
    19591958        'post_status'         => array( 'publish' ),
    19601959        'posts_per_page'      => -1,
    19611960        'author'              => get_current_user_id(),
    1962         'year'                => $current_year,
    1963         'monthnum'            => $current_month
    1964 
     1961        'meta_query' => array(
     1962            'relation' => 'AND',
     1963            array(
     1964                'key' => '_sold_date_year',
     1965                'value' => $current_year
     1966            ),
     1967            array(
     1968                'key' => '_sold_date_month',
     1969                'value' => $current_month
     1970            )
     1971        )
    19651972    );
    19661973
     
    19781985    $current_year = $year;
    19791986    $current_month = $month;
    1980 
    19811987   
    19821988    $search_args = array(
    1983         'post_type'           => 'deal',
     1989        'post_type'           => 'vehicle',
    19841990        'post_status'         => array( 'publish' ),
    19851991        'posts_per_page'      => -1,
    19861992        'author'              => get_current_user_id(),
    1987         'year'                => $current_year,
    1988         'monthnum'            => $current_month
    1989 
     1993        'meta_query' => array(
     1994            'relation' => 'AND',
     1995            array(
     1996                'key' => '_sold_date_year',
     1997                'value' => $current_year
     1998            ),
     1999            array(
     2000                'key' => '_sold_date_month',
     2001                'value' => $current_month
     2002            )
     2003        )
    19902004    );
    19912005
  • cardojo-lite/trunk/includes/class-cardojo-shortcode-inventory.php

    r1735464 r1736171  
    9292                        update_post_meta( $car_id, '_sold', 1 );
    9393                        $date = strtotime(date("Y-m-d H:i:s"));
     94                        $date_year = date("Y");
     95                        $date_month = date("m");
    9496                        update_post_meta( $car_id, '_sold_date', $date );
     97                        update_post_meta( $car_id, '_sold_date_year', $date_year );
     98                        update_post_meta( $car_id, '_sold_date_month', $date_month );
    9599                        update_post_meta( $car_id, '_featured', 0 );
    96100                        update_post_meta( $car_id, '_paid_featured', 0 );
     
    108112                        update_post_meta( $car_id, '_sold', 0 );
    109113                        update_post_meta( $car_id, '_sold_date', "" );
     114                        update_post_meta( $car_id, '_sold_date_year', "" );
     115                        update_post_meta( $car_id, '_sold_date_month', "" );
    110116
    111117                        // Message
  • cardojo-lite/trunk/templates/cardojo-dashboard.php

    r1735464 r1736171  
    290290                                      // ['Month', 'Orders', 'Customers'],
    291291                                      ['Month', 'Sales'],
    292                                       ['<?php esc_html_e('Jan.', 'cardojo' ); ?>',     <?php echo cardojo_get_total_sales_by_month( 1 ); ?>],
    293                                       ['<?php esc_html_e('Feb.', 'cardojo' ); ?>',     <?php echo cardojo_get_total_sales_by_month( 2 ); ?>],
    294                                       ['<?php esc_html_e('Mar.', 'cardojo' ); ?>',     <?php echo cardojo_get_total_sales_by_month( 3 ); ?>],
    295                                       ['<?php esc_html_e('Apr.', 'cardojo' ); ?>',     <?php echo cardojo_get_total_sales_by_month( 4 ); ?>],
    296                                       ['<?php esc_html_e('May', 'cardojo' ); ?>',      <?php echo cardojo_get_total_sales_by_month( 5 ); ?>],
    297                                       ['<?php esc_html_e('Jun.', 'cardojo' ); ?>',     <?php echo cardojo_get_total_sales_by_month( 6 ); ?>],
    298                                       ['<?php esc_html_e('Jul.', 'cardojo' ); ?>',     <?php echo cardojo_get_total_sales_by_month( 7 ); ?>],
    299                                       ['<?php esc_html_e('Aug.', 'cardojo' ); ?>',     <?php echo cardojo_get_total_sales_by_month( 8 ); ?>],
    300                                       ['<?php esc_html_e('Sep.', 'cardojo' ); ?>',     <?php echo cardojo_get_total_sales_by_month( 9 ); ?>],
    301                                       ['<?php esc_html_e('Oct.', 'cardojo' ); ?>',     <?php echo cardojo_get_total_sales_by_month( 10 ); ?>],
    302                                       ['<?php esc_html_e('Nov.', 'cardojo' ); ?>',     <?php echo cardojo_get_total_sales_by_month( 11 ); ?>],
    303                                       ['<?php esc_html_e('Dec.', 'cardojo' ); ?>',     <?php echo cardojo_get_total_sales_by_month( 12 ); ?>]
     292                                      ['<?php esc_html_e('Jan.', 'cardojo' ); ?>',     <?php echo cardojo_get_total_sales_by_month( "01" ); ?>],
     293                                      ['<?php esc_html_e('Feb.', 'cardojo' ); ?>',     <?php echo cardojo_get_total_sales_by_month( "02" ); ?>],
     294                                      ['<?php esc_html_e('Mar.', 'cardojo' ); ?>',     <?php echo cardojo_get_total_sales_by_month( "03" ); ?>],
     295                                      ['<?php esc_html_e('Apr.', 'cardojo' ); ?>',     <?php echo cardojo_get_total_sales_by_month( "04" ); ?>],
     296                                      ['<?php esc_html_e('May', 'cardojo' ); ?>',      <?php echo cardojo_get_total_sales_by_month( "05" ); ?>],
     297                                      ['<?php esc_html_e('Jun.', 'cardojo' ); ?>',     <?php echo cardojo_get_total_sales_by_month( "06" ); ?>],
     298                                      ['<?php esc_html_e('Jul.', 'cardojo' ); ?>',     <?php echo cardojo_get_total_sales_by_month( "07" ); ?>],
     299                                      ['<?php esc_html_e('Aug.', 'cardojo' ); ?>',     <?php echo cardojo_get_total_sales_by_month( "08" ); ?>],
     300                                      ['<?php esc_html_e('Sep.', 'cardojo' ); ?>',     <?php echo cardojo_get_total_sales_by_month( "09" ); ?>],
     301                                      ['<?php esc_html_e('Oct.', 'cardojo' ); ?>',     <?php echo cardojo_get_total_sales_by_month( "10" ); ?>],
     302                                      ['<?php esc_html_e('Nov.', 'cardojo' ); ?>',     <?php echo cardojo_get_total_sales_by_month( "11" ); ?>],
     303                                      ['<?php esc_html_e('Dec.', 'cardojo' ); ?>',     <?php echo cardojo_get_total_sales_by_month( "12" ); ?>]
    304304                                    ]);
    305305
  • cardojo-lite/trunk/templates/cardojo-inventory.php

    r1735464 r1736171  
    505505                        $vehicle_image_extended_gallery = get_post_meta($car_ID, 'vehicle_image_extended_gallery',true);
    506506                        $vehicle_cover_image = get_post_meta($car_ID, 'vehicle_cover_image',true);
     507
     508                        $sold_date_year = esc_attr(get_post_meta($car_ID, '_sold_date_year',true));
     509                        $sold_date_month = esc_attr(get_post_meta($car_ID, '_sold_date_month',true));
    507510
    508511                    ?>
Note: See TracChangeset for help on using the changeset viewer.