Changeset 1803355
- Timestamp:
- 01/15/2018 05:11:28 PM (8 years ago)
- Location:
- fastdee/trunk
- Files:
-
- 1 added
- 9 edited
-
assets/css/import-page.css (modified) (1 diff)
-
assets/js/import-page.js (modified) (4 diffs)
-
assets/js/options-page.js (modified) (1 diff)
-
fastdee.php (modified) (4 diffs)
-
includes/core/class-fd-ofertas.php (modified) (5 diffs)
-
includes/core/class-fd-update.php (modified) (2 diffs)
-
includes/core/class-fd-wc-taxonomy-store.php (added)
-
includes/pages/class-fd-import-page.php (modified) (3 diffs)
-
includes/pages/class-fd-options-page.php (modified) (4 diffs)
-
readme.md (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
fastdee/trunk/assets/css/import-page.css
r1792827 r1803355 1 .fastdee_page_importar .preview_container { 2 display: inline-table; 3 } 4 1 5 .fastdee_page_importar .fd_offers_preview table.offer-list { 2 6 width: 98%; 7 margin-bottom: 10px; 3 8 } 4 9 -
fastdee/trunk/assets/js/import-page.js
r1792827 r1803355 14 14 }); 15 15 16 jQuery(' #fd_import').on('click', function () {16 jQuery('.button.fd_import').on('click', function () { 17 17 showConfirmDialogImportarOfertas('Confirma importar as ofertas selecionadas?', 'center', 'fd_import'); 18 18 }); … … 24 24 }); 25 25 26 jQuery(' #fd-atual-page').on('change', function () {26 jQuery('.fd-atual-page-input').on('change', function () { 27 27 fd_get_offers(jQuery(this).val()); 28 28 }); … … 212 212 if (_dataReturn.pagination && _dataReturn.pagination.page) { 213 213 // Pagination 214 jQuery('.tablenav #fd-atual-page').val(_dataReturn.pagination.page);214 jQuery('.tablenav .fd-atual-page-input').val(_dataReturn.pagination.page); 215 215 jQuery('.tablenav .total-pages').html(_dataReturn.pagination.totalPage); 216 216 … … 239 239 240 240 function fd_get_page_atual() { 241 return parseInt(jQuery('.tablenav #fd-atual-page').val());241 return parseInt(jQuery('.tablenav .fd-atual-page-input').val()); 242 242 } 243 243 -
fastdee/trunk/assets/js/options-page.js
r1792827 r1803355 32 32 jQuery('[name="fd_settings[fd_show_black_friday_pname]"]').val(jQuery(this).is(':checked')); 33 33 }); 34 35 jQuery('#fd_update_remover_produto_inexistente').on('change', function () { 36 jQuery('[name="fd_settings[fd_update_remover_produto_inexistente]"]').val(jQuery(this).is(':checked')); 37 }); 34 38 }); 35 39 -
fastdee/trunk/fastdee.php
r1792827 r1803355 4 4 * Plugin URI: http://fastdee.com/?ref=wp-admin-plugins.php 5 5 * Description: Com o plugin Fastdee! Afiliados podem realizar a importação automatizada de ofertas da Lomadee. E também buscar Cupons comissionados. 6 * Version: 2.7. 36 * Version: 2.7.4 7 7 * Author: Lucas Mendes Mota da Fonseca 8 8 * Author URI: http://devlucasmendes.com … … 28 28 final class Fastdee { 29 29 30 public $version = '2.7. 3';30 public $version = '2.7.4'; 31 31 32 32 protected static $_instance = null; … … 106 106 include_once FASTDEE_DIR_PATH . '/includes/core/class-fd-coupons.php'; 107 107 include_once FASTDEE_DIR_PATH . '/includes/core/class-fd-update.php'; 108 include_once FASTDEE_DIR_PATH . '/includes/core/class-fd-wc-taxonomy-store.php'; 108 109 109 110 /** … … 127 128 // Core 128 129 $this->fd_util = new FdUtil; 129 $this->fd_options = new FdOptions ();130 $this->fd_options = new FdOptions; 130 131 $this->fd_ofertas = new FdOfertas; 131 132 $this->fd_coupons = new FdCoupons; 132 133 $this->fd_update = new FdUpdate; 134 $this->fd_wc_taxonomy_lojas = new FDWCTaxonomyStore; 133 135 134 136 // Pages -
fastdee/trunk/includes/core/class-fd-ofertas.php
r1792849 r1803355 13 13 14 14 private $_arrProductIds_cached = array(); 15 15 16 16 const _FD_STORE_ID = '_fd_store_id'; 17 17 const _FD_OFFER_LOMADEE_ID = '_fd_offer_lomadee_id'; … … 259 259 260 260 $catName = apply_filters( 'fd_categories_redirect_get_new_cat', $offer->category->name, $offer ); 261 if ( $this->insertPostProduct( $arrPost, $arrPostMetas, $arrImg, $catName ) ) {261 if ( $this->insertPostProduct( $arrPost, $arrPostMetas, $arrImg, $catName, $offer->store->name ) ) { 262 262 $hasInsertedProduct ++; 263 263 } else { … … 334 334 * @return bool 335 335 */ 336 private function insertPostProduct( $arrPost, $arrPostMetas, $arrImg, $catName ) {336 private function insertPostProduct( $arrPost, $arrPostMetas, $arrImg, $catName, $storeName ) { 337 337 338 338 //Insert Post … … 342 342 //Add category 343 343 wp_set_object_terms( $post_id, $catName, 'product_cat' ); 344 345 //Add store as cat 346 wp_set_object_terms( $post_id, $storeName, FD_WC_LOMADEE_STORE_TAXONOMY ); 344 347 345 348 //Add Metas … … 371 374 update_post_meta( $post_id, '_regular_price', $offer->price ); 372 375 update_post_meta( $post_id, '_product_url', $offer->link ); 376 377 //Add store as cat 378 wp_set_object_terms( $post_id, $offer->store->name, FD_WC_LOMADEE_STORE_TAXONOMY ); 373 379 374 380 } -
fastdee/trunk/includes/core/class-fd-update.php
r1771929 r1803355 174 174 } 175 175 176 // Black Friday //todo add periodo exibicao176 // todo add periodo exibicao 177 177 if ( $this->getOptions( 'fd_show_black_friday_pname' ) === 'true' ) { 178 $offerName .= ' - Black Friday 201 7';179 } 180 181 $my_post =array(178 $offerName .= ' - Black Friday 2018'; 179 } 180 181 wp_update_post( array( 182 182 'ID' => $post_id, 183 183 'post_title' => $offerName 184 ) ;185 186 wp_ update_post( $my_post);184 ) ); 185 186 wp_set_object_terms( $post_id, $offer->store->name, FD_WC_LOMADEE_STORE_TAXONOMY ); 187 187 188 188 return … … 190 190 true === update_post_meta( $post_id, '_regular_price', $offer->price ) && 191 191 true === update_post_meta( $post_id, '_product_url', $offer->link ); 192 } 193 194 //else{ oferta não existe mais } 192 193 } else if ( $this->getOptions( 'fd_update_remover_produto_inexistente' ) === 'true' ) { 194 wp_update_post( array( 195 'ID' => $post_id, 196 'post_status' => 'trash' 197 ) ); 198 199 } 195 200 196 201 return false; -
fastdee/trunk/includes/pages/class-fd-import-page.php
r1792827 r1803355 118 118 119 119 <!-- Btn Importar --> 120 < pclass="submit">121 <input type="button" id="fd_import" class="button button-primary fd-btn-red fd-btn-importar" value="Importar para os Produtos (WooCommerce)">122 </ p>120 <div class="submit"> 121 <input type="button" class="button button-primary fd-btn-red fd-btn-importar fd_import" value="Importar para os Produtos (WooCommerce)"> 122 </div> 123 123 124 124 <!-- Consulta Preview --> 125 <div class="tablenav top ">125 <div class="tablenav top preview_container"> 126 126 127 127 <div class="alignleft actions bulkactions"> 128 128 129 129 <div class="tablenav-pages"> 130 <span 131 class="displaying-num">Exibindo <?php echo esc_html( $this->get_pagination_offers_number() ); ?> 130 <span class="displaying-num">Exibindo <?php echo esc_html( $this->get_pagination_offers_number() ); ?> 132 131 itens</span> 133 132 <span class="pagination-links"> … … 135 134 <button class="previous-page btns-left btns-pagination" disabled="disabled"><span aria-hidden="true">‹</span></button> 136 135 <span class="paging-input"> 137 <span class="tablenav-paging-text"><span class="atual-page"><input id="fd-atual-page"class="fd-atual-page-input"></span></span>136 <span class="tablenav-paging-text"><span class="atual-page"><input class="fd-atual-page-input"></span></span> 138 137 <span class="tablenav-paging-text"> de <span class="total-pages">3 </span></span> 139 138 </span> … … 175 174 <tbody id="fd_offers_list"></tbody> 176 175 </table> 176 <div class="alignleft actions bulkactions"> 177 178 <div class="tablenav-pages"> 179 <span class="displaying-num">Exibindo <?php echo esc_html( $this->get_pagination_offers_number() ); ?> 180 itens</span> 181 <span class="pagination-links"> 182 <button class="first-page btns-left btns-pagination" disabled="disabled"><span aria-hidden="true">«</span></button> 183 <button class="previous-page btns-left btns-pagination" disabled="disabled"><span aria-hidden="true">‹</span></button> 184 <span class="paging-input"> 185 <span class="tablenav-paging-text"><span class="atual-page"><input class="fd-atual-page-input"></span></span> 186 <span class="tablenav-paging-text"> de <span class="total-pages">3 </span></span> 187 </span> 188 <button class="next-page btns-right btns-pagination"><span aria-hidden="true">›</span></button> 189 <button class="last-page btns-right btns-pagination"><span aria-hidden="true">»</span></button> 190 </span> 191 </div> 192 <br class="clear"> 193 </div> 177 194 <!-- .end --> 195 </div> 196 197 <!-- Btn Importar --> 198 <div class="submit"> 199 <input type="button" class="button button-primary fd-btn-red fd-btn-importar fd_import" value="Importar para os Produtos (WooCommerce)"> 178 200 </div> 179 201 -
fastdee/trunk/includes/pages/class-fd-options-page.php
r1792852 r1803355 45 45 'description' => '', 46 46 'callback' => array( $this, 'init_settings_section_general' ) 47 ), 48 array( 49 'slug' => 'update_page', 50 'name' => 'Atualizar Ofertas', 51 'description' => '', 52 'callback' => array( $this, 'init_settings_section_updates' ) 47 53 ) 48 54 ); … … 204 210 } 205 211 212 private function init_settings_section_updates( $fd_section ) { 213 add_settings_field( 214 'fd_update_remover_produto_inexistente', 215 __( 'Remover produtos inexistentes', 'wordpress' ), 216 function () { 217 ?> 218 <input 219 type="hidden" 220 name='fd_settings[fd_update_remover_produto_inexistente]' 221 value="<?php echo esc_attr( $this->getOptions( 'fd_update_remover_produto_inexistente' ) ); ?>" 222 > 223 <input 224 type='checkbox' 225 id="fd_update_remover_produto_inexistente" 226 style="margin-right: 186px;" 227 <?php echo esc_attr( checked( $this->getOptions( 'fd_update_remover_produto_inexistente' ), 'true' ) ) ?> 228 > 229 <span>(Durante a atualização os produtos inexistentes na Lomadee serão removidos)</span> 230 <?php 231 }, 232 self::PAGE_NAME, 233 $fd_section 234 ); 235 236 } 237 206 238 private function init_settings_section_import( $fd_section ) { 207 239 add_settings_field( … … 242 274 ); 243 275 244 //BF_201 7276 //BF_2018 245 277 add_settings_field( 246 278 'fd_show_black_friday_pname', 247 __( 'Adicionar "Black Friday 201 7" nas ofertas', 'wordpress' ),279 __( 'Adicionar "Black Friday 2018" nas ofertas', 'wordpress' ), 248 280 function () { 249 281 ?> … … 253 285 <?php echo esc_attr( checked( $this->getOptions( 'fd_show_black_friday_pname' ), 'true' ) ) ?> 254 286 style="margin-right: 186px;"> 255 <span>(No final do nome da oferta será adicionado <em>"Black Friday 201 7"</em>)</span>287 <span>(No final do nome da oferta será adicionado <em>"Black Friday 2018"</em>)</span> 256 288 <?php 257 289 -
fastdee/trunk/readme.md
r1792827 r1803355 132 132 133 133 == Changelog == 134 135 = 2.7.4 = 136 * Criação de nova taxonomia de produtos: Lojas. Com a loja do produto que foi importado 137 * Melhora da usabilidade na tela de importação: botão importar e navegação embaixo da tabela de ofertas. 138 * Nova opção para remover produtos inexistentes ao atualizar ofertas. 139 134 140 = 2.7.3 = 135 141 * Modernização e organização da tela de opções
Note: See TracChangeset
for help on using the changeset viewer.