Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Responsive osCommerce - Bootstrap


Recommended Posts

Any addon that adds content to the header or footer could add site-wide styles. Other addons could add styles that apply only to the page or pages where they have effect.

 

In either case, these styles are added after user.css. This means that they cannot be overridden by the user.css, so the store owner must modify the addon files to change the style. This is only slightly better than changing core code.

 

I suggest that the link to user.css be moved below the header tags module call in template_top.php so that store owners can continue to use user.css to override any style.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

  • Replies 2.2k
  • Created
  • Last Reply

@@burt @@kymation

in soccer terms, I giva a one-line pass, and Jim kicks it in the goal. I think it takes a native english speaker to express things so eloquently :D

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

Any addon that adds content to the header or footer could add site-wide styles.

 

 

 

Yes, I agree they could, but they don't need to. A scoped style within the template would affect only the header or footer. As long as it's the first thing in a div it's proper html.

 

That said, I don't see any reason not move user.css to the end of the head.

Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Link to comment
Share on other sites

I didn't say that it would be a good idea to add site-wide CSS in a module, but it can still be done, so we should have a way to override it. I always try to target the CSS of my modules to the module only. My latest scheme is to use the module's filename as an ID in the outermost DIV. That allows module CSS or CSS in the user.css to target that module without messing up anything else. I'll probably stick with that practice unless I find something better.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

I know this is a young born version of e-commerce shop and there is still a lot to do.

I wish I could help but I'm just smart enough to messed up.

 

My suggestions for the near future (next week?) ; 

 

Buttons, prices should be core able/disable on x page(s), also a select/create image directory to managed images

Frontpage must be one page, not devided into navigation, header, front page, footer, footer suffix.

Everything available on the whole page. I am the director of that page and decide where the navigation, header, logo, banner comes. 

Whithout LIMITS, that should be THE SHOP Builder that everybody wants. (in my opinion).

 

Addons must be as much as possible Modules, checked and approved to use with version x.

And BS addons musy have their own section in the download section.

Link to comment
Share on other sites

just looking at template_top and i was wondering if you want to tweak something css wise that has been added via the header_tags, wouldn't it be most logical to have the user.css just before the ending head tag ?

 

Could you give an example of such ?  I can't think of an example ... I am not very good at thinking, lately.

Link to comment
Share on other sites

@@burt  Consider a content module that does something needing CSS: a product carousel or banner rotator being typical. I need to add the CSS for those to work, so I shove that into a header tag. But that code ends up below the user.css so the store owner can't override it. It can be added into the module's template, but that has the added disadvantage of resulting in bad HTML output.

 

Need more? I have some code that does this if you want to look.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

@@kymation

 

OK makes sense...somewhat.  I may be underthinking things...please forgive me.

 

Let's say {addon maker} makes a rotator.  Why would {shopowner} want to change the .css in it?  I think most shopowners simply want an addon that works, and don't tend to look at specific changes.  Of course, there will be shopowners that do want to change things...so here's three options ...

 

1.  Put their new .css directly into the rotator template file (scoped)

2.  Put their new css into the usual user.css - but marked !important

3.  They (or {addon maker}) could make a hook file to add in extra css as required and place the hook just before /head

.sometext {
  color: blue;
}
.sometext {
  font-weight: bold;
}
.sometext {
  color: red !important;
  font-weight: normal;
}
.sometext {
  font-style: italic;
  color: black;
}

There you have 4 pieces of css each changing "sometext"...does not matter whether that's all in 1 file, or spread over multiple files.  What *should* happen:

<p class="sometext">Blah blah blah</p>

Outputs https://jsfiddle.net/z3q0odhL/ :

 

Blah blah blah

Link to comment
Share on other sites

@@burt  Most store owners will just use the addon as it stands. I'm thinking of the ones who want to make changes, and fill up the support forum asking how to do that, or complaining that the usual method doesn't work.

  1. It's easy enough to change the template, but it feels like something worse than changing the user.css, more like changing core code. This is what I've recommended in the past, even though I don't like it.
  2. The !important tag is something of a CSS hack. I hate using it. Better is to make the CSS selector more specific. However, both of these require more knowledge of CSS that most of the store owners I've had to deal with.
  3. While the hook will work, it's adding yet another separate piece to what should be a simple addon. Store owners have enough trouble getting the files in the right places as it is, so I prefer to keep an addon as compact as possible.

While all of your solutions will work, they add more complexity, or require more knowledge on the part of the user, than simply moving the user.css to the bottom of the head. Do you have some reason to not do this?

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Further option:

