Jump to content

ordersummary.tpl


deleted

Recommended Posts

Hello,

 

Just wanted to reach out an inquire about a possible customisation I would love to make to my cart.

 

The product in question may be viewed here.

I'm simply looking for a calculator the variables in question would be the CPU Percentage currently present and the amount of players.

 

Here is a mockup image: https://i.imgur.com/XnsGd4U.png

 

The ideology behind it is when the CPU Percentage is increased per in 5 percent increments, it will increase the player slots in each category shown in the imgur image.

 

All suggestions would be very much appreciated.

Thank you.

 

 

 

Link to comment
Share on other sites

On 03/02/2019 at 02:13, aovaex said:

The ideology behind it is when the CPU Percentage is increased per in 5 percent increments, it will increase the player slots in each category shown in the imgur image. 

it should just need a tweak to the ordersummary.tpl template...

        <div class="clearfix">
            <span class="pull-left">Dark RP: {($producttotals.configoptions.4.qty*10)} Players</span><br>
            <span class="pull-left">Sandbox: {($producttotals.configoptions.4.qty*20)} Players</span><br>
            <span class="pull-left">TTT: {($producttotals.configoptions.4.qty*30)} Players</span>
        </div>

3HLSEZN.png

going from your screenshot, i'm assuming it's the 5th configurable option, but throwing a {debug} into the template will give you more information as to the values to use... it's almost certainly going to need a lot of conditions to ensure that this output is only shown for products with this CPU Percentage configurable option.

alternatively, if you could do it in the loop, it solves that issue...

    {foreach $producttotals.configoptions as $configoption}
        {if $configoption}
            <div class="clearfix">
                <span class="pull-left"> » {$configoption.name}: {$configoption.optionname}</span>
                <span class="pull-right">{$configoption.recurring}{if $configoption.setup} + {$configoption.setup} {$LANG.ordersetupfee}{/if}</span>
					{if $configoption.name eq "Quantity (GB)"}<br>
						Dark RP: {($configoption.qty*10)|number_format} Players<br>
						Sandbox: {($configoption.qty*20)|number_format} Players<br>
						TTT: {($configoption.qty*30)|number_format} Players
					{/if}
            </div>
        {/if}
    {/foreach}

Np80DwD.png

for you, it's your last configurable option, so you may be able to get away with adding your output to the loop as above.

Link to comment
Share on other sites

Hello,

 

Thanks for getting back to me so efficiently.

I just wanted to inquire further about where and how I would make these changes.

 

You mentioned 'configurable options' do I have to take steps inside of Setup > Products & Services > Configurable Options?

Moreover, where in the ordersummary.tpl file would I place the code mentioned.

Note: I'm using standard_cart.

 

Best regards.

Link to comment
Share on other sites

12 hours ago, aovaex said:

I just wanted to inquire further about where and how I would make these changes.

you would be adding (or replacing) code within the ordersummary.tpl template.

12 hours ago, aovaex said:

You mentioned 'configurable options' do I have to take steps inside of Setup > Products & Services > Configurable Options? 

no.

12 hours ago, aovaex said:

Moreover, where in the ordersummary.tpl file would I place the code mentioned.

that foreach loop that I posted above already exists in ordersummary.tpl, so you're just replacing that block of code with my pasted code - basically, you're just adding that {if $configoption.name eq "Quantity (GB)"} block of code, but for you it would be..

{if $configoption.name eq "CPU Percentage"}<br>

and then everything inside that {if} statement will be the content of what you want to output for that configurable option e.g., your player calculation output.

12 hours ago, aovaex said:

Here is a unique link to the product in question.

I see that you used my slider increments tutorial to increase the slider in steps of 5. thanks.png

Link to comment
Share on other sites

Hello.

 

Thank you for explaining this further and very well, it's very much appreciated.

 

I've gone ahead and successfully made the changes, however simply inquired if I would possibly be able to make the numbers automatically round to a whole number.

 

In addition,

How would I go about adding a header?

Setting <h1>Player calculator</h1> seemed to give each individual category a header, instead of the desired one 😄

 

16 minutes ago, brian! said:

 

I see that you used my slider increments tutorial to increase the slider in steps of 5. thanks.png

Yes, I'm glad you're around as I wouldn't know where to turn for help, it's a very well explained and set out 🙂

 

Thank you.

Link to comment
Share on other sites

Moreover,

 

How can I make a option show up once it hits a certain number?

For example,

Lets say hypothetically DarkRP printed 11 players rather than printing 11, it would print "Increase".

Evidently once it hit a certain number (lets use 32) it would then print the number.

 

Thanks.

Link to comment
Share on other sites

On 04/02/2019 at 10:37, aovaex said:

Thank you for explaining this further and very well, it's very much appreciated.

i'm glad to have helped. 🙂

On 04/02/2019 at 10:37, aovaex said:

I've gone ahead and successfully made the changes, however simply inquired if I would possibly be able to make the numbers automatically round to a whole number.

I updated the above code yesterday - just use |number_format in the calculation to round to the nearest whole number.

