Claudia M Posted June 27, 2021 Share Posted June 27, 2021 How do I uncheck the automatically generate product code in admin/product/ general information. For some reason when I upgraded to 6.4.3 if I put in my own product code it does not take the first time and I have to go back in admin and reenter my product code. Thought it might have something to do with this being checked and I overlooked it. Thanks in advance, Claudia Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 27, 2021 Share Posted June 27, 2021 Your conclusion is correct. Regarding the "Auto Generate Product Code" checkbox, CubeCart treats this as a priority, meaning, if checked, regardless if you enter a value in the text box, CubeCart will create a product code for you. Contrary-wise, if the checkbox is unchecked, yet the text box is left empty, CubeCart will still create a product code for you. (Note: When adding a new product, several things are set as default: status is checked, Auto Generate is checked, a suggested SEO path is created, selected to be Featured, selected to be in Latest Products, and selected to enforce stock levels.) Are you not able to uncheck this checkbox? Or do you want it initially unchecked when adding a new product? That can be done in the skin or the core code. Quote Link to comment Share on other sites More sharing options...
Claudia M Posted June 27, 2021 Author Share Posted June 27, 2021 I want it initially unchecked when adding a new product? I'm very forgetful about checkmarks LOL Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 27, 2021 Share Posted June 27, 2021 Let's do it in the skin. In the admin skin, products.index.php, find: Near line 169: <div><label for="product_code_auto">{$LANG.catalogue.product_code_auto}</label><span><input name="product_code_auto" id="product_code_auto" type="hidden" class="toggle" value="{$PRODUCT.auto_code_checked}"> <input name="product_code_old" id="product_code_old" type="hidden" value=""></span></div> Change to: <div><label for="product_code_auto">{$LANG.catalogue.product_code_auto}</label><span><input name="product_code_auto" id="product_code_auto" type="hidden" class="toggle" value="0{* $PRODUCT.auto_code_checked *}"> <input name="product_code_old" id="product_code_old" type="hidden" value=""></span></div> Then, there is another change in the admin skin's admin.js file, find: Near line 243: if($("input#product_code").length > 0) { $("input#product_code").val().length > 0 ? $("input#product_code_auto").val('0') : $("input#product_code_auto").val('1'); $("input#product_code_auto").change(); } Change to: if(false && $("input#product_code").length > 0) { $("input#product_code").val().length > 0 ? $("input#product_code_auto").val('0') : $("input#product_code_auto").val('1'); $("input#product_code_auto").change(); } The programmers really, really wanted to make sure that the product getting a code is super-duper idiot-proof. Quote Link to comment Share on other sites More sharing options...
Claudia Posted August 19, 2022 Share Posted August 19, 2022 This isn't working in cc6.4.6 Any ideas? Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 19, 2022 Share Posted August 19, 2022 (edited) Try this: Undo any edit made to the admin skin (as detailed above). Make this edit to the admin.js file (slightly different than the edit detailed above): Near line 243, find: if($("input#product_code").length > 0) { Change to: if(!1 && ($("input#product_code").length > 0)) { In the file /admin/sources/products.index.inc.php: Near line 1092, find: $result[0]['auto_code_checked'] = (empty($result[0]['product_code'])) ? '1' : '0'; Change to: $result[0]['auto_code_checked'] = '0'; // (empty($result[0]['product_code'])) ? '1' : '0'; However, you said, "For some reason when I upgraded to 6.4.3 if I put in my own product code it does not take the first time and I have to go back in admin and reenter my product code." This may be fixed in CC646. When you start typing in the Product Code text entry field, the Auto checkbox gets unchecked. Edited August 19, 2022 by bsmither Quote Link to comment Share on other sites More sharing options...
Claudia Posted August 19, 2022 Share Posted August 19, 2022 When I try to add a product the Automatically generate product code checkbox still has a checkmark in it Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 19, 2022 Share Posted August 19, 2022 (edited) You may need to force your browser to fetch a fresh copy of admin.js file. Your browser could be using a cached copy. Re-fetching cached page resources is usually done by CTRL-F5. I hope you caught the edit to my previous response. CC646 has made it so that once you begin entering a product code, the checkbox will get unchecked. Oh, and clear CubeCart's internal cache. Edited August 19, 2022 by bsmither Quote Link to comment Share on other sites More sharing options...
Claudia Posted August 19, 2022 Share Posted August 19, 2022 Yeah! The checkmark disappeared as you said it would. Thank you One more thing I can't get to work in CC646. On the customer admin page under "type" it automatically shows registered. Anyway to change that to unregistered? Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 19, 2022 Share Posted August 19, 2022 Let's start a new topic. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.