**Configurar módulo de contadores:** Cargamos /api/contador.inc Cargamos /ecomm/contadores.php Cargamos la tabla tblmaecontadores.sql **Modificamos los siguientes archivos:** __/api/api.inc__ al principio añadir: require_once CFG_PATH_MKWEB.'/api/apicontador.inc'; en la función [[Sistemas|MKWConn]] añadimos //Contadores $this->Contador = New MKWContador(); __/api/apicompra.inc__ en funcion RegistrarCompra sustituir las líneas del principio donde generamos la variable $numero //pedido: global $GenContador; $numero = $GenContador->Contador($this->Conn, CONTADOR_PEDIDO, true, $this->Cliente->Usuario); **En el Merkagest activamos el módulo de contadores:** Configuracion: MNUECOMMERCE ID intranet: ECOMMCONTADOR Orden: El siguiente que esté libre (p.e. 50). Título: Contadores Enlace: ecomm/contadores.php **En apidefines.inc creamos las constantes:** [CONTADOR_PRODUCTO] = 'PRODUCTO'; [CONTADOR_PEDIDO] = 'PEDIDO'; [CONTADOR_FACTURA] = 'FACTURA'; [CONTADOR_CLIENTE] = 'CLIENTE'; [CONTADOR_AFILIADO] = 'AFILIADO'; [CONTADOR_PROVEEDOR] = 'PROVEEDOR'; [CONTADOR_DISTRIBUIDOR] = 'DISTRIBUIDOR';