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
|
@@ -2963,7 +2963,7 @@ let IpService = class IpService {
|
|
|
2963
2963
|
constructor(http) {
|
|
2964
2964
|
this.http = http;
|
|
2965
2965
|
this.apiGetIp = 'https://api64.ipify.org?format=json'; // También puedes usar 'https://api.myip.com'
|
|
2966
|
-
this.apiGetLocation = '
|
|
2966
|
+
this.apiGetLocation = 'https://ipinfo.io/json';
|
|
2967
2967
|
}
|
|
2968
2968
|
getIp() {
|
|
2969
2969
|
return this.http.get(this.apiGetIp);
|
|
@@ -3041,18 +3041,16 @@ let CheckoutService = class CheckoutService {
|
|
|
3041
3041
|
this.stateSubject.next(final_steps);
|
|
3042
3042
|
// Obtener IP y ubicación
|
|
3043
3043
|
forkJoin({
|
|
3044
|
-
ip: this.ipService.getIp(),
|
|
3045
|
-
location: this.ipService.getLocation()
|
|
3044
|
+
ip: this.ipService.getIp().pipe(catchError(() => of(null))),
|
|
3045
|
+
location: this.ipService.getLocation().pipe(catchError(() => of(null)))
|
|
3046
3046
|
}).subscribe(results => {
|
|
3047
3047
|
var _a, _b, _c;
|
|
3048
3048
|
const params = {
|
|
3049
|
-
ip: (_a = results.ip) === null || _a === void 0 ? void 0 : _a.ip,
|
|
3050
|
-
country: (_b = results.location) === null || _b === void 0 ? void 0 : _b.country,
|
|
3051
|
-
city: (_c = results.location) === null || _c === void 0 ? void 0 : _c.city
|
|
3049
|
+
ip: ((_a = results.ip) === null || _a === void 0 ? void 0 : _a.ip) || 'unknown',
|
|
3050
|
+
country: ((_b = results.location) === null || _b === void 0 ? void 0 : _b.country) || 'unknown',
|
|
3051
|
+
city: ((_c = results.location) === null || _c === void 0 ? void 0 : _c.city) || 'unknown'
|
|
3052
3052
|
};
|
|
3053
|
-
// Convertir los datos a una cadena de consulta
|
|
3054
3053
|
const queryString = new URLSearchParams(params).toString();
|
|
3055
|
-
// Agregar la cadena de consulta a la URL del endpoint
|
|
3056
3054
|
const urlWithParams = `${this.getHasPurchaseConditions()}?${queryString}`;
|
|
3057
3055
|
this.connection.getErrorNotHandler(urlWithParams).toPromise().then(res => {
|
|
3058
3056
|
var _a, _b;
|
|
@@ -5858,6 +5856,7 @@ let ContactFormNewsEcComponent = class ContactFormNewsEcComponent extends Compon
|
|
|
5858
5856
|
this.codeBlock = 'newsletter_block';
|
|
5859
5857
|
this.blocks = [];
|
|
5860
5858
|
this.blockContact = null;
|
|
5859
|
+
this.params = {};
|
|
5861
5860
|
this.form_data = {};
|
|
5862
5861
|
this.sendForm = (form, success_message) => {
|
|
5863
5862
|
console.log('enviando...');
|
|
@@ -5917,6 +5916,7 @@ let ContactFormNewsEcComponent = class ContactFormNewsEcComponent extends Compon
|
|
|
5917
5916
|
ngOnChanges() {
|
|
5918
5917
|
}
|
|
5919
5918
|
ngOnInit() {
|
|
5919
|
+
this.paramsService.parameters.subscribe(res => this.params = res);
|
|
5920
5920
|
if (!this.block) {
|
|
5921
5921
|
this.blocksService.getBlocks('home');
|
|
5922
5922
|
this.blocksService.blocks.pipe(filter((blocks) => (blocks && blocks.length > 0))).subscribe(blocks => {
|