SpaceIgniter Posted January 19, 2021 Share Posted January 19, 2021 Hi again, Hope everyone is doing well. Is there any way for me to add a custom product on WHMCS that only serves the purpose of sending a quote request to me? In essence. I want specific products to be requested only through a quotation request. It shouldn't be a full fledged order. Thank you for any advice and assistance. Enjoy your day 🙂 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted January 19, 2021 Share Posted January 19, 2021 4 hours ago, SpaceIgniter said: Is there any way for me to add a custom product on WHMCS that only serves the purpose of sending a quote request to me? not from settings. 4 hours ago, SpaceIgniter said: In essence. I want specific products to be requested only through a quotation request. It shouldn't be a full fledged order. I did it years ago where specific products didn't add to cart, but went to a support dept to open a ticket.. off-hand, I can't find the code, though it would almost certainly have been a template edit back then.... you should be able to do it with a hook though. 1 Quote Link to comment Share on other sites More sharing options...
SpaceIgniter Posted January 20, 2021 Author Share Posted January 20, 2021 Hi Brian, Thanks for the reply. I'm not a coder/dev in the true sense. I'm able to read it and make changes as instructed, but I don't know how to do it from scratch. If you possibly have the time, could you please post an example of a hook that might work. Thanks again. Enjoy your day. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted January 20, 2021 Share Posted January 20, 2021 4 hours ago, SpaceIgniter said: If you possibly have the time, could you please post an example of a hook that might work. the only think I could remember about the original thread was that I used the phrase POA in it... though in your situation, you don't need to make a dummy product in the template as I did back then (what was I thinking ?!?) - just make a product as normal, and then code it to react differently. if this product was assigned to it's own product group, then that would make the coding simpler - you could either assign a custom modified orderform template to it, or use the default template and change the button URL via a hook. which orderform template are you using - standard_cart ? 1 Quote Link to comment Share on other sites More sharing options...
SpaceIgniter Posted January 20, 2021 Author Share Posted January 20, 2021 Hi Brian, Yes, I'm using the standard cart order form. As I've said too, I'm not good at writing anything code 😛 Thanks. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted January 21, 2021 Share Posted January 21, 2021 23 hours ago, SpaceIgniter said: As I've said too, I'm not good at writing anything code I know - but I didn't want to waste time coding something for standard_cart, only for you to tell me that you were using Lagom or another third-party orderform template! 🙂 so for the sake of argument, let's say that this product is in it's own product group (#23), in products.tpl you could change... <a href="{$WEB_ROOT}/cart.php?a=add&{if $product.bid}bid={$product.bid}{else}pid={$product.pid}{/if}" class="btn btn-success btn-sm" id="product{$product@iteration}-order-button"> <i class="fas fa-shopping-cart"></i> {$LANG.ordernowbutton}</a> to... {if $gid == 23} <a href="{$WEB_ROOT}/submitticket.php?step=2&deptid=2&subject={$product.name}" class="btn btn-info btn-sm" id="product{$product@iteration}-order-button"> <i class="fas fa-envelope"></i> {$LANG.contactus}</a> {else} <a href="{$WEB_ROOT}/cart.php?a=add&{if $product.bid}bid={$product.bid}{else}pid={$product.pid}{/if}" class="btn btn-success btn-sm" id="product{$product@iteration}-order-button"> <i class="fas fa-shopping-cart"></i> {$LANG.ordernowbutton}</a> {/if} clicking on the blue button will now open a support ticket, with the product name as the subject title of the ticket - you will probably need to change the deptid=2 to whichever support department you wanted to use for this issue. if the custom product was in a group with other "normal" products, then you can adaprt the code to allow this.... {if $product.pid|in_array:array(137,45)} <a href="{$WEB_ROOT}/submitticket.php?step=2&deptid=2&subject={$product.name}" class="btn btn-info btn-sm" id="product{$product@iteration}-order-button"> <i class="fas fa-envelope"></i> {$LANG.contactus}</a> {else} <a href="{$WEB_ROOT}/cart.php?a=add&{if $product.bid}bid={$product.bid}{else}pid={$product.pid}{/if}" class="btn btn-success btn-sm" id="product{$product@iteration}-order-button"> <i class="fas fa-shopping-cart"></i> {$LANG.ordernowbutton}</a> {/if} in the above example, i'm defining two products (IDs 137 & 45) to behave as your custom products - they will both show the blue button; other products will work as normal with the green button. ultimately, you might be able to do this as a hook - certainly if these products are in their own group (potentially very messy if they're not)... with a template change as per above, it's slightly more flexible. 1 Quote Link to comment Share on other sites More sharing options...
SpaceIgniter Posted January 21, 2021 Author Share Posted January 21, 2021 Hi Brian, Thanks so much for your time and effort. I got it working using the Group ID as you coded. How would I add more than one GID to the code however? I didn't specify it originally and I apologise for that. I would need to apply this to a few groups that require Contact. Thank you again. I really appreciate all your help. Have a great weekend ahead 🙂 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted January 22, 2021 Share Posted January 22, 2021 12 hours ago, SpaceIgniter said: How would I add more than one GID to the code however? in the same way as I did in the second example, so instead of using... {if $product.pid|in_array:array(137,45)} you check for group IDs instead.. {if $gid|in_array:array(1,2)} 1 Quote Link to comment Share on other sites More sharing options...
SpaceIgniter Posted January 22, 2021 Author Share Posted January 22, 2021 Thank you Brian. Really appreciate your help. Working beautifully. 🙂 Enjoy your day. 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.