Jump to content

Remove Sidebar if Configurable Product


jeffuk

Recommended Posts

16 minutes ago, jeffuk said:

Anyone have a hook that removes the sidebar if a product has configurable options? 

I don't think there is one... removing the sidebars via a hook is simple enough...

JH6xB4q.png

but the template isn't designed to adjust full width if the sidebars aren't there...

9TEr9AQ.png

I suspect you're looking at customising configureproduct.tpl and changing the <div> widths 3/9 based on whether {$configurableoptions} exists.

Link to comment
Share on other sites

4 hours ago, jeffuk said:

Thanks Brian. I am thinking to maybe use another order template to load this product.

if you're using any recent version (within the last year or two), then your options will be limited... ALL of the default orderform templates (Cloud & Universal Sliders, Pure/Premium/Supreme Comparisons) that are still being updated, will use Standard_cart by the time they get to the product configuration stage... Modern and Boxes wouldn't, but while they're still being shipped with WHMCS, they haven't been updated for a long while... so they might work for now, but are probably not a good long-term option.

Link to comment
Share on other sites

42 minutes ago, jeffuk said:

I have given up. Literally.

don't let it beat you, Jeff... there will be more bumpy issues down the road using WHMCS than this!!

42 minutes ago, jeffuk said:

I am now just going to look at how the sidebar categories can be minimised rather than removed.

I don't think Andrew's code worked in the thread below... though I can't recall trying it personally.

42 minutes ago, jeffuk said:

I hate them.

modifying the template would be the way to go with this...

On 12/11/2017 at 18:31, brian! said:

I suspect you're looking at customising configureproduct.tpl and changing the <div> widths 3/9 based on whether {$configurableoptions} exists.

so in standard_cart/configureproduct.tpl, this...

        <div class="pull-md-right col-md-9">

            <div class="header-lined">
                <h1>{$LANG.orderconfigure}</h1>
            </div>

        </div>

        <div class="col-md-3 pull-md-left sidebar hidden-xs hidden-sm">

            {include file="orderforms/standard_cart/sidebar-categories.tpl"}

        </div>

        <div class="col-md-9 pull-md-right">

becomes...

        <div class="pull-md-right col-md-{if $configurableoptions}12{else}9{/if}">

            <div class="header-lined">
                <h1>{$LANG.orderconfigure}</h1>
            </div>

        </div>
		{if !$configurableoptions}
        <div class="col-md-3 pull-md-left sidebar hidden-xs hidden-sm">

            {include file="orderforms/standard_cart/sidebar-categories.tpl"}

        </div>
		{/if}
		
        <div class="col-md-{if $configurableoptions}12{else}9{/if} pull-md-right">

and if a product has configurable options, it doesn't load the sidebar (so no need for a hook), and auto adjusts the width of the page... :idea:

RtLMrqq.png

sidebars gone. :871_white_check_mark:

Jeff less stressed. :871_white_check_mark:

problem solved. :871_white_check_mark:

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