ng-easycommerce 0.0.592 → 0.0.594
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/bundles/ng-easycommerce.umd.js +8 -8
- package/bundles/ng-easycommerce.umd.js.map +1 -1
- package/bundles/ng-easycommerce.umd.min.js +1 -1
- package/bundles/ng-easycommerce.umd.min.js.map +1 -1
- package/esm2015/lib/ec-component/blocks-ec/block-newsletter-ec/contact-form-news-ec.component.js +3 -1
- package/esm2015/lib/services/checkout/checkout.service.js +8 -10
- package/esm2015/lib/services/ip-address.service.js +2 -2
- package/esm5/lib/ec-component/blocks-ec/block-newsletter-ec/contact-form-news-ec.component.js +3 -1
- package/esm5/lib/services/checkout/checkout.service.js +8 -10
- package/esm5/lib/services/ip-address.service.js +2 -2
- package/fesm2015/ng-easycommerce.js +8 -8
- package/fesm2015/ng-easycommerce.js.map +1 -1
- package/fesm5/ng-easycommerce.js +8 -8
- package/fesm5/ng-easycommerce.js.map +1 -1
- package/lib/ec-component/blocks-ec/block-newsletter-ec/contact-form-news-ec.component.d.ts +1 -0
- package/package.json +1 -1
package/fesm5/ng-easycommerce.js
CHANGED
|
@@ -3360,7 +3360,7 @@ var IpService = /** @class */ (function () {
|
|
|
3360
3360
|
function IpService(http) {
|
|
3361
3361
|
this.http = http;
|
|
3362
3362
|
this.apiGetIp = 'https://api64.ipify.org?format=json'; // También puedes usar 'https://api.myip.com'
|
|
3363
|
-
this.apiGetLocation = '
|
|
3363
|
+
this.apiGetLocation = 'https://ipinfo.io/json';
|
|
3364
3364
|
}
|
|
3365
3365
|
IpService.prototype.getIp = function () {
|
|
3366
3366
|
return this.http.get(this.apiGetIp);
|
|
@@ -3495,18 +3495,16 @@ var CheckoutService = /** @class */ (function () {
|
|
|
3495
3495
|
_this.stateSubject.next(final_steps);
|
|
3496
3496
|
// Obtener IP y ubicación
|
|
3497
3497
|
forkJoin({
|
|
3498
|
-
ip: _this.ipService.getIp(),
|
|
3499
|
-
location: _this.ipService.getLocation()
|
|
3498
|
+
ip: _this.ipService.getIp().pipe(catchError(function () { return of(null); })),
|
|
3499
|
+
location: _this.ipService.getLocation().pipe(catchError(function () { return of(null); }))
|
|
3500
3500
|
}).subscribe(function (results) {
|
|
3501
3501
|
var _a, _b, _c;
|
|
3502
3502
|
var params = {
|
|
3503
|
-
ip: (_a = results.ip) === null || _a === void 0 ? void 0 : _a.ip,
|
|
3504
|
-
country: (_b = results.location) === null || _b === void 0 ? void 0 : _b.country,
|
|
3505
|
-
city: (_c = results.location) === null || _c === void 0 ? void 0 : _c.city
|
|
3503
|
+
ip: ((_a = results.ip) === null || _a === void 0 ? void 0 : _a.ip) || 'unknown',
|
|
3504
|
+
country: ((_b = results.location) === null || _b === void 0 ? void 0 : _b.country) || 'unknown',
|
|
3505
|
+
city: ((_c = results.location) === null || _c === void 0 ? void 0 : _c.city) || 'unknown'
|
|
3506
3506
|
};
|
|
3507
|
-
// Convertir los datos a una cadena de consulta
|
|
3508
3507
|
var queryString = new URLSearchParams(params).toString();
|
|
3509
|
-
// Agregar la cadena de consulta a la URL del endpoint
|
|
3510
3508
|
var urlWithParams = _this.getHasPurchaseConditions() + "?" + queryString;
|
|
3511
3509
|
_this.connection.getErrorNotHandler(urlWithParams).toPromise().then(function (res) {
|
|
3512
3510
|
var _a, _b;
|
|
@@ -6951,6 +6949,7 @@ var ContactFormNewsEcComponent = /** @class */ (function (_super) {
|
|
|
6951
6949
|
_this.codeBlock = 'newsletter_block';
|
|
6952
6950
|
_this.blocks = [];
|
|
6953
6951
|
_this.blockContact = null;
|
|
6952
|
+
_this.params = {};
|
|
6954
6953
|
_this.form_data = {};
|
|
6955
6954
|
_this.sendForm = function (form, success_message) {
|
|
6956
6955
|
console.log('enviando...');
|
|
@@ -7012,6 +7011,7 @@ var ContactFormNewsEcComponent = /** @class */ (function (_super) {
|
|
|
7012
7011
|
};
|
|
7013
7012
|
ContactFormNewsEcComponent.prototype.ngOnInit = function () {
|
|
7014
7013
|
var _this = this;
|
|
7014
|
+
this.paramsService.parameters.subscribe(function (res) { return _this.params = res; });
|
|
7015
7015
|
if (!this.block) {
|
|
7016
7016
|
this.blocksService.getBlocks('home');
|
|
7017
7017
|
this.blocksService.blocks.pipe(filter(function (blocks) { return (blocks && blocks.length > 0); })).subscribe(function (blocks) {
|