Skip to content
This repository has been archived by the owner on Mar 17, 2020. It is now read-only.

Fixed no alert display when no relay point selected #10

Closed

Conversation

studiokiwik
Copy link

User had possibility to continue to payment page even without relay point selected
(I think it was introduced by commit f6c3c8c, due to change of not selected value from 0 to -1)

@Quetzacoalt91
Copy link
Contributor

Hi @thoma202,

Can I have your opinion on this PR ?

@ghost
Copy link

ghost commented Nov 18, 2015

Hello,

Use a javascript alert is a bad way to block an action.

In my mondial.js i change :

            // If MR carrier selected, check MR relay point is selected too
            $('input[name=processCarrier], button[name=processCarrier]').click(function(){  
                var _return = !(PS_MRSelectedRelayPoint['carrier_id'] && !PS_MRSelectedRelayPoint['relayPointNum']);
                if (!_return)
                    alert(PS_MRTranslationList['errorSelection']);

                return _return;
            });

By

            // If MR carrier selected, check MR relay point is selected too
            $('input[name=processCarrier], button[name=processCarrier]').click(function(){  
                var _return = !(PS_MRSelectedRelayPoint['carrier_id'] && !PS_MRSelectedRelayPoint['relayPointNum']);
                if (!_return)
                {
                    console.log(' Check2 ');
                    // alert(PS_MRTranslationList['errorSelection']);

                    $.fancybox.open([
                            {
                            type: 'inline',
                            autoScale: true,
                            minHeight: 30,
                            content: '<p class="fancybox-error">' + PS_MRTranslationList['errorSelection'] + '</p>'
                            }],
                            {
                            padding: 0
                            });


                }                       

                carrier_check = $('input.delivery_option_radio:checked').val();                 
                carrier_find = carrier_check.replace(',', '');

                if( $('.PS_MRFloatRelayPointSelected').length == 0 &&  isMRCarrier(carrier_find) &&  _return != false) {


                        console.log(' Check3 ');
                        //alert(PS_MRTranslationList['errorSelection']);
                        $.fancybox.open([
                        {
                            type: 'inline',
                            autoScale: true,
                            minHeight: 30,
                            content: '<p class="fancybox-error">' + PS_MRTranslationList['errorSelection'] + '</p>'
                        }],
                        {
                        padding: 0
                        });



                        return false
                }

                return _return;
            });

Regards

@ghost
Copy link

ghost commented Nov 18, 2015

The PR is good it will correct any problems of this module.

En français car mon anglais est mauvais :

Ca ne corrigera pas tous les bugs avec les mauvais point relais ou les points relay fermé.

Le module mondial relay ne vérifie pas si un point est sélectionné sur la page.

Je m'explique je prends une livraison dans un point relais à Paris, merde je me rends compte que je serais à Toulouse je change mon adresse de livraison revient sur la sélection des points relais clique sur suivant Youpy mon relay est à Paris

Encore pire je commence ma commande le matin je sélectionne un point relais, sans terminer ma commande je reviens le soir mais entre temps mondial relay envoie l'info comme quoi le point relay ferme pour diverses raisons, le point relay n'est plus affiché dans la liste mais vu que je l'ai sélectionné le matin je clique sur suivant et me voilà avec un numéro de relay fermé.

@thoma202
Copy link
Contributor

thoma202 commented Dec 4, 2015

Hi,

This should be solved already in PR 12
Sorry for the long wait

Thoma

@Quetzacoalt91
Copy link
Contributor

Hi @thoma202,

So ... No need to merge this PR ?

Thanks

@ptosent
Copy link

ptosent commented Dec 11, 2015

Hi @Quetzacoalt91,

No need to merge this PR.

We need you to merge PR #12.

Thanks.

@Quetzacoalt91
Copy link
Contributor

Hi @ptosent.

I close this PR then, thanks your your help everybody.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants