Changeset 2866642
- Timestamp:
- 02/16/2023 08:19:58 PM (2 years ago)
- Location:
- maldita-inflacion
- Files:
-
- 25 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
maldita-inflacion/trunk/malinf.php
r2828612 r2866642 10 10 * Description: Cambia automaticamente los precios de tu tienda en base al cambio oficial / blue del dolar 11 11 * Name: Sarmiento 12 * Version: 1.0. 012 * Version: 1.0.3 13 13 * Author: Sebastopolys 14 14 * Author URI: https://digitalek.com/ -
maldita-inflacion/trunk/malinfConfig.php
r2839370 r2866642 23 23 } 24 24 } 25 25 26 27 26 28 public static function plname(){ 27 29 self::$plname = 'Maldita Inflacion'; … … 31 33 } 32 34 private static function plvers(){ 33 self::$plvers = '1.0. 0';35 self::$plvers = '1.0.3'; 34 36 } 35 37 private static function dbvers(){ -
maldita-inflacion/trunk/readme.txt
r2841204 r2866642 6 6 Tested up to: 6.1 7 7 Requires PHP: 7.4 8 Stable tag: 1.0. 08 Stable tag: 1.0.3 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 66 66 * Soporte para precios rebajados (SALE) 67 67 68 =1.0.3= 69 * Optmizacion de codigo 70 * Valores por defecto de las opciones backend 68 71 72 -
maldita-inflacion/trunk/scripts/css/malinf-back.css
r2809228 r2866642 34 34 margin-left: 2px; 35 35 } 36 -
maldita-inflacion/trunk/src/backend/malinf-malinfAdminpage.php
r2841204 r2866642 9 9 private $output = null; 10 10 11 public function printA($ops,$api){ 11 public function printA($ops,$api){ 12 12 13 $ops = json_decode($ops); 13 14 $api = json_decode($api); -
maldita-inflacion/trunk/src/backend/malinfWelcomePage.html
r2841204 r2866642 104 104 </p> 105 105 106 <p><i>V 1.0.3</i></p> 107 -
maldita-inflacion/trunk/src/malinf-malinfInit.php
r2841204 r2866642 26 26 $this->mpags = new malinfAdminmenu(); 27 27 $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 29 45 // $this->apir = get_option('malinf_apival'); 30 46 31 47 $this->adp = new malinfAdminpost(); 32 $this->cron = new malinfCrontask($this->bkop);48 33 49 $this->pag = new malinfGetplpage(); 34 50 } … … 39 55 add_action('admin_init',[$this,'editmetapr']); 40 56 // 41 $this->cron->startcron($this->bkop); 57 if(!null==$this->bkop){ 58 $this->cron->startcron($this->bkop); 59 } 42 60 $this->adp->postform(); 43 61 } -
maldita-inflacion/trunk/src/prices/malinf-malinfHookprice.php
r2841204 r2866642 13 13 private $metop = []; 14 14 private $bkop = []; 15 private $apirp = null; 15 16 16 17 public function __construct($bkop){ 17 18 $this->apir = new malinfResponse(); 18 $this->bkop = $bkop; 19 $this->bkop = $bkop; 20 $this->apirp = $this->tipodec(); 19 21 } 20 22 … … 30 32 'post_status' => 'publish', 31 33 '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 33 41 foreach ( $all_ids as $id ) { 34 42 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)); 36 44 } 37 45 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 } 40 49 } 41 50 } 42 51 } 43 52 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){ 54 54 // 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 59 59 // mode 60 if($b =='api'){60 if($bak->modo =='api'){ 61 61 $dummy = $meta*$val; 62 62 } 63 if($b =='manual'){63 if($bak->modo =='manual'){ 64 64 $dummy = $meta*$bak->manual; 65 65 } 66 if($b =='disabled'||null==$b) return;66 67 67 // round 68 68 $pri = $dummy/$bak->alcanc;
Note: See TracChangeset
for help on using the changeset viewer.