Codify Solutions Posted August 18, 2016 Share Posted August 18, 2016 Hello everyone, I stuck with one of the problem I am creating a module , which will have option on shipping page. I used "displayCarrierList" hook to display my option/selection after carrierlist. It appears. My option has checkbox and a price. What I want if I select that option on shipping page it will appear on order total section on the next page and it must maintain rest of the orders in email, admin orders etc. Which hook I have to use for that ? I found "displayOrderDetail" hook but I didn't get any help that how I can use that. I tried to use also but it didn't return anything from that hook in order detail section. Please give input if possible and thx in advanced Link to comment Share on other sites More sharing options...
Codify Solutions Posted August 19, 2016 Author Share Posted August 19, 2016 Hello Again, I thought I made bit confused. Here is the screenshot what I need. I hope someone will have idea how to do it. please check attached screenshot. Link to comment Share on other sites More sharing options...
vekia Posted August 19, 2016 Share Posted August 19, 2016 regarding to tax row - it is a matter of theme modification shopping-cart.tpl Link to comment Share on other sites More sharing options...
Codify Solutions Posted August 20, 2016 Author Share Posted August 20, 2016 Thanks vekia for your reply. Yes I know its related to theme tpl modification. I stuck because I am creating a module for that and I can't tell someone to modify tpl file. Is there anyway with hooks or override ? Link to comment Share on other sites More sharing options...
NemoPS Posted August 20, 2016 Share Posted August 20, 2016 There is no hook there unfortunately. What you can do is hooking to the shopping cart hook (displayShopping cart, or without display, I forgot)Then use js to append your row to it Link to comment Share on other sites More sharing options...
Codify Solutions Posted August 22, 2016 Author Share Posted August 22, 2016 There is no hook there unfortunately. What you can do is hooking to the shopping cart hook (displayShopping cart, or without display, I forgot) Then use js to append your row to it Hi, As you said to use js to append row after tax, I did that successfully. What I did on hookHeader I put code to check page and after that I write js like below to add a row : $my_fee_row = '<tr class=\"cart_total_my_fee\"><td class=\"text-right\" colspan=\"4\">My Fee: </td><td id=\"total_my_fee\" class=\"price\" colspan=\"2\">$10</td></tr>'; return ' <script> jQuery(document).ready(function () { $( ".cart_total_tax" ).after("'.$my_fee_row.'") }) </script>'; It worked and add a row after tax. But further I want to add fee amount to the total as well as it must maintain "My fee" in order total section. e.g it shows in admin on my account order histroy, order emails as well. So for to do so like above , shall I need to override controller or classes ? Thanks! Link to comment Share on other sites More sharing options...
NemoPS Posted August 22, 2016 Share Posted August 22, 2016 It depends on how you calculate the fee. If it's not added to the total already, it will probably not in the order either. Is it? Otherwise you need to append it to Cart::GetOrderTotal (with an override) Link to comment Share on other sites More sharing options...
Codify Solutions Posted August 22, 2016 Author Share Posted August 22, 2016 It depends on how you calculate the fee. If it's not added to the total already, it will probably not in the order either. Is it? Otherwise you need to append it to Cart::GetOrderTotal (with an override) Thanks NemoPS for your quick reply. Let me try to override GetOrderTotal in order to show my field in order total section and do calculation accordingly. I will do and get back to you Thanks again Link to comment Share on other sites More sharing options...
Codify Solutions Posted August 24, 2016 Author Share Posted August 24, 2016 Well, I tried a lot order total can be change use override in the module but I thought that for the time being I have displayed my price in order total section but what about in admin, invoice order email and order history page of my account. I can't use js / jquery all over those places. So I am finding something permanent way to do it so it appears in order total in all over the places like "Total TAX" etc. Please share ideas if someone knows. I am stuck on it last 2 days and its really frustrating . Thanks in Advanced. Link to comment Share on other sites More sharing options...
NemoPS Posted August 24, 2016 Share Posted August 24, 2016 If you change getOrderTotal, it will be saved as total paid in the database and displayed in the admin as well Link to comment Share on other sites More sharing options...
Codify Solutions Posted August 24, 2016 Author Share Posted August 24, 2016 Hi, Yes but its regarding total only. It updates the total but I want to show my charges like TAX row, as I shown my screenshot. but for that I have to modify tpl file manually I hope you understand what is the issue. Link to comment Share on other sites More sharing options...
Codify Solutions Posted August 26, 2016 Author Share Posted August 26, 2016 Hello,Well I found a way to add a row there in order total section. I don't know if its the correct way or notI did it with front end and admin section as well.Hope it helps someone.For Adminwith DisplayAdminOrder hook$admin_extra_total_row = '<tr class=\"cart_total_extra\"><td class=\"text-right\">extra Fee: </td><td class=\"amount text-right nowrap\">'.$fee.'</td></tr>'; return ' <script> jQuery(document).ready(function () { $( "#total_taxes" ).after("'.$admin_extra_total_row.'") }) </script>';For Front end:I checked the page where I want to place. For example I want to place on step 3used hook DisplayHeader if (($check_order_page == 'order' and $_GET['step'] == '3') or ($check_order_page == 'order' and $_GET['step'] == '')) { $extra_fee = Tools::displayPrice(Configuration::get('EXTRA_FEE'), $currency); $extra_total_row = '<tr class=\"cart_total_extra_fee\"><td class=\"text-right\" colspan=\"4\">Extra Fee: </td><td id=\"total_extra_fee\" class=\"price\" colspan=\"2\">'.$wli_price.'</td></tr>'; return ' <script> jQuery(document).ready(function () { $( ".cart_total_tax" ).after("'.$extra_total_row.'") }) </script>'; } Hope if helps someone. other suggestions and ideas are welcome. I am also want to do with Invoice, email etc. for now I don't know how to do itand what hooks I have to be used with it but I will get back for this if I get anything.If someone have idea so please share.Thanks very much. 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