bsmither Posted February 4, 2018 Share Posted February 4, 2018 It is not inconceivable that shipping zones may have many dozens of methods. Although not excruciatingly onerous to click each row's Edit icon for the entire table, perhaps a "one click to click them all" button will make working major zone updates just a teensy bit better. In the All in One Shipping module, make these edits: In module.definitions.xml, find: <string name="edit_row"><![CDATA[Edit Row]]></string> Add after: <string name="edit_table"><![CDATA[Edit Table]]></string> In shipping_rates.tpl, find: <td colspan="7"> <a href="#" class="aios-add"><img src="{$SKIN_VARS.admin_folder}/skins/{$SKIN_VARS.skin_folder}/images/add.png" alt="{$LANG.all_in_one_shipping.add_rows}" title="{$LANG.all_in_one_shipping.add_rows}" width="16" height="16" border="0" style="padding:0 5px;" />{$LANG.all_in_one_shipping.add_new_shipping_rates}</a> </td> </tr> {for $offset=0; $offset<5; $offset++} Change to: <td colspan="4"> <a href="#" class="aios-add"><img src="{$SKIN_VARS.admin_folder}/skins/{$SKIN_VARS.skin_folder}/images/add.png" alt="{$LANG.all_in_one_shipping.add_rows}" title="{$LANG.all_in_one_shipping.add_rows}" width="16" height="16" border="0" style="padding:0 5px;" />{$LANG.all_in_one_shipping.add_new_shipping_rates}</a> </td> <td align="right">{$LANG.all_in_one_shipping.edit_table} >></td> <td colspan="2"> <input type="hidden" name="update_rates_all" value="0" size="1" /> <a href="#" class="aios-edit-all" rel="update_rates_all"><img src="{$SKIN_VARS.admin_folder}/skins/{$SKIN_VARS.skin_folder}/images/edit.png" alt="{$LANG.all_in_one_shipping.edit_table}" title="{$LANG.all_in_one_shipping.edit_table}" width="16" height="16" border="0" style="padding:0 5px;" /></a> </td> </tr> {for $offset=0; $offset<5; $offset++} The next edit is to add some new javascript that powers the "Edit All" button. Unfortunately, the AIOS javascript file is 'minimized'. Everything is on one line. Fortunately, the new code can be placed very near the beginning. In all_in_one_shipping.min.js, at about the 85th character, find: $(".chzn-select").chosen({width:"300px"}) Just in front of the dollar sign, insert the following: $("a.aios-edit-all").on("click",function(){var t=$(this).parents("table:first").find("span.aios-editable");$(t).click();var t=$(this).parents("table:first").find("input.aios-editable");return $(t).data("original",$(t).val()),!1}), The new javascript was copied and adapted from the code that powers the individual rows' Edit button. I don't understand the return statement. But it seems to work. Be sure to force your browser to reload page resources because the copy in the browser's cache is obsolete. Quote Link to comment Share on other sites More sharing options...
Claudia M Posted February 5, 2018 Share Posted February 5, 2018 You think just a teensy bit easier? LOL Thank you for this. I'll implement it later tonight or tommorow. Super Bowl you know .... Go Eagles!!! And Jack .. 'nuff said. 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.