Changeset 2761922
- Timestamp:
- 07/26/2022 04:13:47 PM (4 years ago)
- Location:
- perseo-software/trunk
- Files:
-
- 4 edited
-
PluginPerseo.php (modified) (4 diffs)
-
README.md (modified) (2 diffs)
-
includes/PluginPerseo_cron.php (modified) (4 diffs)
-
includes/PluginPerseo_master.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
perseo-software/trunk/PluginPerseo.php
r2727087 r2761922 4 4 Plugin URI: https://perseo.ec/ 5 5 Description: Este Plugins integra el Sistema Contable Perseo Web y PC con la tienda Woocommerce 6 Version: 2 2.06 Version: 23.0 7 7 Author: Perseo Soft S.A. - Ecuador 8 8 Author URI: https://perseo.ec … … 144 144 } 145 145 settings_errors('eperseo_verificacion'); 146 147 148 149 150 146 /////////////////////////////////////////////////////////////////////// 151 147 //llamamos a la pag de secciones … … 156 152 $perseo_config = PERSEOCONFIGBASE; //VARIABLE DEFINIDA DE CONFIGURACION BASE DE DATOS 157 153 if (!empty($perseo_config['perseotoken'])) { 158 submit_button('Guardar Cambios ','primary','submit', true, array( 'onclick' => 'perseoprogress()' ));154 submit_button('Guardar Cambios Parametrizacion','primary','submit', true, array( 'onclick' => 'perseoprogress()' )); 159 155 160 156 }else{ 161 submit_button('Guardar Cambios ','primary','submit', true,'disabled');157 submit_button('Guardar Cambios Parametrizacion','primary','submit', true,'disabled'); 162 158 } 163 164 159 echo "</form>"; 165 160 … … 830 825 831 826 827 832 828 ///////////////////////////////////// 833 829 //libreria js -
perseo-software/trunk/README.md
r2727055 r2761922 5 5 Tags: auto publish, content marketing 6 6 Requires at least: 1.1 7 Tested up to: 5.97 Tested up to: 6.1 8 8 Requires PHP: 7.4 9 9 Stable tag: 1.1 … … 48 48 1. perseo-1.jpg 49 49 == Changelog == 50 = 23.0 = 51 * Actualizacion precios . 52 50 53 = 22.0 = 51 54 * Actualizacion . 55 52 56 == Changelog == 53 57 = 21.0 = -
perseo-software/trunk/includes/PluginPerseo_cron.php
r2729580 r2761922 682 682 'contenido' =>'' 683 683 ]; 684 //print_r(wp_json_encode($perseo_bodyproducto)); 685 echo "<br>"; 684 686 $perseo_responseproducto = wp_remote_post($perseo_urlproducto, 685 687 array( … … 692 694 'body' => wp_json_encode($perseo_bodyproducto)) 693 695 ); 694 //print_r($perseo_responseproducto['body']);696 // print_r($perseo_responseproducto['body']); 695 697 if (! empty($perseo_responseproducto)){ 696 698 $perseo_datosProductos = json_decode($perseo_responseproducto['body'],true); … … 1169 1171 if (isset($tarifa)) 1170 1172 { 1173 1171 1174 //$perseo_iva= ($producto['porcentajeiva']/100)+1; 1172 1175 … … 1532 1535 } 1533 1536 1537 public function fperseo_ActualizarTarifas(){ 1538 // echo '<br>- consulta stock del producto desde aqui- <br>'; 1539 global $wpdb; 1540 global $table_prefix; 1541 $perseo_config =get_option('pluginperseo_configuracion'); 1542 $perseo_parametros =get_option('pluginperseo_parametros'); 1543 1544 1545 ////////////////////////////////// 1546 //mostramos el codigo del producto para traer tarifa mediante consultas 1547 $ConsultaProducstock=$wpdb->get_results("SELECT product_id FROM {$table_prefix}wc_product_meta_lookup "); 1548 //print_r($ConsultaProducstock); 1549 //echo '<br>- consulta <br>'; 1550 if( ! empty($ConsultaProducstock)){ 1551 1552 foreach ($ConsultaProducstock as $DatProd){ 1553 $perseo_totalstock= 0; 1554 //consulta id del producto 1555 //echo 'ID woocommerce '; 1556 //echo $DatProd -> product_id; 1557 //echo '<br><br>'; 1558 1559 $ConsultaProductoUpd = $DatProd -> product_id; 1560 //echo $ConsultaProductoUpd; 1561 $ConsultaProducstock=$wpdb->get_var("SELECT meta_value FROM {$table_prefix}postmeta where meta_key ='_product_attributes' and post_id=".$DatProd -> product_id); 1562 $perseo_codigoprodstock= unserialize($ConsultaProducstock); 1563 //print_r($perseo_codigoprodstock); 1564 //echo '<br>'; 1565 if (isset($perseo_codigoprodstock['ID_Perseo']['value'])){ 1566 $perseo_codigostock=$perseo_codigoprodstock['ID_Perseo']['value']; 1567 }else{ 1568 $perseo_codigostock=$perseo_codigoprodstock['id_perseo']['value']; 1569 }; 1570 1571 //echo $perseo_codigoprodstock['ID_Perseo']['value']; 1572 //echo ' - ID perseo<br>'; 1573 //echo '<br>'; 1574 ///////////////////////////////////// 1575 //Verificar pc o web 1576 if ($perseo_config['perseotiposoftware']=='WEB'){ 1577 $perseo_urlproducto =$perseo_config['perseoservidor'].'/api/productos_consulta'; 1578 }else{ 1579 $perseo_urlproducto =$perseo_config['perseocertificado'].'://'.$perseo_config['perseoip'].'/api/productos_consulta'; 1580 }; 1581 // echo "<br>- Producto---<br> "; 1582 //echo $perseo_urlproducto; 1583 $perseo_bodyproducto = ['api_key' => $perseo_config['perseotoken'], 1584 'productosid' => $perseo_codigostock, 1585 'productocodigo'=>'', 1586 'barras' =>'', 1587 'contenido' =>'' 1588 ]; 1589 //print_r(wp_json_encode($perseo_bodyproducto)); 1590 //echo "<br>"; 1591 $perseo_responseproducto = wp_remote_post($perseo_urlproducto, 1592 array( 1593 'method' => 'POST', 1594 'timeout' => 55000, 1595 'redirection' => 5, 1596 'httpversion' => '1.0', 1597 'blocking' => true, 1598 'headers' => array( 'Content-Type'=> 'application/json' ), 1599 'body' => wp_json_encode($perseo_bodyproducto)) 1600 ); 1601 // print_r($perseo_responseproducto['body']); 1602 if (! empty($perseo_responseproducto)){ 1603 $perseo_datosProductos = json_decode($perseo_responseproducto['body'],true); 1604 // print_r($perseo_datosProductos['productos']); 1605 //echo "<br>"; echo "<br>"; 1606 foreach($perseo_datosProductos['productos'] as $producto) 1607 { 1608 foreach($producto['tarifas'] as $tarifa) 1609 { 1610 //print_r($tarifa); 1611 //echo "<br>"; 1612 if (isset($tarifa)) 1613 { 1614 1615 //$perseo_iva= ($producto['porcentajeiva']/100)+1; 1616 //// Si tuviera los mismos precios eliminar la promocion 1617 if($perseo_parametros['perseotarifaVenta']==$perseo_parametros['perseotarifaAumento']){ 1618 if($perseo_parametros['perseotarifaVenta']==$tarifa['tarifasid']) 1619 { 1620 $perseo_tarifaventa=round($tarifa['precio'],2); 1621 update_post_meta($ConsultaProductoUpd, '_price', $perseo_tarifaventa); 1622 update_post_meta($ConsultaProductoUpd, '_sale_price', $perseo_tarifaventa ); 1623 update_post_meta($ConsultaProductoUpd, '_regular_price', $perseo_tarifaventa ); 1624 }; 1625 1626 }else{ 1627 if($perseo_parametros['perseotarifaVenta']==$tarifa['tarifasid']) 1628 { 1629 $perseo_tarifaventa=round($tarifa['precio'],2); 1630 //echo $perseo_tarifaventa; 1631 //echo "<br>"; 1632 update_post_meta($ConsultaProductoUpd, '_price', $perseo_tarifaventa); 1633 update_post_meta($ConsultaProductoUpd, '_sale_price', $perseo_tarifaventa ); 1634 //update_post_meta($ConsultaProductoUpd, '_regular_price', $perseo_tarifaventa ); 1635 1636 /////////////////////////////////////////////////// 1637 //insertamos Nuevo producto CUARTA TABLA plugin_wc_product_meta_lookup 1638 $wpdb->update($table_prefix.'wc_product_meta_lookup', 1639 array('max_price' => $perseo_tarifaventa ), 1640 array('product_id' => $ConsultaProductoUpd) 1641 ); 1642 1643 }; 1644 //precio 2 1645 if($perseo_parametros['perseotarifaAumento']==$tarifa['tarifasid']) 1646 { 1647 $perseo_tarifaaumento =round($tarifa['precio'],2); 1648 update_post_meta($ConsultaProductoUpd, '_price', $perseo_tarifaaumento); 1649 update_post_meta($ConsultaProductoUpd, '_sale_price', $perseo_tarifaaumento); 1650 1651 /////////////////////////////////////////////////// 1652 //insertamos Nuevo producto CUARTA TABLA plugin_wc_product_meta_lookup 1653 $wpdb->update($table_prefix.'wc_product_meta_lookup', 1654 array('min_price' => $perseo_tarifaaumento), 1655 array('product_id' => $ConsultaProductoUpd) 1656 ); 1657 1658 }; 1659 }; 1660 1661 }; 1662 1663 1664 1665 } 1666 } 1667 }; 1668 1669 1670 } 1671 }; 1672 } 1673 1534 1674 public function fperseo_inicializador() { 1535 1675 //elimina el cron -
perseo-software/trunk/includes/PluginPerseo_master.php
r2387291 r2761922 41 41 $this->perseo_cargador->add_action( 'perseo_cron', $this->perseo_cron, 'fperseo_stockproducto'); 42 42 $this->perseo_cargador->add_action( 'perseo_cron', $this->perseo_cron, 'fperseo_enviarclientes'); 43 $this->perseo_cargador->add_action( 'perseo_cron', $this->perseo_cron, 'fperseo_ActualizarTarifas'); 43 44 44 45 $this->perseo_cargador->add_action( 'init', $this->perseo_cron, 'fperseo_inicializador');
Note: See TracChangeset
for help on using the changeset viewer.