Jump to content

custom.css for Orderforms templates


So, who am I ?

Recommended Posts

Hello 😊

I'd like to edit orderforms template .css file, I copied the orderform folder that I want to use. I see form the browser that orderforms styles come from all.min.css file, I tried to edit there but it didn't work, then I found here that I should edit style.css file in orderforms folder but it doesn't work.

 

Any help will be much appreciated 😊

 

Link to comment
Share on other sites

4 minutes ago, So, who am I ? said:

then I found here that I should edit style.css file in orderforms folder but it doesn't work.

it should do - if I edit premium_comparison/css/style.css and change the h3 font size to 64px, I get this...

1qhX368.png

though you could achieve the same result by using /templates/six (or custom)/css/custom.css and slapping an !important to it.

#order-premium_comparison h3 {
    font-size:64px !important;
}

personally, i'd recommend putting all your css changes in the same place, e.g custom.css, where possible - remembering to keep a backup in case the auto-updater overwrites it.

Link to comment
Share on other sites

weird thing is that I wanted to use Universal Slider template, but no matter what I choose, browser still shows Standard Cart .css files, I deleted cache and restarted browser, checked it from another browser but it still shows Standard Cart files.

 

5 minutes ago, brian! said:

personally, i'd recommend putting all your css changes in the same place, e.g custom.css, where possible - remembering to keep a backup in case the auto-updater overwrites it. 

that's what I was doing, putting all my css in custom.css file, but template styles come from all.min.css and browser shows that file is included after custom.css so it overwrites it.

Link to comment
Share on other sites

3 minutes ago, So, who am I ? said:

weird thing is that I wanted to use Universal Slider template, but no matter what I choose, browser still shows Standard Cart .css files, I deleted cache and restarted browser, checked it from another browser but it still shows Standard Cart files.

it will depend where you are in the cart ordering process - if at the first stage (products page), then it should be using universal_slider/css/style.css - at all stages after that, it will revert to standard_cart

10 minutes ago, So, who am I ? said:

that's what I was doing, putting all my css in custom.css file, but template styles come from all.min.css and browser shows that file is included after custom.css so it overwrites it.

it's included *before* it, so custom.css overwrites it - not the other way around.

lHkJnEK.png

if I add a font size to h2 in custom.css, it works in the browser...

#order-universal_slider .group-headlines h2 {
    font-size: 64px;
}

iMDuEIM.png

Link to comment
Share on other sites

1 minute ago, So, who am I ? said:

I'm at View Cart page: cart.php?a=view

then as I said previously, it will using standard_cart by the time it gets to viewcart.

9 minutes ago, So, who am I ? said:

the ones you posted are six template styles and they come first in <head> tag 

the ones I posted are from the relevant orderform style.css files - not six/css/all.min.css - check it, they're not mentioned in there!

10 minutes ago, So, who am I ? said:

then comes this, orderforms template css

<link rel="stylesheet" type="text/css" href="/templates/orderforms/standard_cart/css/all.min.css?v=186983" />

ok then, let's change the font size of a product price shown in the viewcart stage - this *is* defined *only* in templates/orderforms/standard_cart/css/all.min.css ~ line 552 in v7.6.1

#order-standard_cart .view-cart-items .item-price span {
    font-size: 1.6em;
}

pVLjryD.png

but if we edit /templates/six/css/custom.css (which is called *before* the orderform css!) and use...

#order-standard_cart .view-cart-items .item-price span {
	font-size: 3.6em !important;
}

then we get...

NDpCkJF.pngSCe6v23.png

as long as you're not trying to change something in standard_cart/css/all.min.css that already uses !Important, then you should be able to change it with code in custom.css thanks.png

Link to comment
Share on other sites

ah sorry for confusion, it works now, no idea what happened to it before, but it clearly works now!

at domain registration page (cart.php?a=add&domain=register) it uses StandardCart as well, I want to delete some extra html from it, but thought to make copy of StandardCart as StandardCartModified and do all htm editing in it, but how can I make system switch to StandardCartModifeid instead of StandardCart ? for first page I use Universal Slider.

 

Link to comment
Share on other sites

13 minutes ago, So, who am I ? said:

ah sorry for confusion, it works now, no idea what happened to it before, but it clearly works now! 

no worries - though I was starting to question my sanity on the topic!

14 minutes ago, So, who am I ? said:

at domain registration page (cart.php?a=add&domain=register) it uses StandardCart as well, I want to delete some extra html from it, but thought to make copy of StandardCart as StandardCartModified and do all htm editing in it, but how can I make system switch to StandardCartModifeid instead of StandardCart ? for first page I use Universal Slider.

the domain registration page uses the default order form template - which will be standard_cart if you choose any of the slider/comparison orderform templates.

once you've duplicated the SC folder, then the duplicate folder icon should appear in setup -> general settings -> ordering -> default order form template

I55kqN1.png

so you could make that your default orderform template and the domain reg/trans pages would use it, or if you still want Universal Slider to be the default and use this modified SC, then you'd need to edit the theme.yaml file in the universal_slider folder and change it to...

config:
    parent: standard_cart_modified

when you do a WHMCS update, you'll either have to do a file comparison between the two SC folders, or use the link in the changelog that shows the changes made in the release.

one other alternative would be to specify your default order form template in settings, e.g SC_modified, and then assign different orderform templates to each product group from the Products/Services page.

Link to comment
Share on other sites

Yes, when I duplicated SC folder, it appeared in General Settings >> Ordering tab.

I switched to Premium Comparison and have it as a default orderform template.1634142303_whmcsthemes.thumb.JPG.6280cd792d56bfd246ec75773273646d.JPG

 

Edited Premium Comparison's theme.yaml file and now it looks like this:

config:
    parent: standard_cart_modified

 

