Jump to content

Trimming order Summary


Ragonz

Recommended Posts

Is there a way to trim what gets pulled into the order summary? so for example we have a configurable option called "Server Branding (Adds our company name to your servername for a small discount) " having this in the order form is useful as it gives the customer an idea of what they are paying for, however it clutters up the order summary box on the right quite a lot, so I'm wondering if we could trim it somehow to just "Server Branding"

Link to comment
Share on other sites

2 hours ago, Ragonz said:

Is there a way to trim what gets pulled into the order summary? so for example we have a configurable option called "Server Branding (Adds our company name to your servername for a small discount) " having this in the order form is useful as it gives the customer an idea of what they are paying for, however it clutters up the order summary box on the right quite a lot, so I'm wondering if we could trim it somehow to just "Server Branding"

there would be a number of ways to do this using Smarty in the template...

firstly, using 'replace' and changing {$configoption.name} to...

{$configoption.name|replace:'(Adds our company name to your servername for a small discount)':''}

you can use multiple replaces to replace multiple strings...

{$configoption.name|replace:'(Adds our company name to your servername for a small discount)':''|replace:'(use the dropdown box to select one of our 17 datacenters)':''}

and so on...

second option would be to test if the configurable option name contains an opening bracket, and if so, remove everything after, and including, the bracket...

{if $configoption.name|strstr:'('}{$configoption.name|strstr:'(':true}{else}{$configoption.name}{/if}

obviously, this only works 100% if the only times you use brackets like this in configurable options are as descriptions... if not, you may have to use multiple replaces or wrap the above inside if statements to check for specific config option ids and act accordingly.

L6k1kyd.png   becomes...   nRUYOSS.png

Link to comment
Share on other sites

1 minute ago, Ragonz said:

hmm I was afraid of that, the template we use is the slider one, within that there is no ordersummary.tpl, does it pull it from somewhere else or should there be one?

it will use standard_cart/ordersummary.tpl then... these templates will all use their own products.tpl template for the opening page of the cart, then for all the other pages, they'll use standard_cart.

it's probably worth mentioning that Slider was removed from WHMCS in v6.2..

https://docs.whmcs.com/Standard_Order_Form_Templates#Slider

so perhaps you're already using Universal Slider...

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated