webmaster.sigla Posted April 4, 2020 Share Posted April 4, 2020 Hi , When the goods are sold, the same reference number is generated on all invoices. Example : Mug black , reference number: 12345 Mug white, reference number: 12345 Attached image. How to fix this problem?, please help Thanks, Link to comment Share on other sites More sharing options...
Guest Posted April 5, 2020 Share Posted April 5, 2020 PrestaShop version ? Link to comment Share on other sites More sharing options...
webmaster.sigla Posted April 5, 2020 Author Share Posted April 5, 2020 1.7.6.4 Link to comment Share on other sites More sharing options...
Guest Posted April 5, 2020 Share Posted April 5, 2020 (edited) Ok, thank you. It is best to find out the reference numbers stored in the database. Change table prefix ps_ to your table prefix and change c.id_lang = 1 to your lang id. SELECT a.id_product, c.name, a.reference AS product_reference, b.reference AS attribute_reference FROM ps_product a left join ps_product_attribute b ON a.id_product = b.id_product left join ps_product_lang c ON (a.id_product = c.id_product AND c.id_lang = 1) group by a.id_product order by a.reference Edited April 5, 2020 by Guest (see edit history) Link to comment Share on other sites More sharing options...
webmaster.sigla Posted April 5, 2020 Author Share Posted April 5, 2020 Thank you, but it is very difficult to understand what you are explaining here, I am not good on this. I try it but not sure ... I checked data base table prefix is same on all ... Link to comment Share on other sites More sharing options...
Guest Posted April 5, 2020 Share Posted April 5, 2020 Ask the database to see if you have duplicate reference numbers. Link to comment Share on other sites More sharing options...
webmaster.sigla Posted April 5, 2020 Author Share Posted April 5, 2020 You mean, like, are there items with the same reference numbers in store? All items in store are with different numbers -> 100%. ( I checked ) When customer make purchase , on invoice always comes same number -> all the time this -> 311020025. ( like on picture attached), but in product catalog is different - right ref. number. Its very Strange why this is happening. Link to comment Share on other sites More sharing options...
webmaster.sigla Posted April 5, 2020 Author Share Posted April 5, 2020 On shop reference number is okay, but on invoice is wrong look at pictures Link to comment Share on other sites More sharing options...
Guest Posted April 5, 2020 Share Posted April 5, 2020 (edited) FTP: upload here file ./pdf/invoice.product-tab.tpl or if exists in ./themes/your theme/pdf/invoice.product-tab.tpl. Edited April 5, 2020 by Guest (see edit history) Link to comment Share on other sites More sharing options...
Guest Posted April 5, 2020 Share Posted April 5, 2020 (edited) Didn't you install an invoice-editing module? If so, I will need to upload an FTP file here ./override/classes/order/OrderInvoice.php. If not, I need the ./classes/order/OrderInvoice.php file Edited April 5, 2020 by Guest (see edit history) Link to comment Share on other sites More sharing options...
webmaster.sigla Posted April 5, 2020 Author Share Posted April 5, 2020 Not exist pdf folder in my theme folder. Link to comment Share on other sites More sharing options...
Guest Posted April 5, 2020 Share Posted April 5, 2020 (edited) prestashop instalation folder/pdf/ Edited April 5, 2020 by Guest (see edit history) Link to comment Share on other sites More sharing options...
webmaster.sigla Posted April 5, 2020 Author Share Posted April 5, 2020 5 minutes ago, Guest said: prestashop instalation folder/pdf/ invoice.product-tab.tpl Link to comment Share on other sites More sharing options...
webmaster.sigla Posted April 5, 2020 Author Share Posted April 5, 2020 16 minutes ago, Guest said: Didn't you install an invoice-editing module? If so, I will need to upload an FTP file here ./override/classes/order/OrderInvoice.php. If not, I need the ./classes/order/OrderInvoice.php file No, i think its happen after SEO optimization module, but after this I have uninstalled this module Link to comment Share on other sites More sharing options...
Guest Posted April 5, 2020 Share Posted April 5, 2020 Ok. File invoice.product-tab.tpl is good. Check DB: SELECT * FROM `ps_order_detail` WHERE reference = '311020025' If it does not find more values for one order, the error will be in the wrong uninstallation of SEO module. In this case, you will need to hire someone for repair. This is where we will discuss the week and the repair could be done in 10-20 minutes. Link to comment Share on other sites More sharing options...
webmaster.sigla Posted April 5, 2020 Author Share Posted April 5, 2020 On 1/8/2015 at 3:33 AM, shacker said: v1.5-solved issue to save on cart (must reinstall) Last orders with same ref. number Link to comment Share on other sites More sharing options...
Guest Posted April 5, 2020 Share Posted April 5, 2020 Ok. Moment please. Link to comment Share on other sites More sharing options...
Guest Posted April 5, 2020 Share Posted April 5, 2020 (edited) I'll write you a two SQL scripts to run and fix all reference numbers in your order. Edited April 5, 2020 by Guest (see edit history) Link to comment Share on other sites More sharing options...
Guest Posted April 5, 2020 Share Posted April 5, 2020 (edited) Faster will use php script. Save it to FTP in the Prestashop root folder. Then enter your domain and script path in the browser's address bar, eg https://mydomain.com/myscript.php <?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); include('./config/config.inc.php'); include('./config/settings.inc.php'); include('./init.php'); $order_id = Db::getInstance()->ExecuteS('select id_order, product_attribute_id, product_reference, product_id from '._DB_PREFIX_.'order_detail order by id_order'); foreach ($order_id as $order) { $product_reference = ''; if ($order['product_attribute_id'] == '0') { $product_reference = Db::getInstance()->getValue('select reference from '._DB_PREFIX_.'product where id_product = '.$order['product_id']); if ($product_reference) { Db::getInstance()->Execute('update '._DB_PREFIX_.'order_detail set product_reference = '.$product_reference); echo 'order id: '.$order['id_order'].' - product reference: '.$product_reference.'<br />'; } } else { $product_reference = Db::getInstance()->getValue('select reference from '._DB_PREFIX_.'product_attribute where id_product = '.$order['product_id'].' AND id_product_attribute = '.$order['product_attribute_id']); if ($product_reference) { Db::getInstance()->Execute('update '._DB_PREFIX_.'order_detail set product_reference = '.$product_reference); echo 'order id: '.$order['id_order'].' - product reference: '.$product_reference.'<br />'; } } } My tested result: Edited April 5, 2020 by Guest (see edit history) Link to comment Share on other sites More sharing options...
webmaster.sigla Posted April 5, 2020 Author Share Posted April 5, 2020 Thanks, I'll try it Link to comment Share on other sites More sharing options...
Guest Posted April 5, 2020 Share Posted April 5, 2020 If I helped you and solved your problem, you can rate my posts by clicking on the gray heart. You can rate one or more posts. I gladly helped. Link to comment Share on other sites More sharing options...
Appwards Posted August 9, 2020 Share Posted August 9, 2020 @webmaster.sigla You've received great support from Guest! Can you report whether this actually worked for you? Link to comment Share on other sites More sharing options...
Guest Posted August 10, 2020 Share Posted August 10, 2020 And why don't you ask me? 😉 Link to comment Share on other sites More sharing options...
Appwards Posted August 12, 2020 Share Posted August 12, 2020 People posting whether it worked or not AND giving kudos to the person who helped them will make this forum a better place for everyone. Reporting that the offered solution works avoids others from trying something in vain. And giving kudos to the person that helped them will make that person more likely to help someone else again. It's all about paying it forward! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now