On 04/02/2019 at 10:37, aovaex said:

In addition,

How would I go about adding a header?

Setting <h1>Player calculator</h1> seemed to give each individual category a header, instead of the desired one 😄

13 hours ago, aovaex said:

Moreover,

How can I make a option show up once it hits a certain number?

For example,

Lets say hypothetically DarkRP printed 11 players rather than printing 11, it would print "Increase".

Evidently once it hit a certain number (lets use 32) it would then print the number. 

to do both, you would use the following code...

	{foreach $producttotals.configoptions as $configoption}
		{if $configoption}
			<div class="clearfix">
				<span class="pull-left">&nbsp;&raquo; {$configoption.name}: {$configoption.optionname}</span>
				<span class="pull-right">{$configoption.recurring}{if $configoption.setup} + {$configoption.setup} {$LANG.ordersetupfee}{/if}</span>
				{if $configoption.name eq "CPU Percentage"}<br><br><p class="text-center"><h6 style="text-align: center; font-weight: bold;"><u>Player Calculator</u></h6></p><p class="text-center">Please take into consideration these are rough esitmates....</p>
					» Sandbox: {($configoption.qty/2.5)|number_format} Players<br>
					» DarkRP: {if ($configoption.qty/2.5) lt 32}Increase{else}{($configoption.qty/2.5)|number_format}{/if} Players<br>
					» TTT/Cinema: {($configoption.qty*30)|number_format} Players<br>
					» Prophunt: {($configoption.qty*30)|number_format} Players<br>
					» Murder: {($configoption.qty*30)|number_format} Players<br>
					» Deathrun: {($configoption.qty*30)|number_format} Players
				{/if}
			</div>
		{/if}
	{/foreach}

jwR9JrY.png

as per before, you may still need to play with the css styling to suit your needs... DarkRP is now set to say "Increase" until the calculation is greater than 32 - at which point, it will display the calculation instead.

Link to comment
Share on other sites

On 06/02/2019 at 06:23, aovaex said:

One last thing.

i've lost count of the times people have gone all "Columbo" on me... 🙂

giphy.gif

On 06/02/2019 at 06:23, aovaex said:

How would I go about setting a maximum number? 

Let's say hypothetically I didn't want Sandbox to reach over 60 players.  

	{foreach $producttotals.configoptions as $configoption}
		{if $configoption}
			<div class="clearfix">
				<span class="pull-left">&nbsp;&raquo; {$configoption.name}: {$configoption.optionname}</span>
				<span class="pull-right">{$configoption.recurring}{if $configoption.setup} + {$configoption.setup} {$LANG.ordersetupfee}{/if}</span>
				{if $configoption.name eq "CPU Percentage"}<br><br><p class="text-center"><h5 style="text-align: center; font-weight: bold;">Player Calculator</h5></p><p class="text-center">Please take into consideration these are rough esitmates, server capacity may be fluctuate higher or lower depending on the amount of addons you have.</p>
					» Sandbox: {($configoption.qty/2.1)|number_format} Players<br>
					» Deathrun: {if ($configoption.qty/2.1) lt 32}<b>Increase CPU</b>{else} {($configoption.qty/2.2)|number_format} Players{/if}<br>
					» Murder: {if ($configoption.qty/2.1) lt 32}<b>Increase CPU</b>{else} {($configoption.qty/2.2)|number_format} Players{/if}<br>
					» Prophunt: {if ($configoption.qty/2.5) lt 31}<b>Increase CPU</b>{else} {($configoption.qty/2.5)|number_format} Players{/if}<br>
					» TTT: {if ($configoption.qty/2.5) lt 32}<b>Increase CPU</b>{else} {($configoption.qty/2.3)|number_format} Players{/if}<br>
					» Cenima: {if ($configoption.qty/2.5) lt 32}<b>Increase CPU</b>{else} {($configoption.qty/2.3)|number_format} Players{/if}<br>
					» Sandbox (85+ Addons): {if ($configoption.qty/2.5) lt 32}<b>Increase CPU</b>{elseif ($configoption.qty/2.5) gt 60} 60 Players{else} {($configoption.qty/2.5)|number_format} Players{/if}<br>
					» DarkRP (85+ Addons): {if ($configoption.qty/2.5) lt 32}<b>Increase CPU</b>{else} {($configoption.qty/2.5)|number_format} Players{/if}<br>
				{/if}
			</div>
		{/if}
	{/foreach}
Link to comment
Share on other sites

Thank you very much.

 

On 8/02/2019 at 1:05 AM, brian! said:

i've lost count of the times people have gone all "Columbo" on me... 🙂

giphy.gif

 

Unfortunately, you're correct 😄

 

I'm looking to separate the the currency from the price, as shown in the example below.

$10.00USD vs $10.00 USD

 

Moreover, the CPU percentage printed on the calculator isn't showing the % sign on the orderform -

 

 » CPU Percentage: 160

vs 

 » CPU Percentage: 160%

 

How would I go about making these small but essential changes.

 

Thanks again 🙂

Link to comment
Share on other sites

11 hours ago, aovaex said:

