Plugin Directory

Changeset 2866642


Ignore:
Timestamp:
02/16/2023 08:19:58 PM (2 years ago)
Author:
sebastopolys
Message:

update 1.0.3

Location:
maldita-inflacion
Files:
25 added
8 edited

Legend:

Unmodified
Added
Removed
  • maldita-inflacion/trunk/malinf.php

    r2828612 r2866642  
    1010 * Description:       Cambia automaticamente los precios de tu tienda en base al cambio oficial / blue del dolar
    1111 * Name:              Sarmiento
    12  * Version:           1.0.0
     12 * Version:           1.0.3
    1313 * Author:            Sebastopolys
    1414 * Author URI:        https://digitalek.com/
  • maldita-inflacion/trunk/malinfConfig.php

    r2839370 r2866642  
    2323        }
    2424    }
    25        
     25
     26
     27   
    2628    public static function plname(){
    2729        self::$plname = 'Maldita Inflacion';       
     
    3133    }
    3234    private static function plvers(){
    33         self::$plvers = '1.0.0';       
     35        self::$plvers = '1.0.3';       
    3436    }
    3537    private static function dbvers(){
  • maldita-inflacion/trunk/readme.txt

    r2841204 r2866642  
    66Tested up to: 6.1
    77Requires PHP: 7.4
    8 Stable tag: 1.0.0
     8Stable tag: 1.0.3
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6666* Soporte para precios rebajados (SALE)
    6767
     68=1.0.3=
     69* Optmizacion de codigo
     70* Valores por defecto de las opciones backend
    6871
     72
  • maldita-inflacion/trunk/scripts/css/malinf-back.css

    r2809228 r2866642  
    3434    margin-left: 2px;
    3535}
     36 
  • maldita-inflacion/trunk/src/backend/malinf-malinfAdminpage.php

    r2841204 r2866642  
    99    private $output = null;     
    1010
    11     public function printA($ops,$api){   
     11    public function printA($ops,$api){
     12   
    1213        $ops = json_decode($ops);
    1314        $api = json_decode($api);     
  • maldita-inflacion/trunk/src/backend/malinfWelcomePage.html

    r2841204 r2866642  
    104104</p>
    105105
     106<p><i>V 1.0.3</i></p>
     107
  • maldita-inflacion/trunk/src/malinf-malinfInit.php

    r2841204 r2866642  
    2626        $this->mpags = new malinfAdminmenu();         
    2727        $this->bkop = get_option('malinf_bkops');
    28         $this->hopr = new malinfHookprice($this->bkop);
     28        if(!null==$this->bkop){
     29            $this->hopr = new malinfHookprice($this->bkop);
     30            $this->cron = new malinfCrontask($this->bkop);
     31        }
     32        else{           
     33            $def_ops = [
     34                "modo"=>"disabled",
     35                "actual"=>1,
     36                "tipodc"=>"blue",
     37                "manual"=>1,
     38                "redond"=>"up",
     39                "alcanc"=>10
     40                ];
     41                $json = json_encode($def_ops);
     42                add_option('malinf_bkops',$json);           
     43        }
     44       
    2945      //  $this->apir = get_option('malinf_apival');
    3046         
    3147        $this->adp = new malinfAdminpost();
    32         $this->cron = new malinfCrontask($this->bkop);
     48       
    3349        $this->pag = new malinfGetplpage();
    3450    }
     
    3955        add_action('admin_init',[$this,'editmetapr']);
    4056        //
    41         $this->cron->startcron($this->bkop);           
     57        if(!null==$this->bkop){
     58            $this->cron->startcron($this->bkop);           
     59        }
    4260        $this->adp->postform();       
    4361    }
  • maldita-inflacion/trunk/src/prices/malinf-malinfHookprice.php

    r2841204 r2866642  
    1313    private $metop = [];
    1414    private $bkop = [];
     15    private $apirp = null;
    1516
    1617    public function __construct($bkop){       
    1718        $this->apir = new malinfResponse(); 
    18         $this->bkop = $bkop;   
     19        $this->bkop = $bkop;
     20        $this->apirp =  $this->tipodec();
    1921    }
    2022
     
    3032            'post_status' => 'publish',
    3133            'fields' => 'ids',
    32         ));
     34        ));
     35        $bok = json_decode($this->bkop);
     36         
     37        $mod = $bok->modo;
     38       
     39        if($mod =='disabled'||null==$bok||null==$mod) return;   
     40 
    3341        foreach ( $all_ids as $id ) {
    3442            if(get_post_meta( $id, 'malinf_meta', true )){                 
    35                 if($this->priceloop(get_post_meta( $id, 'malinf_meta', true ),$id));
     43                if($this->priceloop(get_post_meta( $id, 'malinf_meta', true ),$id,$bok));
    3644            }
    3745            else{
    38                 $rpr = get_post_meta($id,'_regular_price');
    39                 if(update_post_meta($id,'_price',$rpr[0]));
     46                if(get_post_meta($id,'_regular_price')){
     47                    update_post_meta($id,'_price',$rpr[0]);
     48                }
    4049            }                 
    4150        }         
    4251    }   
    4352
    44     public function postapi(){       
    45         $bak = json_decode($this->bkop);
    46         $pos = sanitize_key($_POST['malinf-convert']);
    47         if(isset($pos)           
    48             &&esc_attr($bak->modo)!=='disabled'){                 
    49                 $this->start();
    50         }
    51     }   
    52 
    53     public function priceloop($meta,$id){
     53    public function priceloop($meta,$id,$bak){
    5454        // change price on database       
    55         $bak = json_decode($this->bkop);
    56         if(null==$bak) return;     
    57         $val = intval($this->tipodec());
    58         $b = $bak->modo;
     55       
     56   
     57        $val = intval($this->apirp);
     58       
    5959            // mode           
    60             if($b =='api'){
     60            if($bak->modo =='api'){
    6161                $dummy = $meta*$val;
    6262            }
    63             if($b =='manual'){
     63            if($bak->modo =='manual'){
    6464                $dummy = $meta*$bak->manual;
    6565            }
    66             if($b =='disabled'||null==$b) return;   
     66     
    6767            // round
    6868            $pri = $dummy/$bak->alcanc;
Note: See TracChangeset for help on using the changeset viewer.