soamz Posted May 24, 2017 Share Posted May 24, 2017 Hello, we have just started up and we need 2 small changes in our WHMCS product listing page. 1. I need the billing cycle drop down shown in my products listing page, https://tinyurl.com/kakcdkw right now, it shows the monthly price, which I need to remove and place the billing cycle dropdown right there. 2. I need a currency tab like this, http://prntscr.com/fbikf5 on my products listing page. Kindly give me your quote to do the needful. I need it done today only. Payment by PayPal or indian bank transfer. Link to comment Share on other sites More sharing options...
brian! Posted May 24, 2017 Share Posted May 24, 2017 for 1, it should be a template change to pure_comparison/products.tpl... for 2, there should be a currency sidebar there already unless you have an existing hook removing it? Link to comment Share on other sites More sharing options...
soamz Posted May 24, 2017 Author Share Posted May 24, 2017 I did the change, but nothing changed. I dont see the billing cycle dropdown on the page yet, https://tinyurl.com/kakcdkw Link to comment Share on other sites More sharing options...
brian! Posted May 24, 2017 Share Posted May 24, 2017 apologies, I misread 1 - you mean you want a dropdown for each product? the user can change the billing cycle once they get to the product configuration page. do you mean something like the code below...? https://forum.whmcs.com/showthread.php?125686-order-form-price-display&p=503786#post503786 Link to comment Share on other sites More sharing options...
soamz Posted May 24, 2017 Author Share Posted May 24, 2017 I need that, on the products listing page itself, each column here should show the drop down of billing cycle. So, the user should be able to choose from here and click on ORDER now. Link to comment Share on other sites More sharing options...
brian! Posted May 24, 2017 Share Posted May 24, 2017 if you don't want to show pricing, then you could try removing the entire <div> block <div class="price" id="product{$product@iteration}-price"> {if $product.bid} {$LANG.bundledeal} {if $product.displayprice} <br /><br /><span>{$product.displayPriceSimple}</span> {/if} {elseif $product.paytype eq "free"} {$LANG.orderfree} {elseif $product.paytype eq "onetime"} {$product.pricing.onetime} {$LANG.orderpaymenttermonetime} {else} {if $product.pricing.hasconfigoptions} {$LANG.from} {/if} {$product.pricing.minprice.cycleText} <br> {if $product.pricing.minprice.setupFee} <small>{$product.pricing.minprice.setupFee->toPrefixed()} {$LANG.ordersetupfee}</small> {/if} {/if} </div> and replace it with code similar to the above thread... <select name="billingcycle" onchange="window.location=this.value"> {foreach $product.pricing.cycles as $cycle => $cycleprice} {assign billcycle value="orderpaymentterm"|cat:$cycle} <option value="{$smarty.server.PHP_SELF}?a=add&{if $product.bid}bid={$product.bid}{else}pid={$product.pid}{/if}&billingcycle={$cycle}">{$LANG.$billcycle}</option> {/foreach} </select> Link to comment Share on other sites More sharing options...
soamz Posted May 24, 2017 Author Share Posted May 24, 2017 Placed : but it shows like your above screenshot. I need it to show like cart page drop down it comes : http://prntscr.com/fblqn4 Possible ? Link to comment Share on other sites More sharing options...
brian! Posted May 24, 2017 Share Posted May 24, 2017 do you mean you want it to say "1 Month", "3 Months" etc instead of Monthly, Quarterly... ? Link to comment Share on other sites More sharing options...
soamz Posted May 24, 2017 Author Share Posted May 24, 2017 No, I need to show prices too sane like you see http://prntscr.com/fblqn4 So, that customer can clearly see what price he will get if he goes for annual or whatever Link to comment Share on other sites More sharing options...
brian! Posted May 24, 2017 Share Posted May 24, 2017 No, I need to show prices too sane like you see http://prntscr.com/fblqn4So, that customer can clearly see what price he will get if he goes for annual or whatever so when you said... right now, it shows the monthly price, which I need to remove and place the billing cycle dropdown right there. try the following... <select name="billingcycle" onchange="window.location=this.value"> {foreach $product.pricing.cycles as $cycle => $cycleprice} <option id="inputBillingcycle" value="{$smarty.server.PHP_SELF}?a=add&{if $product.bid}bid={$product.bid}{else}pid={$product.pid}{/if}&billingcycle={$cycle}">{$cycleprice}</option> {/foreach} </select> Link to comment Share on other sites More sharing options...
soamz Posted May 24, 2017 Author Share Posted May 24, 2017 Perfect got it, https://tinyurl.com/kakcdkw Just have to fix the css now. thanks a ton. Link to comment Share on other sites More sharing options...
brian! Posted May 24, 2017 Share Posted May 24, 2017 btw - in the future for paid work, you should post in the Service Offers & Requests forum. ... and possibly enable your Private Messaging too! Link to comment Share on other sites More sharing options...
soamz Posted May 24, 2017 Author Share Posted May 24, 2017 oh yes, thanks Link to comment Share on other sites More sharing options...
soamz Posted May 25, 2017 Author Share Posted May 25, 2017 btw - in the future for paid work, you should post in the Service Offers & Requests forum. ... and possibly enable your Private Messaging too! Can I format it this way ? http://prntscr.com/fbspyi Link to comment Share on other sites More sharing options...
soamz Posted May 25, 2017 Author Share Posted May 25, 2017 Now, I need to format this text a bit. Right now it shows, 1 Month Price - ₹350.00 INR 12 Month Price - ₹300.00 INR 24 Month Price - ₹250.00 INR 36 Month Price - ₹200.00 INR I want it to show like, 1 Month at ₹350.00/mo 1 Year at ₹300/mo 2 Years at ₹250/mo 3 Years at ₹200/mo Also, I need that, when someone goes to the products pages, this drop down should be auto selected to the last option - 3 Years at ₹200/mo Can we achieve this two ? Link to comment Share on other sites More sharing options...
brian! Posted May 25, 2017 Share Posted May 25, 2017 Now, I need to format this text a bit. Right now it shows, 1 Month Price - ₹350.00 INR 12 Month Price - ₹300.00 INR 24 Month Price - ₹250.00 INR 36 Month Price - ₹200.00 INR I want it to show like, 1 Month at ₹350.00/mo 1 Year at ₹300/mo 2 Years at ₹250/mo 3 Years at ₹200/mo for the first half of this, you'll need to use Language Overrides and replace the appropriate strings... $_LANG['orderpaymentterm12month'] = "12 Month Price"; $_LANG['orderpaymentterm1month'] = "1 Month Price"; $_LANG['orderpaymentterm24month'] = "24 Month Price"; $_LANG['orderpaymentterm3month'] = "3 Month Price"; $_LANG['orderpaymentterm6month'] = "6 Month Price"; $_LANG['orderpaymentterm36month'] = "36 Month Price"; with... $_LANG['orderpaymentterm12month'] = "1 Year Price"; $_LANG['orderpaymentterm1month'] = "1 Month Price"; $_LANG['orderpaymentterm24month'] = "2 Years Price"; $_LANG['orderpaymentterm3month'] = "3 Months Price"; $_LANG['orderpaymentterm6month'] = "6 Months Price"; $_LANG['orderpaymentterm36month'] = "3 Years Price"; Also, I need that, when someone goes to the products pages, this drop down should be auto selected to the last option - 3 Years at ₹200/mo try using... <option id="inputBillingcycle" value="{$smarty.server.PHP_SELF}?a=add&{if $product.bid}bid={$product.bid}{else}pid={$product.pid}{/if}&billingcycle={$cycle}" {if $cycle eq 'triennially'} selected{/if}>{$cycleprice|replace:' - ':' @ '|replace:$currency.suffix:''}/mo</option> or if you wanted the prices shown in the reverse order (e.g starting with 3 years and descending in cycle length), you could do this instead... <select name="billingcycle" onchange="window.location=this.value"> {foreach $product.pricing.cycles|@array_reverse as $cycle => $cycleprice} <option id="inputBillingcycle" value="{$smarty.server.PHP_SELF}?a=add&{if $product.bid}bid={$product.bid}{else}pid={$product.pid}{/if}&billingcycle={$cycle}">{$cycleprice|replace:' - ':' @ '|replace:$currency.suffix:''}/mo</option> {/foreach} </select> Link to comment Share on other sites More sharing options...
soamz Posted May 25, 2017 Author Share Posted May 25, 2017 Superb man! You are a star. Now it shows 200.00/month can I make it show 200 only ? and hide the decimels ? - - - Updated - - - Also, I can see that, lets say, he page now loads to default selected at 3 years. But when I click on order now, it goes to cart page, where the 1 month is selected. How do we make it auto fetch from the products listing page decision click ? Link to comment Share on other sites More sharing options...
brian! Posted May 26, 2017 Share Posted May 26, 2017 Superb man!You are a star. Now it shows 200.00/month can I make it show 200 only ? and hide the decimels ? Also, I can see that, lets say, he page now loads to default selected at 3 years. But when I click on order now, it goes to cart page, where the 1 month is selected. How do we make it auto fetch from the products listing page decision click ? going back to my post I mentioned previously, I see that i've missed out an important step - the link in that thread is triggered (using js) by the choice from the dropdown, whereas pressing the Order Now button just passes the default URL with no cycle... therefore, the correct code is going to be... <select name="billingcycle" onchange="window.location=this.value"> <option>{$LANG.cartchoosecycle}</option> {foreach $product.pricing.cycles|@array_reverse as $cycle => $cycleprice} <option id="inputBillingcycle" value="{$smarty.server.PHP_SELF}?a=add&{if $product.bid}bid={$product.bid}{else}pid={$product.pid}{/if}&billingcycle={$cycle}">{$cycleprice|replace:' - ':' @ '|replace:$currency.suffix:''|substr:0:-3}/mo</option> {/foreach} </select> when the user makes a choice from the dropdown, the cart will immediate forward to the next step in the ordering process and the chosen billing cycle will be correctly passed on... therefore, you can remove the Order Now button from the page and just use the dropdown. with this method, you'll need to have an option before the 3 Year price, otherwise the js choice won't be triggered if any value is default selected - the first option visible value can be anything - blank, "Choose Billing Cycle" or whatever. Link to comment Share on other sites More sharing options...
soamz Posted May 29, 2017 Author Share Posted May 29, 2017 Hello Soumendra, Thanks for your reply. That is because your custom theme buttons are only loading https://portal.jetcloud.in/cart.php?a=add&pid=1 they need to also have billingcycle=annually linked to them. You can learn more about this at http://docs.whmcs.com/Linking_to_WHMCS#Order_Links As what you are trying to do is a customisation of the cart, its not something we're able to provide support for however I recommend reviewing developers.whmcs.com for further documentation. Please do let me know if you have any further questions. Best regards, -- Christopher Downs Technical Analyst I WHMCS, Ltd. http://whmcs.com Link to comment Share on other sites More sharing options...
brian! Posted May 29, 2017 Share Posted May 29, 2017 That is because your custom theme buttons are only loading https://portal.jetcloud.in/cart.php?a=add&pid=1 they need to also have billingcycle=annually linked to them. You can learn more about this at http://docs.whmcs.com/Linking_to_WHMCS#Order_Links which is basically what I told you 3 days ago in the previous reply! As what you are trying to do is a customisation of the cart, its not something we're able to provide support for however I recommend reviewing developers.whmcs.com for further documentation. don't waste your time contacting support about customisation - they'll just send you to the docs or pass you back here. when you want customisation, either come to the forums where i'm sure someone will be able to help... or go direct to a developer. btw - the above solution I gave you does work... even the previous one worked for non 3-year cycles... so feel free to use it. Link to comment Share on other sites More sharing options...
soamz Posted May 29, 2017 Author Share Posted May 29, 2017 which is basically what I told you 3 days ago in the previous reply! don't waste your time contacting support about customisation - they'll just send you to the docs or pass you back here. when you want customisation, either come to the forums where i'm sure someone will be able to help... or go direct to a developer. btw - the above solution I gave you does work... even the previous one worked for non 3-year cycles... so feel free to use it. actually, i want to change the ORDER URL to 3 year by default, then job done for me. Link to comment Share on other sites More sharing options...
Synertic Posted May 29, 2017 Share Posted May 29, 2017 Hi soamz, can you post your code I want to do the same thing but I only get the annual price, I cant show annually price breakdown to monthly like your site? Link to comment Share on other sites More sharing options...
brian! Posted May 29, 2017 Share Posted May 29, 2017 actually, i want to change the ORDER URL to 3 year by default, then job done for me. then hardcode the button to pass a 3 year billingcycle in the URL... if you forget about using the "Choose Billing Cycle" line from the above code, then if they choose any cycle apart from 3 years, the JS will automatically forward them to the cart process next step; if 3 year is the fist option in the dropdown and the Order Now button is hardcoded to 3 years, it will pass 3 years to the next step. <a href="{$smarty.server.PHP_SELF}?a=add&{if $product.bid}bid={$product.bid}{else}pid={$product.pid}{/if}&billingcycle=triennially" class="order-button" id="product{$product@iteration}-order-button">{$LANG.ordernowbutton}</a> job done! Link to comment Share on other sites More sharing options...
soamz Posted August 1, 2017 Author Share Posted August 1, 2017 Ouch, dont know how WHMCS auto updated and all of my changes are lost. Styling css and the changes both both. How to avoid happening this ? I have backup from last month, which files I need to replace now ? Link to comment Share on other sites More sharing options...
brian! Posted August 1, 2017 Share Posted August 1, 2017 you might need to rename your pure_comparison orderform and/or main theme - that would prevent the autoupdater from overwriting existing files. the language overrides should still be there, so you should just need to work backwards in the thread to return your output to how it was. if you have a backup, then you should only need the pure_comparison/products.tpl and wherever you made your custom css changes (custom.css I assume)... there may be others, as i'm not sure how far your modifications went. Link to comment Share on other sites More sharing options...
Recommended Posts