Jump to content
burt

Responsive osCommerce - Bootstrap

Recommended Posts

jQuery 2.2.2 is now Core

 

Thank you @@altoid, @@Tsimi, @@piernas for testing and commenting.


This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest Responsive osCommerce CE (community edition) here

Share this post


Link to post
Share on other sites

Searching by Product Model is now Core.

Searching by GTIN is now Core.

 

Thank you @@Tsimi for the code and push.

Thank you to the testers for testing and commenting.


This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest Responsive osCommerce CE (community edition) here

Share this post


Link to post
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 ?


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

Share this post


Link to post
Share on other sites

Have you found a situation where user.css ends up being linked before other CSS (linked files or in-line style tags)? If so, your suggestion might be good for preventing that. It doesn't seem to happen in a vanilla store, but add-ons might do something to insert links or in-line code after user.css in the head area. That brings up the question of whether user.css should be last word in the CSS definitions, or if certain add-ons should be allowed to override it. If the latter, and multiple add-ons are making conflicting CSS definitions, who should prevail?

Share this post


Link to post
Share on other sites

Have you found a situation where user.css ends up being linked before other CSS (linked files or in-line style tags)? If so, your suggestion might be good for preventing that. It doesn't seem to happen in a vanilla store, but add-ons might do something to insert links or in-line code after user.css in the head area. That brings up the question of whether user.css should be last word in the CSS definitions, or if certain add-ons should be allowed to override it. If the latter, and multiple add-ons are making conflicting CSS definitions, who should prevail?

 

Presumably the one with the highest sort order...

 

I'm struggling to imagine why an addon would need to add site-wide styles without allowing the siteowner to change them easily. If it's a module, then scoped styles can be used in the module template.


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (2.3.4.1 CE).

here: https://github.com/gburton/Responsive-osCommerce/releases

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

@@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

Share this post


Link to post
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.


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (2.3.4.1 CE).

here: https://github.com/gburton/Responsive-osCommerce/releases

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

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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.


This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest Responsive osCommerce CE (community edition) here

Share this post


Link to post
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.

Share this post


Link to post
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

Edited by burt

This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest Responsive osCommerce CE (community edition) here

Share this post


Link to post
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.

Share this post


Link to post
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.


This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest Responsive osCommerce CE (community edition) here

Share this post


Link to post
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

Share this post


Link to post
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.

Edited by burt

This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest Responsive osCommerce CE (community edition) here

Share this post


Link to post
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

Share this post


Link to post
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.

Edited by burt

This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest Responsive osCommerce CE (community edition) here

Share this post


Link to post
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.

Share this post


Link to post
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.

Edited by burt
goddamn quoting

This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest Responsive osCommerce CE (community edition) here

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

And what about adding user.css as a header tags module enabled by default instead of adding it to template_top.php? It feels like a user module, too.

Share this post


Link to post
Share on other sites

OK, the discussion is done.  Let's move on.

 

@@kymation

 

 

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.

This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest Responsive osCommerce CE (community edition) here

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×