{"id":7658,"date":"2023-08-11T16:16:54","date_gmt":"2023-08-11T23:16:54","guid":{"rendered":"https:\/\/membermouse.com\/?post_type=ht_kb&#038;p=7658"},"modified":"2024-08-12T12:41:08","modified_gmt":"2024-08-12T16:41:08","slug":"personnaliser-les-messages-derreur-sur-la-page-de-paiement","status":"publish","type":"ht_kb","link":"https:\/\/membermouse.com\/fr\/docs\/customize-error-messages-on-the-checkout-page\/","title":{"rendered":"Personnaliser les messages d'erreur sur la page de paiement"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><em><strong>Note:\u00a0<\/strong>This solution is a legacy article for versions 2.00 to 3.0.5. Versions 3.0.6 and newer should be translated normally using <a href=\"https:\/\/membermouse.com\/docs\/translate-membermouse-basic\/\" target=\"_blank\" rel=\"noopener\" title=\"\">Loco Translate<\/a> or the standard <\/em><a href=\"https:\/\/membermouse.com\/docs\/translate-membermouse-advanced\/\" target=\"_blank\" rel=\"noopener\" title=\"\"><em>PO<\/em>\/MO translation files.<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you're using the\u00a0MM_Form_Message type='error'\u00a0SmartTag on your checkout page, this SmartTag\u2122 is responsible for outputting any error messages that come from MemberMouse. The exact error message that should be displayed is passed to the checkout page via the URL query string in the\u00a0&#8216;message'\u00a0parameter:<br><br><img decoding=\"async\" class=\"wp-image-11174\" style=\"width: 700px;\" src=\"https:\/\/storage.googleapis.com\/wpgcbucket\/wp\/2023\/10\/d77be2ec-checkout-custom-error-1.png\" alt=\"\"><br><br><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Since the error message is passed through the query string, it's stored in the PHP &#8216;$_GET' array and can be accessed in PHP as follows: &#8216;$_GET[&#8216;message']'.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you are technically inclined, you can write code to detect particular messages coming from MemberMouse. If you'd like to change them, you can set the new message in the\u00a0&#8216;$_GET'\u00a0array.<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><code>$_GET['message'] = \"This is my custom error message\";<\/code><\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">You'll just need to make sure you do this early enough in the page execution such that it happens before the MemberMouse&nbsp;MM_Form_Message type='error'&nbsp;SmartTag attempts to display the message on the screen.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In order to get a head start on this process, we have included this&nbsp;<a href=\"https:\/\/drive.google.com\/file\/d\/1X6nLcBxpI2yxV-KUOTDeRmYrzRiTQ5ZM\/view?usp=drive_link\" data-type=\"link\" data-id=\"https:\/\/drive.google.com\/file\/d\/1X6nLcBxpI2yxV-KUOTDeRmYrzRiTQ5ZM\/view?usp=drive_link\" target=\"_blank\" rel=\"noreferrer noopener\">Sample Script<\/a>&nbsp;for you as mentioned above.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Below is a list of some of the possible error messages MemberMouse may present.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em><strong>Note:<\/strong>&nbsp;This is only a partial list as an example of messages your users may see:<\/em><\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>Type<\/strong><\/td><td><strong>Messages<\/strong><\/td><\/tr><tr><td>message<\/td><td>Invalid username or password.<\/td><\/tr><tr><td>message<\/td><td>Your card number is incorrect.<\/td><\/tr><tr><td>message<\/td><td>This product can only be purchased once. To gain the same access, please purchase the alternate product shown below.<\/td><\/tr><tr><td>message<\/td><td>Invalid captcha entry<\/td><\/tr><tr><td>message<\/td><td>You don't have permission to place an order for another user<\/td><\/tr><tr><td>message<\/td><td>Cannot complete order. Membership level ID is not valid.<\/td><\/tr><tr><td>message<\/td><td>Cannot complete order. Membership level is not active.<\/td><\/tr><tr><td>message<\/td><td>Payment Service is not configured for this site.<\/td><\/tr><tr><td>message<\/td><td>No onsite or off site payment methods are configured for this site<\/td><\/tr><tr><td>message<\/td><td>You must be logged into your account in order to succesfully checkout<\/td><\/tr><tr><td>message<\/td><td>You don't have sufficient permissions to place an order for another user.<\/td><\/tr><tr><td>message<\/td><td>An account with that email already exists.<\/td><\/tr><tr><td>message<\/td><td>Cannot complete order. Product is not available.<\/td><\/tr><tr><td>message<\/td><td>You must be logged in to purchase a gift.<\/td><\/tr><tr><td>message<\/td><td>Error creating free account.<\/td><\/tr><tr><td>message<\/td><td>Payment for order number was successful but there was an error granting access to your content<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Note : Cette solution est un article ancien pour les versions 2.00 \u00e0 3.0.5. Les versions 3.0.6 et plus r\u00e9centes doivent \u00eatre traduites normalement en utilisant Loco Translate ou les fichiers de traduction PO\/MO standard. Si vous...<\/p>","protected":false},"author":20918,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"_acf_changed":false,"om_disable_all_campaigns":false,"_strive_editorial_status":"not-started","_strive_copy_of":0,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"ht-kb-category":[138],"ht-kb-tag":[],"class_list":["post-7658","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-tips-tricks"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/membermouse.com\/fr\/wp-json\/wp\/v2\/ht-kb\/7658","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/membermouse.com\/fr\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/membermouse.com\/fr\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/membermouse.com\/fr\/wp-json\/wp\/v2\/users\/20918"}],"replies":[{"embeddable":true,"href":"https:\/\/membermouse.com\/fr\/wp-json\/wp\/v2\/comments?post=7658"}],"version-history":[{"count":0,"href":"https:\/\/membermouse.com\/fr\/wp-json\/wp\/v2\/ht-kb\/7658\/revisions"}],"wp:attachment":[{"href":"https:\/\/membermouse.com\/fr\/wp-json\/wp\/v2\/media?parent=7658"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/membermouse.com\/fr\/wp-json\/wp\/v2\/ht-kb-category?post=7658"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/membermouse.com\/fr\/wp-json\/wp\/v2\/ht-kb-tag?post=7658"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}