felipefkk Posted November 7, 2015 Share Posted November 7, 2015 Hey guys! We are trying to add a new .TPL file inside our Cart Template, we already did everything but when we try acessing: site.com/cart?a=newfile It does not work, is there any way to make WHMCS see the new file as part of the template in question? Thank you 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 8, 2015 Share Posted November 8, 2015 you can't really modify the cart process by adding additional steps (new pages) into it - in practice, you can only modify the existing steps, or start from scratch using the API. 0 Quote Link to comment Share on other sites More sharing options...
felipefkk Posted November 8, 2015 Author Share Posted November 8, 2015 Hey Brian! Thanks for the answer! I though it would not be possible... The reason why I need to add a new .tpl is to make a register page separated from the checkout page. I want to use the checkout only for payment and have the users registering before going there. My solution so far is to send the user to the register.php after they go into cartview, but I don't know how to redirect the user to the checkout after that without making him having to put all products on the cart again. 0 Quote Link to comment Share on other sites More sharing options...
felipefkk Posted November 8, 2015 Author Share Posted November 8, 2015 New question: Can I decide to which page the user will go after registration? For example, after he submits his new register on my site he is redirected to cart.php?a=checkout ? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 8, 2015 Share Posted November 8, 2015 Hey Brian! Thanks for the answer! I though it would not be possible... The reason why I need to add a new .tpl is to make a register page separated from the checkout page. I want to use the checkout only for payment and have the users registering before going there. i'm tempted to ask why as it makes the order process much longer - and that's never a good idea... if I wanted to order a product/service from your site, and then realised that I need to register first (even though I know registration is automatically accepted), I might not continue with the order and look elsewhere. I could understand it if you are using a third-party addon to confirm account registrations - but if you're not, I don't really see the point. My solution so far is to send the user to the register.php after they go into cartview, but I don't know how to redirect the user to the checkout after that without making him having to put all products on the cart again. the items should still be in the cart - so a link to cart.php?a=checkout should work. depending on which order-form template you're using (some might be more flexible than others), there may be alternatives... one might be to modify the templates so that only logged in users could visit the cart pages... e.g as a very basic example, if you add the following to the top of products.tpl, it will prevent the display of products to non clients (i'm using Standard Cart in my example)... {if !$loggedin} go to register.php to create an account with us, and then login! {else} ... rest of template... {/if} you may then need to make similar changes to the other templates in the order-form.... and test thoroughly! I can think of other options, but they'd all make it more awkward for the user... New question:Can I decide to which page the user will go after registration? For example, after he submits his new register on my site he is redirected to cart.php?a=checkout ? it's hard-coded that it redirects to clientarea.php after registration - so it can't be modified in the template or through admin area settings. you would need to use an action hook, specifically ClientAreaRegister to redirect the user to a different url. to do this, you would need to create a file in the includes/hooks folder, call it regredirect.php (or anything you want .php) and add the following code to it... <?php function hook_ClientRegistrationRedirection($vars){ $redirecturl = 'http://demo.whmcs.com'; echo '<meta http-equiv="refresh" content="0; url='.$redirecturl.'">'; exit; } add_hook("ClientAreaRegister", 1, "hook_ClientRegistrationRedirection"); ?> now after a user registers, they'll be redirected to the URL specified in the hook code - in the above example, it's to the WHMCS demo site; for you, it might be to viewcart, checkout, cart.php or elsewhere. however, if I were you, i'd have a serious think about whether you want to go down the road of modifying the order process in this way, by splitting the registering/ordering pages. 0 Quote Link to comment Share on other sites More sharing options...
felipefkk Posted November 9, 2015 Author Share Posted November 9, 2015 Hey Brian! Thank you so much for all your help I didn't especify about my problem since most people would not bother to read it lol. But we made a fully custom theme and cart, everything is alot different from the WHMCS concept, the user only goes to the registration page after selecting the product and adding it to the cart, we made only required to the user to register before going to the checkout as in our theme all the information is showed upon the checkout screen with the data of the client and his choices. I tried using the action hook, but it wasnt working, I think it may be something related to be using ina localmachine, but I will give your script a try! Thank you again for all your help 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 9, 2015 Share Posted November 9, 2015 the hook works on my v6 dev using the standard client registration page - but perhaps if you've made a secondary registration page, the hook won't recognise it as being register.php and so won't trigger... 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.