I'm looking to separate the the currency from the price, as shown in the example below.

$10.00USD vs $10.00 USD

the quick way would be to add the space to the suffix setting in the currency settings...

sU9Dgch.png

11 hours ago, aovaex said:

Moreover, the CPU percentage printed on the calculator isn't showing the % sign on the orderform

<span class="pull-left"> » {$configoption.name}: {$configoption.optionname}{if $configoption.name eq "CPU Percentage"}%{/if}</span>
Link to comment
Share on other sites

In addition is there a way I can disable it showing players after Increase CPU.

 

How it is -

» Sandbox: 24 Players
» Deathrun: Increase CPU - Players
» Murder: Increase CPU - Players
» Prophunt: Increase CPU - Players
» TTT: Increase CPU - Players
» Cinema: Increase CPU - Players
» Sandbox (85+ Addons): Increase CPU - Players
» DarkRP (85+ Addons): Increase CPU - Players

 

How it should be -

» Sandbox: 24 Players
» Deathrun: Increase CPU 
» Murder: Increase CPU 
» Prophunt: Increase CPU 
» TTT: Increase CPU 
» Cinema: Increase CPU 
» Sandbox (85+ Addons): Increase CPU 
» DarkRP (85+ Addons): Increase CPU 

 

» Sandbox: 33 Players
» Deathrun: 32 Players
» Murder: 32 Players
» Prophunt: Increase CPU
» TTT: Increase CPU
» Cinema: Increase CPU
» Sandbox (85+ Addons): Increase CPU
» DarkRP (85+ Addons): Increase CPU

etc..

 

Thanks!

Link to comment
Share on other sites

9 hours ago, aovaex said:

Seems to break it.

it looks perfectly acceptable to me and works when I try it locally... perhaps an encoding issue and try changing it to...

<span class="pull-left">&nbsp;&raquo; {$configoption.name}: {$configoption.optionname}{if $configoption.name eq "CPU Percentage"}%{/if}</span>

hjJbvWL.png

9 hours ago, aovaex said:

In addition is there a way I can disable it showing players after Increase CPU.

the code posted previously already does this - you just aren't using it in your template! (it's just a case of changing the location of the closing {/if} statement). thanks.png

Link to comment
Share on other sites

  • 1 month later...

Hey Brian!

 

Lovin' it so far. So do the consumers.

 

Just wanted to contact you as I'm trying to do the same thing with another product!

Unique link: here.

 

Nevertheless, here is my mockup image.

https://i.imgur.com/uwrQcbi.png

 

1. Increase intervals from 1 to 100, starting from 200.

200, 300, 400

 

2. The community tab will have a variable which is dependent on the CPU Percentage, it will moreover need to increase the ram automatically (if need be).

(4GB) 200% = 50-100 Players.

(6GB) 300% = 105-150 Players.

(8GB) 400% = 155-200 Players.

 

3. The oxide tab will mirror the communities players variable as long as 6 plus gb is chosen. Otherwise it will print increase ram.

Moreover, will not include 400% rather print - Recommended Players: N/A.

 

(6GB) 200% = 50-100 players

(8GB) 300% = 105-150 Players.

400% = (Printing) Recommended Players: N/A.

 

Any suggestions on how exactly I would go about doing this would be very much appreciated. Sorry if this is confusing.

Thanks a million.

Edited by aovaex
Link to comment
Share on other sites

Just to add onto number 3 as I don't think I was clear.

If someone hypothetically chose 300%, since it would default to 6GB (as I said in number 2) please make it print Increase ram, moreover manually allowing them to select from the drop down menu.

 

From there it would then print Recommended Players: 105-150.

 

----------------------------------

Important:

 

If someone then chose 200% evidently making Oxide print Increase ram since it would be defaulted to 4gb, would it be possible to make it only show the 6GB option, rather than both the 8GB and 6GB? Blocking them from choosing 8GB.

 

Furthermore, 

 

If someone then chose 300% make them only be allowed to select 8GB rather than both 6GB and 8GB.

 

🙂 Hopefully this helps a little more.

Edited by aovaex
Link to comment
Share on other sites

8 hours ago, aovaex said:

Any suggestions on how exactly I would go about doing this would be very much appreciated. Sorry if this is confusing.

my head hurts... 🤕

8 hours ago, aovaex said:

1. Increase intervals from 1 to 100, starting from 200.

this one is simple enough - in configureproduct.tpl, you already have...

{if $configoption.id eq 35}
step: 5,
from: 50,
postfix: "% CPU",
{/if} 

below that, just add...

{if $configoption.id eq 50}
step: 100,
postfix: "% CPU",
{/if} 

that should make that particular slider move in steps of 100...

for 2 & 3, i'll need to go away and come back with a clear head... my head has exploded and i'm still collecting all the pieces! 🤯

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...
On 07/04/2019 at 23:40, aovaex said:

How did you go? 🙂

do you still want me to look at this ? i'm currently working through a backlog of projects and haven't had much of a chance to look at this yet.

i've tried to block it out of my memory, so I might need a long run up! courir.gif

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • 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