but browser still shows standard_cart template files at domain registration page (cart.php?a=add&domain=register)

Edited by So, who am I ?
Link to comment
Share on other sites

2 hours ago, So, who am I ? said:

browser still shows standard_cart template files at domain registration page (cart.php?a=add&domain=register)

it will do - the reason is that nearly all of the templates in SC have references to files in SC and you'll have to edit these files in your standard_cart_modified folder and change the references of 'standard_cart' to 'standard_cart_modified' - domainregister.tpl (and transfer) have 4 each, common.tpl has 2.. e.g common.tpl would change from...

<link rel="stylesheet" type="text/css" href="{$WEB_ROOT}/templates/orderforms/standard_cart/css/all.min.css?v={$versionHash}" />
<script type="text/javascript" src="{$WEB_ROOT}/templates/orderforms/standard_cart/js/scripts.min.js?v={$versionHash}"></script>

to...

<link rel="stylesheet" type="text/css" href="{$WEB_ROOT}/templates/orderforms/standard_cart_modified/css/all.min.css?v={$versionHash}" />
<script type="text/javascript" src="{$WEB_ROOT}/templates/orderforms/standard_cart_modified/js/scripts.min.js?v={$versionHash}"></script>

though I suppose it's arguable whether to leave common.tpl alone as after updating, at least you know WHMCS will be using the latest orderform css/js files for your installed WHMCS release... swings and roundabouts - I guess it depends on the extent of your planned template modifications and how easy you want the update process to be.

Link to comment
Share on other sites

13 minutes ago, brian! said:

it will do - the reason is that nearly all of the templates in SC have references to files in SC and you'll have to edit these and change them to 'standard_cart_modified' - domainregister.tpl (and transfer) have 4 each, common.tpl has 2..

Okey, hold on.. I have to edit Standard Cart template files and change all standard_cart to standard_cart_modified wherever there is an include command and then what's the use of editing theme.yaml file ? Does system ignores theme.yaml file ? It seems like even after editing theme.yaml file, system still visits standard_cart templates and then follows include commands in them. What's the job theme.yaml file does here ? I guess I'm missing something...

Link to comment
Share on other sites

27 minutes ago, So, who am I ? said:

Okey, hold on..

grips desk tightly.

27 minutes ago, So, who am I ? said:

I have to edit Standard Cart template files and change all standard_cart to standard_cart_modified wherever there is an include command and then what's the use of editing theme.yaml file ?

because editing theme.yaml tells universal slider to use standard_cart_modified and not standard_cart.

27 minutes ago, So, who am I ? said:

Does system ignores theme.yaml file ?

no - it obeys it.

27 minutes ago, So, who am I ? said:

It seems like even after editing theme.yaml file, system still visits standard_cart templates and then follows include commands in them.

it will do if you haven't modified the templates in standard_cart_modified, because as I said previously, they're nearly all hardcoded with links to standard_cart - they've been that way since v6... perhaps there is a reason why this is the case and they don't just use {$carttpl} instead, but i've never asked or delved too deeply into the minds of their developers. 😱

27 minutes ago, So, who am I ? said:

What's the job theme.yaml file does here ?

it tells Universal Slider which orderform template to use for any templates that are missing - basically everything apart from products.tpl...

ok, let me give you an example - default orderform template is universal slider; i've modified theme.yaml to use SCM and then I edit the domainregister.tpl file in SCM - i've changed references of SC to SCM and then tweaked the following line to tell me which cart template it's using...

<p>{$LANG.orderForm.findNewDomain} (Carttpl = {$carttpl})</p>

yrJs3D9.png

so I *know* that it's using SCM and not SC. thanks.png

if I look at the browser source code of the page, I see the following...

<link rel="stylesheet" type="text/css" href="/templates/orderforms/standard_cart/css/all.min.css?v=aecf76" />
<script type="text/javascript" src="/templates/orderforms/standard_cart/js/scripts.min.js?v=aecf76"></script>

<div id="order-standard_cart_modified">

which shows that it's using SC's js/css files (because I haven't modified common.tpl), but the div confirms that it's using the standard_cart_modified template and not standard_cart.

Link to comment
Share on other sites

48 minutes ago, brian! said:

ok, let me give you an example - default orderform template is universal slider; i've modified theme.yaml to use SCM and then I edit the domainregister.tpl file in SCM - i've changed references of SC to SCM and then tweaked the following line to tell me which cart template it's using...

ah now I got it, before I thought I had to edit SC template files and change references of SC to SCM and it got me confused 🙄

 

1 hour ago, brian! said:

though I suppose it's arguable whether to leave common.tpl alone as after updating, at least you know WHMCS will be using the latest orderform css/js files for your installed WHMCS release... swings and roundabouts - I guess it depends on the extent of your planned template modifications and how easy you want the update process to be.

so it means, I can leave common.tpl alone and it will work without problems at least before update. since I want update process to be easy, I guess I'll edit common.tpl too 😀 

 

Thanks a lot for your help, as usual! 🙏😊

Link to comment
Share on other sites

8 minutes ago, So, who am I ? said:

ah now I got it, before I thought I had to edit SC template files and change references of SC to SCM and it got me confused 🙄

sorry - I probably worded it badly... i've edited the post to make it clearer for others.

11 minutes ago, So, who am I ? said:

so it means, I can leave common.tpl alone and it will work without problems at least before update. since I want update process to be easy, I guess I'll edit common.tpl too

to make the update process easier, i'd be tempted to leave common.tpl alone... that way, even after updating WHMCS, your modified SC template should still be using the latest js/css for the cart and so should cause less errors in the cart... but as I said previously, it depends upon the extent of your changes and I don't think there's any "right" answer for this, just what you feel is best for your situation.

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