Jump to content

- Solved - Adding JS/CSS files to "Documents"


Recommended Posts


I am seriously concidering changing our e-commerce platform from PrestaShop to either CubeCart or OpenCart. I have been playing around with CubeCart, and so far I think I like it. The back-office is pretty straigth forward and to the point, which I like. However it need to tick some boxes before setting sail on this swap project, so I was wondering if there is an easy way to add JS and CSS files to the "Documents" section of cubecart? It it the "main.php" in the skin folder i need to add the info, or is there another more suitable place? 


Thanx in advance


/ Elviz

Link to comment
Share on other sites

When you say the "Documents" section, are you referring to:

* admin, Documents: the screens where you compose/edit the site's documents
* the actual document content: that is, <script> and <style> inline tags
* the storefront area that lists the documents available
* the storefront main area that displays a site document

For each, yes, javascript and CSS can be easily applied. Each will take a common procedure but use different parameters for each procedure.


Link to comment
Share on other sites

  • 5 months later...

Sorry late reply, bsmither. Thank you for answering though. Hopefully I will get some time to play around with this now =) 

I would like to create a new "cms" page with some js accordion.

I will need to reproduce, one way or another, the page we now got in our active store (wich is pretty slow and outdated, unfortunately. Hence the future migration)


Thanx in advance,


Link to comment
Share on other sites

Eventually I figured it out. Since I can't stand finding threads where they say they found a solution to the problem without posting the procedure, I'll add what i did, incase it could be of help to others.

Short version:

Basically I just added the css and js files to the theme and added the link in the main.php

Long version:

01.Download and edit main.php from your theme/skin folder. I.E yourdomain.com/skins/foundation/templates/main.php

02. Add the css link(s) with the other links (at the top) I.E: <link href="{$STORE_URL}/skins/{$SKIN_FOLDER}/css/yourcss.css" rel="stylesheet">

03. Add the ja link(s) with the other links (at the bottm) I.E: <script src="{$STORE_URL}/skins/{$SKIN_FOLDER}/js/vendor/yourjs.js" type="text/javascript"></script>

04. Upload the actual css and js files to the folders

05. Go to your backoffice, enter the "Pages" section. Find/Create the page you want your code in. Switch to code mode (upper left option of the text editor) and enter the html code. I.E:

<div class="test-container">
<h1 class="heading-primary">Animated Accordion</h1><div class="accordion">
    <dt><a aria-controls="accordion1" aria-expanded="false" class="accordion-title accordionTitle js-accordionTrigger" href="#accordion1">Header Text Here</a></dt>
    <dd aria-hidden="true" class="accordion-content accordionItem is-collapsed" id="accordion1">
    <p>Lorem ipsum dolor sit amet, consectetur.</p>

06. Save and enter page to check if it works.


In my case I had to add the actual js code to the bottom. Linking to it did not work. Not sure why.


If this procedure is a rather dirty one, and there is a cleaner way to to this, feel free to add the info. I pretty much operate within the "shot in the dark"-philosophy. =)




Link to comment
Share on other sites

A little typo there. Ment "Bottom" Bottom of the main.php with the rest of the js scripts. Yeah I can't quite seem to find out what is going on. Right now it looks like I need both the script itself PLUS the link to file containing the same script, and I might not know so much about these things, but this does not make sense to me, as one source in most occasions should be enough =D 

Link to comment
Share on other sites

I might have to do that yes. It needs to wait a little now though, as I'm working on ironing out all the other checkboxes that needs to be ticked before concidering moving from PrestaShop. Right now the language settings is killing me. Can't seem to get Norwegian up and running....

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.

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.

  • Create New...