{"id":125,"date":"2025-04-03T11:11:00","date_gmt":"2025-04-03T09:11:00","guid":{"rendered":"https:\/\/www.profi.cloud\/?p=125"},"modified":"2026-01-05T16:24:17","modified_gmt":"2026-01-05T15:24:17","slug":"prestashop5-cislovani-objednavek-na-misto-znaku-bez-pouziti-modulu","status":"publish","type":"post","link":"https:\/\/www.profi.cloud\/en\/prestashop5-cislovani-objednavek-na-misto-znaku-bez-pouziti-modulu\/","title":{"rendered":"PrestaShop#5 Order numbering, instead of characters without using modules"},"content":{"rendered":"<div style=\"height:3px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-group has-global-padding is-layout-constrained wp-block-group-is-layout-constrained\">\n<p class=\"wp-block-paragraph\">The typical order numbering in Prestashop is somewhat confusing. <strong>XNFDFVBG. <\/strong>In this tutorial we will show you how to do numerical <strong>20260010<\/strong> ideally nine-digit display for ideal use, for example, as <strong>variable symbol<\/strong>.<\/p>\n\n\n\n<div style=\"height:62px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"522\" height=\"227\" src=\"https:\/\/www.profi.cloud\/wp-content\/uploads\/2026\/01\/cislovani1.jpg\" alt=\"\" class=\"wp-image-127\" srcset=\"https:\/\/www.profi.cloud\/wp-content\/uploads\/2026\/01\/cislovani1.jpg 522w, https:\/\/www.profi.cloud\/wp-content\/uploads\/2026\/01\/cislovani1-300x130.jpg 300w, https:\/\/www.profi.cloud\/wp-content\/uploads\/2026\/01\/cislovani1-18x8.jpg 18w\" sizes=\"auto, (max-width: 522px) 100vw, 522px\" \/><\/figure>\n\n\n\n<div style=\"height:24px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">I prefer to use numbers to number my orders. After a little tweaking, the order numbering is clean and clear.<\/p>\n\n\n\n<div style=\"height:12px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"421\" height=\"203\" src=\"https:\/\/www.profi.cloud\/wp-content\/uploads\/2026\/01\/cislovani2-1.jpg\" alt=\"\" class=\"wp-image-132\" srcset=\"https:\/\/www.profi.cloud\/wp-content\/uploads\/2026\/01\/cislovani2-1.jpg 421w, https:\/\/www.profi.cloud\/wp-content\/uploads\/2026\/01\/cislovani2-1-300x145.jpg 300w, https:\/\/www.profi.cloud\/wp-content\/uploads\/2026\/01\/cislovani2-1-18x9.jpg 18w\" sizes=\"auto, (max-width: 421px) 100vw, 421px\" \/><\/figure>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">You can achieve this order number format very easily by modifying the original code.<\/p>\n\n\n\n<div style=\"height:21px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-group has-global-padding is-layout-constrained wp-block-group-is-layout-constrained\">\n<h3 class=\"wp-block-heading has-large-font-size\">1. Open your FTP database. In the folder <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\">\/classes\/order<\/mark> you download the file <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\">Order.php<\/mark><\/strong><\/h3>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"479\" height=\"599\" src=\"https:\/\/www.profi.cloud\/wp-content\/uploads\/2026\/01\/cislovani3.jpg\" alt=\"\" class=\"wp-image-129\" srcset=\"https:\/\/www.profi.cloud\/wp-content\/uploads\/2026\/01\/cislovani3.jpg 479w, https:\/\/www.profi.cloud\/wp-content\/uploads\/2026\/01\/cislovani3-240x300.jpg 240w, https:\/\/www.profi.cloud\/wp-content\/uploads\/2026\/01\/cislovani3-10x12.jpg 10w\" sizes=\"auto, (max-width: 479px) 100vw, 479px\" \/><\/figure>\n\n\n\n<div style=\"height:39px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading has-large-font-size\">2. After downloading, the file <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\">Order.php<\/mark><\/strong> open in NotePad or PSPad<\/h3>\n\n\n\n<div style=\"height:39px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Replace this code:<\/strong><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<pre class=\"wp-block-code\"><code>public static function generateReference()\n{\n    return strtoupper(Tools::passwdGen(9, 'NO_NUMERIC'));\n}<\/code><\/pre>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>New code: <\/strong><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<pre class=\"wp-block-code\"><code>public static function generateReference()\n{\n    $query = new DbQuery();\n    $query-&gt;select('MAX(id_order) as max');\n    $query-&gt;from('orders');\n    $query-&gt;where('id_cart' &gt; 0);\n    $order = Db::getInstance()-&gt;getRow($query);\n    $reference = $order&#91;'max'] +10 ;\n    return sprintf('2026%05d', $reference);\n}<\/code><\/pre>\n<\/blockquote>\n\n\n\n<div style=\"height:22px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading has-large-font-size\">2. Save the file and upload it back to the FTP database.<\/h3>\n\n\n\n<div style=\"height:22px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">And you're done. The next order will be numerical. <\/p>\n\n\n\n<div style=\"height:23px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">You can still edit the line <strong>&#8222;return sprintf(&#8218;2026%05d&#8216;, $reference);&#8220;<\/strong> 2023 indicates the prefix before the order number.d indicates the number of characters after the prefix, in this case it is 5 characters. I recommend leaving 5 characters, because the order number can also be the variable symbol number. Banks have a limited number for the variable symbol of a maximum of 9 characters, therefore it is a sum of 4+5 = 9 characters.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you don't want to manually edit the generation of this number, I recommend the module <a href=\"https:\/\/prestashop.valasinec.cz\/nastroje\/110-zmena-kodu-objednavky-change-reference-code-modul-pro-prestashop.html\" data-type=\"link\" data-id=\"https:\/\/prestashop.valasinec.cz\/nastroje\/110-zmena-kodu-objednavky-change-reference-code-modul-pro-prestashop.html\">Zm\u011bna k\u00f3du objedn\u00e1vky &#8211; change reference code<\/a> from my favorite Prestashop module developer.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Typick\u00e9 \u010d\u00edslov\u00e1n\u00ed objedn\u00e1vek v Prestashop \u0159e\u0161en\u00ed je pon\u011bkud nep\u0159ehledn\u00e9 XNFDFVBG. My si v tomto tutori\u00e1lu uk\u00e1\u017eeme jak na \u010d\u00edseln\u00e9 20260010 zobrazen\u00ed ide\u00e1ln\u011b dev\u00edtim\u00edstn\u00e9 pro ide\u00e1ln\u00ed pou\u017eit\u00ed nap\u0159\u00edklad jako pro variabiln\u00ed symbol. Pou\u017e\u00edv\u00e1m k \u010d\u00edslovan\u00ed objedn\u00e1vek rad\u011bji \u010d\u00edsla. \u010c\u00edslovan\u00ed objedn\u00e1vek je po mal\u00e9 \u00faprav\u011b \u010dist\u00e9 a p\u0159ehledn\u00e9. Takov\u00e9ho tvaru \u010d\u00edsla objedn\u00e1vky doc\u00edl\u00edte velmi jednodu\u0161e upraven\u00edm p\u016fvodn\u00edho [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":145,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_ariafse_meta_header_display":false,"_ariafse_meta_footer_display":false,"_ariafse_meta_site_title_display":false,"_ariafse_meta_sticky_header":false,"_ariafse_meta_transparent_header":false,"footnotes":""},"categories":[1,15],"tags":[],"class_list":["post-125","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","category-prestashop"],"_links":{"self":[{"href":"https:\/\/www.profi.cloud\/en\/wp-json\/wp\/v2\/posts\/125","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.profi.cloud\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.profi.cloud\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.profi.cloud\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.profi.cloud\/en\/wp-json\/wp\/v2\/comments?post=125"}],"version-history":[{"count":14,"href":"https:\/\/www.profi.cloud\/en\/wp-json\/wp\/v2\/posts\/125\/revisions"}],"predecessor-version":[{"id":198,"href":"https:\/\/www.profi.cloud\/en\/wp-json\/wp\/v2\/posts\/125\/revisions\/198"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.profi.cloud\/en\/wp-json\/wp\/v2\/media\/145"}],"wp:attachment":[{"href":"https:\/\/www.profi.cloud\/en\/wp-json\/wp\/v2\/media?parent=125"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.profi.cloud\/en\/wp-json\/wp\/v2\/categories?post=125"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.profi.cloud\/en\/wp-json\/wp\/v2\/tags?post=125"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}