Jump to content

Show Configurable Option in Products view


Recommended Posts

Hello! I'm trying to get the Configurable Option to show next to the Product name in the client area products view.

Is there a way to pull this without having the product selected and heading to productdetails?

Essentially, configoption is server location. Looking to show {$service.group} - {$service.product} - {$configoptiondetails}

Screenshot attached.

Any insight?

 

Thanks!

Screen Shot 2020-11-02 at 11.51.34 AM.png

Link to comment
Share on other sites

16 hours ago, Metahuman Network said:

Is there a way to pull this without having the product selected and heading to productdetails?

you could use a ClientAreaPageProductsServices hook to loop through the $services array in the template, and modify the $service.product value to contain your preferred layout (optionally checking it's a VPS product first) - group name & product should already exist in the array, so a database query to obtain the configurable option value you need will be required.

btw - are you aware of the CSS issue in your "join our mailing list" option at checkout where it's showing with 100% height ??

jssgvcm.png

Link to comment
Share on other sites

  • 1 month later...

So I went a different route for this and just used available smarty array variables.

For clientareaproducts:

<td><strong>{$service.group} - {$service.product}{if ($service.group == 'WireGuard')} - {$service.server.name|replace:'WG - ':''|replace:'1':''|replace:'2':''|replace:'3':''}{/if}</strong></td>

I use a custom hook to assign to a server group upon provision, so I just pull the server name and remove the formatting/id scheme to just display the City/State for products in that group.

Displays as:

1002573386_ScreenShot2020-12-03at1_02_02PM.png.09cfa87d36619ea320be241da88691c2.png

 

For clientareaproductdetails:

{if $configurableoptions && $groupname=='WireGuard'}
                        {if !$domain && !$moduleclientarea} in active{/if}
                            {foreach from=$configurableoptions item=configoption}
                                <h4>{if $configoption.optiontype eq 3}{if $configoption.selectedqty}{$LANG.yes}{else}{$LANG.no}{/if}{elseif $configoption.optiontype eq 4}{$configoption.selectedqty} x {$configoption.selectedoption}{else}{$configoption.selectedoption}{/if}</h4>
                            {/foreach}
                        {/if}

Since WHMCS already pulls the Configurable Options info for this page, just have to limit it to a group and display where you want it.

1299614965_ScreenShot2020-12-03at1_02_23PM.png.cb69a32cdc5c8ff6c6cfd601f10d0cd7.png

 

🙂

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