Latest News: (loading..)
Omar_one

Specials Ribbon Overlay For OsCommerce 2.3.4/BS

54 posts in this topic

New update  

1. The ribbon not working well with Safari .. I have just added some fixes for it.

2. change the ribbon text from (Sales) to (Sale).  

 

Omar

Mikepo likes this

Share this post


Link to post
Share on other sites

@@Omar_one  Omar when you were working on this did you (or anyone else reading this for that matter) come across anything that might also allow you to add different ribbons...ie Ships for Free, Discontinued Item or whatever? 

 

Dan

Share this post


Link to post
Share on other sites

@@Omar_one  Omar...I had a little time yesterday so I set up a hook for this.  I'm now thinking that it should have been a content module but I felt like messing around with a hook so that it what I did.  A content module would allow for some configuration settings. In any case at this point it is a hook and is just set up for "specials" but I wrote it in a way that we could add different queries for example a new product, best seller or whatever and it would display a different ribbon.  The idea being that we could have a series of queries and it would show a different ribbon based on those queries and if/case statements.   If you like PM or email me and I'll send you what I have while I continue to develop it.

 

Dan 

Share this post


Link to post
Share on other sites

Posted (edited)

Thought a quick update was in order.  I have now added this to my live shop and I quite like the way it looks.  It quickly brings special items to the attention or our customers.

 

As you might recall from my initial post, it entered this world as a hook and has remained that way so far.  I'm not sure there is any real value in converting it to a content module but we'll see where it takes us.   At this point I've added the hook to the product listing and new products page so it shows up on most pages but still needs to be added to the also purchased page and perhaps there are other pages where it should be included as well.  My intention is to have it included on all product listing type pages.

 

As for what the hook now does.  So far it is set up to display a ribbon, using different colors and text, for new products, specials and for free shipping.  It should be easy to add other ribbons as the ideas arise.  I've also included the css directly within the hook but I'm leaning to having it in a separate css file.  I just don't like seeing the css in the source code.  If anyone wants to have a look at this or install it, pm me with your email address and I'll send you the code.  Once it is tested by a few, I'll post the code here so anyone that wants it, or wants a chuckle at my coding skills, can have it.

 

Dan

Edited by Dan Cole

Share this post


Link to post
Share on other sites

I had a few minutes today to play around with this again and as I was tweaking the css for one of the pages I realized it was messing with the css created by my ribbon overlay hook on another page.  Turns out that my product listing boxes are a slightly different size then the boxes on my specials and new products pages.   I'm not sure if that is unique to my site or is standard osC but in any case as I was looking for a way to solve this I started thinking about ways to load different css code depending on the page you were calling and came up with this. 

 

<body id="<?php echo basename($_SERVER['PHP_SELF'], ".php")."-page"?>">

 