Addon maker does not put his css into header, instead he directs user to add to user.css

 

I don't see a valid need to change what already exists.  

The template files are provided for the exact purpose of shopowners changing them (as they will never change in core) - making updates easy.

Link to comment
Share on other sites

honestly, i cant understand why this little suggestion creates so much resistance. i thought the whole point of content modules was have easy one click installs without having to change any source code so you can keep up to date without conflicting changes.

ifandwhen i start using bs, i will just put it at the end just before the closing head.

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

Jim came up with a potential problem, I bounced back with four solutions.  None of them good enough?  LOL

 

If and When you start using BS, you will see that what we have now works perfectly well.

 

And don't get mixed up between "content modules" and "header tag modules".  HT modules generally don't output HTML.

Link to comment
Share on other sites

Jim came up with a potential problem, I bounced back with four solutions.  None of them good enough?  LOL

 

If and When you start using BS, you will see that what we have now works perfectly well.

 

And don't get mixed up between "content modules" and "header tag modules".  HT modules generally don't output HTML.

It is about the css that get's linked to in the header tag, I'd rather have my user.css as the final css in the head section

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

What you want:

1 click, done.

 

What I want:

1 click, done.

 

So far so good.

 

Based on my understanding of Jims example post (Jim, correct me on this if I've misunderstood) about a Rotator...

 

Jim has created a rotator content module.

- assume the module needs some .css

 

What Jim has done to solve this need for css...

 

Created a Header Tag module to inject these.

 

Now, for a shopowner to get a rotator working, it's two modules to install;

  1. the rotator content module
  2. the css header_tag module

To me, that seems dirty, when I have shown there are at least 4 ways to add in the necessary css and retain that "1 click, done" that we all want.

 

Everything can be done by the content module...easily.

Link to comment
Share on other sites

@@burt  Not quite right. The header tags code is all in the content module. It adds CSS to the header, adds a jQuery plugin to the header, and adds content to the body. One click, done.

 

Modifying the output of that module is where the difference is.

My way:

  1. Add CSS to the user.css like you've been told. Done.

Your way:

  1. Add CSS to the user.css like you've been told. Doesn't work.
  2. Read the instructions.
  3. Ask for help on the forum.
  4. Find and install Firebug in Firefox.
  5. Track down the obscure template file with the CSS.
  6. Modify that file and replace.

See the difference?

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Sorry for misunderstanding.

 

My way is not particularly this:

I haven't ever said that this is the correct way, only a way;

 

 


  1. Add CSS to the user.css like you've been told. Doesn't work.
  2. Read the instructions.
  3. Ask for help on the forum.
  4. Find and install Firebug in Firefox.
  5. Track down the obscure template file with the CSS.
  6. Modify that file and replace.

 

My way is more like this:

 

Addon maker does not inject css into header_tags from a content module.

Addon maker tells user;

 

 


Add this css code to the bottom of user.css...

 

I'm not particularly stuck on the idea of changing or not ... feel free to send a push.  It'll get tested, and if testing goes well, it'll get changed.

Link to comment
Share on other sites

@burtThat's still more complicated than moving the user.css call. Most of the users will not need to or want to change the CSS. You're making everybody modify a file just to suit the tiny precentage who want to make changes to the original.

 

My way is still one click ... done. Yours is one click then go modify a file and upload it.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Thank you to a very generous soul who has allowed me to give a number of hours solid coding into the Project:  THANK YOU.

 

Colorbox v1.6.3 is now Core

 

Customer Testimonials is now Core (part of SEO updates)

 

New Navbar Module for Testimonials is now Core

 

Thank you.  Thanks also to all the testers of the above, as always.

 

Being Tested

Products Meta (part of SEO updates)

Link to comment
Share on other sites

@@burt,

I also noticed that when you have 2 items in the cart, the stripes for the second item are light, and there is no visual clue as to where the content ends and the subtotals begin.

I just took a mental note, but since I'm not versed in bootstrap css, didn't know if/hw easy it would be to change this ...

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

I have just installed the default 2.3.4BS, and nothing has been modified yet in the default database.  However, in admin, when I click on the link for Categories/Products, I get a blank page, with no errors.

 

Ron

Link to comment
Share on other sites

Blank page, as in totally white blank page.

 

If 5.3 is minimum PHP version, my problem is that my live site (OSC v.2.2) is on the same server.  I am concerned that upgrading PHP might break something. 

 

I will be upgrading from PHP 5.2.17.  How should I proceed?

 

Ron

Link to comment
Share on other sites

  • burt locked this topic
  • burt unlocked and locked this topic

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...