MikeDVB Posted May 19, 2011 Author Share Posted May 19, 2011 Here we go, this is how I envision it (with my own voice talking about it): http://www.screen-shot.net/2011-05-19_1948.swf Here is my "patch" including Matt's patch for &skip=1 functionality working attached. Here is the documentation on changes made. Anybody using a non-English template (or using multiple langauges) will need to translate and modify their language files appropriately. Changed line 620 of English.txt to: $_LANG["ordersummary"] = "Cart Summary"; Changed line 942 of English.txt to: $_LANG['ordersummarybegin'] = "No products currently in the cart. Please fully configure a product to add it to the cart."; Added these lines to English.txt: $_LANG['ajax_checkout'] = "Checkout >>"; $_LANG['ajax_continue'] = "Continue Configuring Product >>"; Modified configureproduct.tpl, configuredomains.tpl, and configureproductdomain.tpl in ajaxcart to reflect ajax_checkout and ajax_continue for the buttons. Modified cartsummary.tpl to remove " <input type="button" value="{$LANG.checkout}" onclick="checkout()" />" as it's redundant. ajaxcart_patch_mikedvb.zip 0 Quote Link to comment Share on other sites More sharing options...
Excel Posted May 20, 2011 Share Posted May 20, 2011 I think the way you have it Michael makes a lot of sense compared to the default WHMCS v4.5, thanks for the videos and mod 0 Quote Link to comment Share on other sites More sharing options...
MikeDVB Posted May 20, 2011 Author Share Posted May 20, 2011 I think the way you have it Michael makes a lot of sense compared to the default WHMCS v4.5, thanks for the videos and modI think it makes a *LOT* more sense like this as well, hopefully this mod can make it officially into WHMCS so that it supports multiple languages. It would also be great if it made it in so we didn't have to make all of these changes manually on each and every update. 0 Quote Link to comment Share on other sites More sharing options...
intelliServe Posted May 20, 2011 Share Posted May 20, 2011 Very nice mike! Not liking how the client can remove the product and still continue but you've done a great job there. 0 Quote Link to comment Share on other sites More sharing options...
MikeDVB Posted May 20, 2011 Author Share Posted May 20, 2011 On a related note, there is still something that Matt will need to resolve: This works for skipping product selection (code so it doesn't get shortened by the forum): https://www.mddhosting.com/support/cart.php?pid=5&skip=1 This does not work for skipping product selection (code so it doesn't get shortened by the forum): https://www.mddhosting.com/support/cart.php?a=add&pid=5&skip=1 The default URL is the second one (provided directly by WHMCS): Very nice mike!Not liking how the client can remove the product and still continue but you've done a great job there. I've not tested to see what happens if the cart is empty and the customer tries to complete the order. Realistically I think it should check to see if the cart is empty, and then reset the ordering process or something... I'm not sure how to gracefully handle that error. 0 Quote Link to comment Share on other sites More sharing options...
MikeDVB Posted May 20, 2011 Author Share Posted May 20, 2011 (edited) Another update, for those who have old sources that still link to the /whmcs/order/?pid=2&skip=1 (such as forums) where you cannot update the links, I've modified the index.php in /whmcs/order/ to pass &skip if it exists: Here is the new version: <?php require("../dbconnect.php"); if ($pid) { if ($skip) { header("Location: ../cart.php?pid=".(int)$pid."&skip=".(int)$skip."&carttpl=ajaxcart"); } else { header("Location: ../cart.php?pid=".(int)$pid."&carttpl=ajaxcart"); } exit; } header("Location: ../cart.php?carttpl=ajaxcart"); exit; ?> If you look at the existing version you will see that all I did was check for $skip and if it exists, it passes it into the header, otherwise it doesn't. Attached is the latest version of the patch including the updated /whmcs/order/index.php Here is the official change-log: ajaxcart_patch_mikedvb_v1.1 changelog Changed line 620 of /whmcs/lang/English.txt to: $_LANG["ordersummary"] = "Cart Summary"; Changed line 942 of /whmcs/lang/ English.txt to: $_LANG['ordersummarybegin'] = "No products currently in the cart. Please fully configure a product to add it to the cart."; Added these lines to /whmcs/lang/ English.txt: $_LANG['ajax_checkout'] = "Checkout >>"; $_LANG['ajax_continue'] = "Continue Configuring Product >>"; Modified /whmcs/templates/orderforms/ajaxcart/configureproduct.tpl, /whmcs/templates/orderforms/ajaxcart/configuredomains.tpl, and /whmcs/templates/orderforms/ajaxcart/configureproductdomain.tpl to reflect ajax_checkout and ajax_continue for the buttons. Modified /whmcs/templates/orderforms/ajaxcart/cartsummary.tpl to remove " <input type="button" value="{$LANG.checkout}" onclick="checkout()" />" as it's redundant. Modified /whmcs/order/index.php to handle the "skip" variable to allow legacy Ajax form links that use &skip=1 to continue to function as expected. ajaxcart_patch_mikedvb_v1.1.zip Edited May 20, 2011 by MikeDVB 0 Quote Link to comment Share on other sites More sharing options...
MikeDVB Posted May 20, 2011 Author Share Posted May 20, 2011 After speaking with Matt, we're going to be adding back the "Checkout" button to the Cart Summary however we're going to link it to an anchor so that it takes you back to the top of the user information entry if I can manage to get a button to link to an anchor Matt's main reason is that the checkout button is for somebody who leaves the cart and comes back to it, not wanting to order more products just checkout, which does make sense. 0 Quote Link to comment Share on other sites More sharing options...
MikeDVB Posted May 20, 2011 Author Share Posted May 20, 2011 (edited) I've done it, I had to add a line of code to the main.js for the ajaxcart, but I will post version 1.2 of this patch soon. See it here: http://www.screen-shot.net/2011-05-20_1338.swf Here is what is changed in the main.js of the ajaxcart/js/main.js: function checkout() { scrolltocheckout(); jQuery.post("cart.php", 'a=checkout&ajax=1', function(data){ jQuery("#signupcontainer").html(data); jQuery("#signupcontainer").slideDown(); }); } function scrolltocheckout() { if ($(document.getElementById('signupcontainer')).is(":visible")) { document.getElementById('signupcontainer').scrollIntoView(true); } } What this does, is if you're scrolled to the bottom and you hit the "Checkout" button in the summary, it will scroll back up to the part where you enter your details. This, at the least, causes some sort of change so that those who don't follow the ordering process well will not be confused when they hit checkout numerous times and nothing happens. Updated ZIP forthcoming. Edited May 20, 2011 by MikeDVB 0 Quote Link to comment Share on other sites More sharing options...
MikeDVB Posted May 20, 2011 Author Share Posted May 20, 2011 (edited) Attached is the latest verison 1.2. Changelog: ajaxcart_patch_mikedvb_v1.1 changelog Changed line 620 of /whmcs/lang/English.txt to: $_LANG["ordersummary"] = "Cart Summary"; Changed line 942 of /whmcs/lang/ English.txt to: $_LANG['ordersummarybegin'] = "No products currently in the cart. Please fully configure a product to add it to the cart."; Added these lines to /whmcs/lang/ English.txt: $_LANG['ajax_checkout'] = "Checkout >>"; $_LANG['ajax_continue'] = "Continue Configuring Product >>"; Modified /whmcs/templates/orderforms/ajaxcart/configureproduct.tpl, /whmcs/templates/orderforms/ajaxcart/configuredomains.tpl, and /whmcs/templates/orderforms/ajaxcart/configureproductdomain.tpl to reflect ajax_checkout and ajax_continue for the buttons. Modified /whmcs/templates/orderforms/ajaxcart/configureproductdomain.tpl to adjust the domain text entry boxes from 25 wide to 20 wide to avoid the extension displaying below the domain entry box. Added back /whmcs/templates/orderforms/ajaxcart/cartsummary.tpl to remove " <input type="button" value="{$LANG.checkout}" onclick="checkout()" />" as it's redundant. Modified /whmcs/templates/orderforms/ajaxcart/js/main.js: Added function: scrolltocheckout() Added call to function scrolltocheckout() in checkout(); Modified /whmcs/order/index.php to handle the "skip" variable to allow legacy Ajax form links that use &skip=1 to continue to function as expected. Known Issues: 1. If you use the "checkout" button in the order summary and then leave and come back to the cart the product will no longer be in the cart. I verified this on the base AjaxCart (without my modifications/patch) so this is an issue with the AjaxCart itself. I will see if I can fix this and include it into my patch in 1.3. ajaxcart_patch_mikedvb_v1.2.zip Edited May 20, 2011 by MikeDVB 0 Quote Link to comment Share on other sites More sharing options...
MikeDVB Posted May 20, 2011 Author Share Posted May 20, 2011 There is an issue with the AjaxCart (even without my patch) if you order and configure a product but don't click the "checkout" or last "continue" button after the billing cycle choice but instead use the "Checkout" button in the "Cart Summary" the item will not be "Saved" to the cart. I created this short video to show the issue in detail to make what I'm trying to say easier to understand: http://www.screen-shot.net/2011-05-20_1413.swf 0 Quote Link to comment Share on other sites More sharing options...
baldy Posted May 20, 2011 Share Posted May 20, 2011 Mike don't get me wrong I'm not usually a dickhead, but I can't stand you & your thread. Stop giving it the large like you're some big programmer, there's nothing wrong with the new WHMCS (4.5), Matts done a great job, and these ridiculously amateur hacks can be done by ANYONE - you posting the code and attaching a zip file don't make you look like a pro mate. 4.5 > 4.4 in every aspect no contest (however, doesn't mean it's perfect - there's work to do - but as I've mentioned before it's a nice little step in the right direction). 0 Quote Link to comment Share on other sites More sharing options...
MikeDVB Posted May 20, 2011 Author Share Posted May 20, 2011 (edited) Mike don't get me wrong I'm not usually a dickhead, but I can't stand you & your thread. Stop giving it the large like you're some big programmer, there's nothing wrong with the new WHMCS (4.5), Matts done a great job, and these ridiculously amateur hacks can be done by ANYONE - you posting the code and attaching a zip file don't make you look like a pro mate. 4.5 > 4.4 in every aspect no contest (however, doesn't mean it's perfect - there's work to do - but as I've mentioned before it's a nice little step in the right direction). You're welcome to see it however you wish Baldy. Personally I see flaws in the default AjaxCart from 4.5.1 so I've done some work to fix it. Sure, they're simple language changes anybody could do but by creating the zip file you don't have to manually do it yourself. Even Matt himself said, in the ticket I have with him, that my changes are a good start. Sure, they're not some amazing re-write of the ajaxcart, but they're a big step in the right direction as far as the end-user experience (i.e. the experience of the customer). I never said that WHMCS hasn't done a great job, but nobody is perfect and any piece of software will have bugs. I've developed in everything from Assembly all the way up to Basic for over 20 years myself from embedded devices, cellular devices, all the way up to desktop and server applications so I definitely do not give two cents about "looking like a pro." My only goal by doing so is to help others out who agree that the AjaxCart from 4.5.1 is a "little off" as far as the end-user experience. Instead of coming here to troll, you could spend your time more productively - however - I do appreciate any and all feedback be it positive or troll-like. Edited May 20, 2011 by MikeDVB 0 Quote Link to comment Share on other sites More sharing options...
baldy Posted May 21, 2011 Share Posted May 21, 2011 (edited) Even Matt himself said, in the ticket I have with him, that my changes are a good start. Give yourself a pat on the back. Sure, they're not some amazing re-write of the ajaxcart, but they're a big step in the right direction as far as the end-user experience (i.e. the experience of the customer). Big step, or minor (in a lot of cases irrelevant) change(s)? any piece of software will have bugs. It wasn't a bug, no matter how much you convince yourself. I assume it was only patched because of how minor it was to fix in proportion to how much of a fuss you were kicking up all over the internet. I've developed in everything from Assembly all the way up to Basic for over 20 years myself from embedded devices, cellular devices, all the way up to desktop and server applications Wow, have you applied for a Blue peter badge yet? I definitely do not give two cents I think you have your phrases all mixed up here. Instead of coming here to troll, you could spend your time more productively - however - I do appreciate any and all feedback be it positive or troll-like. A troll tries to get a reaction out of someone for their own entertainment. I am not entertained by you or this thread. You totally over reacted to a minor problem, slated WHMCS/Matt both here and Webhostingtalk. We've all gotta eat, and people that go around the web moaning about nothing, playing up and potentially denting reputation I have ZERO respect for. You're in the web hosting business so you must've been small at one point (we all were); and so I'm sure you're all too familiar with the one or two rude, whinging, annoying customers that you wish'd just shutup and not give you such a hard time. Making your day long and hard and all because they're extremely awkward. Congratulations, you have just turned into that customer. I don't wish to prolong this any further. I just wanted to drop by to let you know how much of a little girl you were (are) being, didn't want your whole bloody development history. I sincerely wish you the best of luck with your business, no hard feelings, I just think you were spoilt as a child. Baldy. Edited May 21, 2011 by baldy typos 0 Quote Link to comment Share on other sites More sharing options...
rainboy Posted May 21, 2011 Share Posted May 21, 2011 A troll tries to get a reaction out of someone for their own entertainment. .... I just wanted to drop by to let you know how much of a little girl you were (are) being Baldy. Really ? not a troll ? come on man, the cart was not working right, it had some flaws in it, which should be improved, i think Mike just got ticked off by Matt because it was so quickly stated to be working as intended, while it clearly wasnt perfect. Communication is key in customer support and i think things did not go they way either wanted. But calling names and belittling people, you are definitely a troll. 0 Quote Link to comment Share on other sites More sharing options...
Chris-2009 Posted May 21, 2011 Share Posted May 21, 2011 Many thanks Myke for this patch 0 Quote Link to comment Share on other sites More sharing options...
baldy Posted May 21, 2011 Share Posted May 21, 2011 But calling names and belittling people, you are definitely a troll. Me giving my opinion and saying what I think makes me a troll? Alright then mate... EDIT: You think if I were trolling I wouldn't be a little more subtle lol?? 0 Quote Link to comment Share on other sites More sharing options...
RAINFIRE Posted May 22, 2011 Share Posted May 22, 2011 I'm glad you're getting some humor out of this. I about fell out of my chair laughing when I read this. I'm hear for the same reason as Mike. Feel the same pain. Is there any wiki/document/forum thread that fully explains/outlines the new options or links for 4.5? I can't get the ajaxcart to work right either the old way or what I think is the new way? I've applied the patch and have the same results. I've been on this four hours now - I've found the pictures of the new templates, but not an actual list of working examples but I may have missed it. Did not apply all Mike's patches. I'll just switch to the slider template until I can figure out the correct way to make the new ajax cart work. Personally, I probably wouldn't have invalidated all the old ajax cart links, just sayin . . . 0 Quote Link to comment Share on other sites More sharing options...
nob Posted June 4, 2011 Share Posted June 4, 2011 Hi Mike, Many thanks for your patch!! I'm curious about something. Does this ajax cart correspond to automatic insertion links of Promocode? It is such a link. https://mydomain.com/order/index.php?promocode=xxxxxx&a=add&pid=1&billingcycle=annually It doesn't function correctly though it tried for myself. 0 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.