It gives you a unique ID (ie #index-page when on the index page or #specials-page when on the specials page etc.) for each page when added to template_top in place of the standard <body> tag.  You can then target and alter the stardard css elements differently from page to page to set different sizes, fonts, colors etc.   Of course it is not my original idea, just a trick I discovered and thought I would try to solve the problem I was having and as it turns out, it works like a charm. 

 

The only problem I have is that it alters cord code and I would like to avoid that if possible.  Can anyone think of another way to do this without altering the core?

 

Dan

 

 

 

 

 

 

 

 

 

 

 

Share this post


Link to post
Share on other sites

Posted (edited)

On 2017-05-19 at 11:46 PM, Dan Cole said:

<body id="<?php echo basename($_SERVER['PHP_SELF'], ".php")."-page"?>">

It gives you a unique ID (ie #index-page when on the index page or #specials-page when on the specials page etc.) for each page when added to template_top in place of the standard <body> tag.  You can then target and alter the stardard css elements differently from page to page to set different sizes, fonts, colors etc.   Of course it is not my original idea, just a trick I discovered and thought I would try to solve the problem I was having and as it turns out, it works like a charm. 

The only problem I have is that it alters cord code and I would like to avoid that if possible.  Can anyone think of another way to do this without altering the core?

In the end I decided to scrap this idea and simply added the couple of css elements that needed to be changed as an inline style, to the hook, for the particular pages where they needed to be overridden. 

At this point I think I'm ready to stick a fork in this hook development and call it done.   It is now deployed on my live site.  As it stands now, it displays the appropriate ribbon (on sale, new item or ships free) on any page where the product can be viewed.  Core changes are required to several pages since the hook needed to be registered and called.  I ended up moving the css to a separate .css file since I didn't want to see displayed in the source.

If anyone wants the hook send me a PM....I'm hoping that the placement of the hook in the individual files doesn't cause any grief for anyone so I'm still looking for a few folks to test it out before letting it loose in the community.

Dan

Edited by Dan Cole

Share this post


Link to post
Share on other sites

I did use in my shop too, it works very will no bugs it's a great add-on and a great work from Omar_one

Share this post


Link to post
Share on other sites

Manfred I saw that you were using it too....all I did was to turn it into a hook and add a few preconfigured ribbons.   It is definitely a good find by Omar.

Dan

Share this post


Link to post
Share on other sites

Dan, my version at Github don't have this add-on, but my inofficial version have it with preconfigured ribbon too. Yes, it's a very good work of Omar.

Share this post


Link to post
Share on other sites

Interesting...did you package it up as a hook, module or hard code it?

Dan

Share this post


Link to post
Share on other sites
2 hours ago, Dan Cole said:

Interesting...did you package it up as a hook, module or hard code it?

Dan

Modul, but sorry not for the community

Share this post


Link to post
Share on other sites

Hi all.

It would be great to do a Ribbon for products with zero stock (out of stock).

Best Regards.

Valqui

Share this post


Link to post
Share on other sites

Out of stock Ribbon For OsCommerce 2.3.4/BS

Hi Omar_one,

First let me say thank you for the great addon. Been looking for something like this forever lol.

I downloaded it this morning but found that it only has the picture and I can open or get the instructions on what files I need to change. I also downloadedd the origianl Special Ribbon overay but when I opened "Catalog/includes/modules/product_listing.php" to change the code I did not have the section that I am suppose to change. 

Did I miss something ?

Thanks again for this add on.

Tracie

Share this post


Link to post
Share on other sites

Posted (edited)

@sunshynecraftsbeads are you using  the Responsive version?

you can post the product_listing.php here or PM it to me
BR
Omar
 

Edited by Omar_one

Share this post


Link to post
Share on other sites

New update
Now the ribbons (Out of stock Ribbon and Specials Ribbon) will work with multi language shop.

BR
Omar

valquiria23 likes this

Share this post


Link to post
Share on other sites

Posted (edited)

@Omar_one

Try to make the changes but I have a question:

in the file: /includes/modules/product_listing.php

I find the following code:


If (PRODUCT_LIST_BUY_NOW> 0) {
         $ Prod_list_contents. = '<Div class = "col-xs-6 text-right">'. Tep_draw_button (IMAGE_BUTTON_BUY_NOW, 'fa-shopping-cart', tep_href_link (basename ($ PHP_SELF), tep_get_all_get_params (array ('action')). 'Action = buy_now & products_id ='. $ Listing ['products_id']), NULL, NULL , 'Btn-success btn-sm'). '</ Div>';
       }

And not those you mention:

  If (PRODUCT_LIST_BUY_NOW> 0) {
         $ Prod_list_contents. = '<Div class = "col-xs-6 text-right">'. Tep_draw_button (IMAGE_BUTTON_BUY_NOW, 'fa-shopping-cart', tep_href_link (basename ($ PHP_SELF), tep_get_all_get_params (array ('action')). 'Action = buy_now & products_id ='. $ Listing ['products_id']), NULL, NULL , 'Btn-success btn-sm btn-product-listing btn-buy'). '</ Div>';
       }

I use OSC EDGE, where is the difference?

Thank you very much!!

Valqui

Edited by valquiria23

Share this post


Link to post
Share on other sites

@valquiria23 there is no difference, the change what mention from the last Edge version.
you can change the code what you find it.

BR
Omar

 

 

valquiria23 likes this

Share this post


Link to post
Share on other sites
On 6/16/2017 at 10:00 AM, Omar_one said:

@sunshynecraftsbeads are you using  the Responsive version?

you can post the product_listing.php here or PM it to me
BR
Omar
 

Hi Omar,

Yes I am.  :D

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now