Plugin Directory

Changeset 2971479


Ignore:
Timestamp:
09/25/2023 05:50:16 PM (3 years ago)
Author:
fromdoppler
Message:

update plugin version 1.2.0

Location:
doppler-for-woocommerce
Files:
67 added
10 edited

Legend:

Unmodified
Added
Removed
  • doppler-for-woocommerce/trunk/README.txt

    r2897819 r2971479  
    55Requires at least: 4.9
    66Tested up to: 6.2
    7 Stable tag: 1.1.7
     7Stable tag: 1.2.0
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1212
    1313Submit your WooCommerce customers and buyers to a Doppler List.
     14== 1.2.0 ==
     15* Mapping of last puchased products
    1416== 1.1.7 ==
    1517* Fix abandoned cart's product price when using taxes
  • doppler-for-woocommerce/trunk/admin/class-doppler-for-woocommerce-admin.php

    r2753293 r2971479  
    1 <?php
     1<?php
    22
    33if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
     
    332332     */
    333333    public function reset_buyers_and_contacts_last_synch() {
     334
    334335        $last_synch = get_option('dplrwoo_last_synch');
    335336       
     
    397398        WC()->session = new WC_Session_Handler;
    398399        WC()->customer = new WC_Customer;
    399         return WC()->checkout->checkout_fields;
    400     }
     400
     401        //checkout from woocommerce
     402        $fields = WC()->checkout->checkout_fields;
     403
     404        $last_product = array( "product_names" => array("label" => "Products",
     405                                                        "required" => true,
     406                                                        "class" => array("form-row-first"),
     407                                                        "autocomplete" => "products_names",
     408                                                        "type" => "string",
     409                                                        "priority"=>10),
     410                                "product_total" => array("label" => "Total amount",
     411                                                        "required" => true,
     412                                                        "class" => array("form-row-first"),
     413                                                        "autocomplete" => "total_ammount",
     414                                                        "type" => "number",
     415                                                        "priority"=>20),
     416                                "product_date" => array("label" => "Date of purchase",
     417                                                        "required" => true,
     418                                                        "class" => array("form-row-first"),
     419                                                        "autocomplete" => "date_of_purchase",
     420                                                        "type" => "date",
     421                                                        "priority"=>30));
     422
     423        $fields["product"] = $last_product;
     424
     425        return $fields;
     426    }
     427
    401428
    402429    /**
     
    819846        $query = "SELECT p.ID, pm.meta_value as email FROM ".$wpdb->prefix."posts p ";
    820847        $query.= "JOIN ".$wpdb->prefix."postmeta pm ON p.ID = pm.post_id ";
    821         $query.= "WHERE post_type = 'shop_order' AND p.post_status!='wc-completed' AND pm.meta_key = '_billing_email' AND pm.meta_value != '' ";
     848        $query.= "WHERE post_type = 'shop_order' AND pm.meta_key = '_billing_email' AND pm.meta_value != '' ";
    822849        $query.= $condition_orders;
    823850        $query.= "ORDER BY p.ID ASC LIMIT 150";
     
    914941     */
    915942    public function show_admin_notice() {
    916         $class = $this->admin_notice[0];
    917         $text = $this->admin_notice[1];
     943        if(isset($this->admin_notice[0]))           $class = $this->admin_notice[0];
     944        if(isset($this->admin_notice[1]))           $text = $this->admin_notice[1];
    918945        if( !empty($class) && !empty($text) ){
    919946            ?>
     
    937964        //Map default fields.
    938965        foreach($order_data as $key=>$fieldgroup){
    939             if( $key === 'shipping' || $key === 'billing' ){   
     966            if( $key === 'shipping' || $key === 'billing'){
    940967                foreach($fieldgroup as $fieldname=>$v){
    941968                    $f = $key.'_'.$fieldname;
     
    966993            }
    967994        }
     995
     996        if(!empty($fields_map)){
     997            foreach($fields_map as $wc_field=>$dplr_field){
     998                // changes requested on ticket ID:1009
     999                if(!empty($dplr_field)){
     1000                    if($wc_field == 'product_total'){       
     1001                        $fields[] = array('name'=>$dplr_field, 'value'=>$order->get_total());
     1002                    }
     1003                    else if($wc_field == 'product_date'){       
     1004                        $fields[] = array('name'=>$dplr_field, 'value'=>$order->get_date_created()->format('Y-m-d'));
     1005                    }
     1006                    else if($wc_field == 'product_names'){
     1007                        $items = $order->get_items();
     1008                        foreach ($items as $item_id => $item) {
     1009                            $product_names[] = $item->get_name();
     1010                        }
     1011                        $product_names_st = implode(', ', $product_names);
     1012                        $fields[] = array('name'=>$dplr_field, 'value'=>$product_names_st);
     1013                    }
     1014                }
     1015            }
     1016        }
     1017       
    9681018        return $fields;
    9691019    }
     
    12351285        <?php
    12361286    }
     1287
     1288   
    12371289}
  • doppler-for-woocommerce/trunk/admin/css/doppler-for-woocommerce-admin.css

    r2326627 r2971479  
    2222  font-weight: 700;
    2323  display: inline-block; }
     24
     25.mapping-th-left {
     26  width: 60%;
     27}
    2428
    2529/**
  • doppler-for-woocommerce/trunk/admin/partials/mapping.php

    r2753293 r2971479  
    4646                                        _e('Account fields', 'doppler-for-woocommerce');
    4747                                        break;
     48                                    case 'product':
     49                                        _e('Last purchase fields', 'doppler-for-woocommerce');
     50                                        break;
    4851                                    default:
    4952                                        echo esc_html($fieldtype);
     
    5457                        </tr>
    5558                        <tr>
    56                                 <th class="text-left pt-1 pb-1"><?php _e('WooCommerce Fields','doppler-for-woocommerce') ?></th>
     59                                <th class="mapping-th-left text-left pt-1 pb-1"><?php _e('WooCommerce Fields','doppler-for-woocommerce') ?></th>
    5760                                <th class="text-left pt-1 pb-1"><?php _e('Doppler Fields', 'doppler-for-woocommerce') ?></th>
    5861                        </tr>
     
    6770                        ?>
    6871                            <tr>
    69                                 <td><?php echo $fieldAtributes['label']?></td>
     72                                <td>
     73                                    <?php
     74                                    if($fieldtype==='product'):
     75                                        _e($fieldAtributes['label'], 'doppler-for-woocommerce');   
     76                                    else:
     77                                         echo $fieldAtributes['label'];
     78                                    endif; ?>
     79                                </td>
    7080                                <td>
    7181                                    <select class="dplrwoo-mapping-fields" name="dplrwoo_mapping[<?php echo $fieldname?>]" data-type="<?php if (isset($fieldAtributes['type'])) echo $fieldAtributes['type'] ?>">
  • doppler-for-woocommerce/trunk/doppler-for-woocommerce.php

    r2897829 r2971479  
    1717 * Plugin URI:        https://www.fromdoppler.com/
    1818 * Description:       Connect your WooCommerce customers with your Doppler Lists.
    19  * Version:           1.1.7
     19 * Version:           1.2.0
    2020 * Author:            Doppler LLC
    2121 * License:           GPL-2.0+
     
    3535 * Rename this for your plugin and update it as you release new versions.
    3636 */
    37 define( 'DOPPLER_FOR_WOOCOMMERCE_VERSION', '1.1.7' );
     37define( 'DOPPLER_FOR_WOOCOMMERCE_VERSION', '1.2.0' );
    3838define( 'DOPPLER_FOR_WOOCOMMERCE_URL', plugin_dir_url(__FILE__));
    3939define( 'DOPPLER_FOR_WOOCOMMERCE_PLUGIN_DIR_PATH', plugin_dir_path( __FILE__ ));
  • doppler-for-woocommerce/trunk/languages/doppler-for-woocommerce-es_AR.po

    r2753293 r2971479  
    271271msgstr "Campos de Cuenta"
    272272
     273#: admin/partials/mapping.php:49
     274msgid "Last purchase fields"
     275msgstr "Campos de Ultima Compra"
     276
    273277#: admin/partials/mapping.php:56
    274278msgid "WooCommerce Fields"
     
    278282msgid "Doppler Fields"
    279283msgstr "Campos de Doppler"
     284
     285#: admin/partials/mapping.php:75
     286msgid "Products"
     287msgstr "Productos"
     288
     289#: admin/partials/mapping.php:75
     290msgid "Total amount"
     291msgstr "Monto total"
     292
     293#: admin/partials/mapping.php:75
     294msgid "Date of purchase"
     295msgstr "Fecha de compra"
    280296
    281297#: admin/partials/mapping.php:111
  • doppler-for-woocommerce/trunk/languages/doppler-for-woocommerce-es_ES.po

    r2753293 r2971479  
    271271msgstr "Campos de Cuenta"
    272272
     273#: admin/partials/mapping.php:49
     274msgid "Last purchase fields"
     275msgstr "Campos de Ultima Compra"
     276
    273277#: admin/partials/mapping.php:56
    274278msgid "WooCommerce Fields"
     
    278282msgid "Doppler Fields"
    279283msgstr "Campos de Doppler"
     284
     285#: admin/partials/mapping.php:75
     286msgid "Products"
     287msgstr "Productos"
     288
     289#: admin/partials/mapping.php:75
     290msgid "Total amount"
     291msgstr "Monto total"
     292
     293#: admin/partials/mapping.php:75
     294msgid "Date of purchase"
     295msgstr "Fecha de compra"
    280296
    281297#: admin/partials/mapping.php:111
     
    397413#~ msgid "It'll be deleted and can't be recovered."
    398414#~ msgstr "Será eliminada y no puede ser recuperada."
     415
     416#~ msgid "Products"
     417#~ msgstr "Productos"
     418
     419#~ msgid "Total amount"
     420#~ msgstr "Monto total"
     421
     422#~ msgid "Date of purchase"
     423#~ msgstr "Fecha de compra"
  • doppler-for-woocommerce/trunk/languages/doppler-for-woocommerce.pot

    r2326627 r2971479  
    340340msgstr ""
    341341
     342#: admin/partials/mapping.php:49
     343msgid "Last purchase fields"
     344msgstr ""
     345
    342346#: admin/partials/mapping.php:56
    343347msgid "WooCommerce Fields"
     
    348352msgstr ""
    349353
     354#: admin/partials/mapping.php:75
     355msgid "Products"
     356msgstr ""
     357
     358#: admin/partials/mapping.php:75
     359msgid "Total amount"
     360msgstr ""
     361
     362#: admin/partials/mapping.php:75
     363msgid "Date of purchase"
     364msgstr ""
     365
    350366#: doppler-for-woocommerce.php:56
    351367msgid ""
Note: See TracChangeset for help on using the changeset viewer.