Plugin Directory

Changeset 1728089


Ignore:
Timestamp:
09/11/2017 01:39:59 PM (9 years ago)
Author:
devlucasmendes
Message:

Updating offers - fix

Location:
fastdee/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • fastdee/trunk/assets/js/update-page.js

    r1727829 r1728089  
    100100    function startCounter() {
    101101        var startValue = jQuery('#status_ofertas').html();
    102         return setInterval(function () {
     102        return setInterval(function () { // Todo fix contador passa da qtd certa qdo continua
    103103            var i = jQuery('#status_ofertas').html();
    104104            if (++i < 500 + parseInt(startValue) && i < parseInt(jQuery('#total_offers').html())) {
    105105                jQuery('#status_ofertas').html(i)
    106106            }
    107         }, 200)
     107        }, 300)
    108108    }
    109109
  • fastdee/trunk/includes/core/class-fd-update.php

    r1728062 r1728089  
    3030
    3131    /** Busca total de ofertas do fastdee no bd
     32     * @param bool $afterVersion2_4
    3233     * @return string|int
    3334     */
    34     private function getTotalOffersImported() {
     35    private function getTotalOffersImported( $afterVersion2_4 = false ) {
     36
     37        if ( $afterVersion2_4 ) {
     38            $key = FdOfertas::_FD_OFFER_FASTDEE_ID;
     39        } else {
     40            $key = FdOfertas::_FD_OFFER_LOMADEE_ID;
     41        }
    3542
    3643        $query = new WP_Query(
     
    3946                'meta_query' => array(
    4047                    array(
    41                         'key'     => FdOfertas::_FD_OFFER_LOMADEE_ID,
     48                        'key'     => $key,
    4249                        'compare' => 'EXISTS'
    4350                    ),
     
    8491            }
    8592
    86             $totalOffers = $this->getTotalOffersImported();
     93            $totalOffers = $this->getTotalOffersImported( true );
    8794
    8895            if ( $offersUpdated >= $totalOffers ) {
Note: See TracChangeset for help on using the changeset viewer.