Jump to content
Latest News: (loading..)

Recommended Posts

This is the support topic for the Featured Products BS Addon.

All credits to DunWeb Designs. I just converted to Bootstrap and fix some minor typos.

 

http://addons.oscommerce.com/info/9355

 

Core code changes are necessary but only very, very few.

 

Enjoy!


When you ask for help/support:

  • Always state your osCommerce version
  • If possible, list up installed add-ons
  • 3rd party templates are not supported in the forum

Latest osC: osCommerce CE (Community Edition aka. Edge)

 

Share this post


Link to post
Share on other sites

------ Oups error

Edited by Gyakutsuki

Regards
-----------------------------------------
Loïc

Contact me by skype for business
Contact me @gyakutsuki for an answer on the forum

Tuto for 2.4 :
- How to Display a new page with app
- How to make Header Tags under app APP
- How to make a
boostrap modal with external element

Share this post


Link to post
Share on other sites

just wondering, why don't you use kymations frontpage and plug into that as a content module ?


KEEP CALM AND CARRY ON
FYI Upgrade to the highest PHP version you can( PHP 5.5/5.6 or 7.1  and get big performance improvements for free)

But be aware php 5.5 is more strict about things.
UTF8-without BOM, no extra spaces allowed at the beginning or end of your php file, or your redirects wont work.
No double declarations of functions allowed - used to slip through the cracks ...

 

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

 @@Tsimi Thank you for your efforts.

 

Looks good.   Just need to add "Equal Height Divs (jQuery)" to the instruction Step 8.

 

This is something completely off topic but one that I'd suggest.  The following lines can change so the output is identical to the product_listing.  I realize this is cosmetic; however, I am having the entire site look the same when displaying products.

 

includes/modules/featured.php

      $featured_prods_content .= '<div class="col-sm-6 col-md-4">';
      $featured_prods_content .= '  <div class="thumbnail equal-height">';

to

      $featured_prods_content .= '<div class="col-sm-4 col-md-4">';
      $featured_prods_content .= '  <div class="productHolder equal-height">';

Share this post


Link to post
Share on other sites

@@bruyndoncx

 

The reasons why I didn't take Jims Modular frontpage version are;

1.

Featured products is just one part or piece of it and converting only that and the rest not did not make sense to me.

 

2.

In Jims version you don't have a dedicated page to add/remove products.

 

3.

In Jims version there were issues when you wanted to raise the amount of products to add/show. If i remember right there are changes to the SQL and files needed to change the amount, in DunWebs version you can set everything in the configuration section plus you don't have limits adding products. Don't know if that issue has been fix by know.

 

Of course Jims version is cleaner since it is a module based addon and i hope that he will convert and eventually extend his addon in the future.

 

@@marcello

 

Thanks. Just post your code here and i'll take a look.

And yes you are right, forgot to mention the equal heights thing which hopefully will not be an issue in the near future anymore once Bootstrap 4 has been released and implemented into the EDGE version.

Edited by Tsimi

When you ask for help/support:

  • Always state your osCommerce version
  • If possible, list up installed add-ons
  • 3rd party templates are not supported in the forum

Latest osC: osCommerce CE (Community Edition aka. Edge)

 

Share this post


Link to post
Share on other sites

@@bruyndoncx

 

The reasons why I didn't take Jims Modular frontpage version are;

1.

Featured products is just one part or piece of it and converting only that and the rest not did not make sense to me.

 

2.

In Jims version you don't have a dedicated page to add/remove products.

 

3.

In Jims version there were issues when you wanted to raise the amount of products to add/show. If i remember right there are changes to the SQL and files needed to change the amount, in DunWebs version you can set everything in the configuration section plus you don't have limits adding products. Don't know if that issue has been fix by know.

 

Of course Jims version is cleaner since it is a module based addon and i hope that he will convert and eventually extend his addon in the future.

I was working under the assumption that you could just plug your bs version into his framework as a content module, without having to touch the other files.

I'm not 100% sure about this, as I have not looked into all the technical details.


KEEP CALM AND CARRY ON
FYI Upgrade to the highest PHP version you can( PHP 5.5/5.6 or 7.1  and get big performance improvements for free)

But be aware php 5.5 is more strict about things.
UTF8-without BOM, no extra spaces allowed at the beginning or end of your php file, or your redirects wont work.
No double declarations of functions allowed - used to slip through the cracks ...

 

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

Ah i see... that would be not possible.

Jims featured products inside the Modular frontpage addon and the one i converted are not the same and they use different codes to achive the same goal.


When you ask for help/support:

  • Always state your osCommerce version
  • If possible, list up installed add-ons
  • 3rd party templates are not supported in the forum

Latest osC: osCommerce CE (Community Edition aka. Edge)

 

Share this post


Link to post
Share on other sites

@Tsimi

 

Attached are the three files that are needed.  Note that this content module is based upon the Reviews for the products page and the Recently Viewed content mode.  A few things that were done.

 

  1. removed TABLE_ to actual database name
  2. modified code to utilize information already queried in the index.php code (you may not want this; however, I just wanted to reduce db queries)
  3. moved the function that was added to general.php into the content module
  4. moved sql configuration into the content module
  5. introduced additional functionality in part by utilizing the same code structure as Review content module

 

The only change outside of adding these files would be the need to add the following lines to index.php.  There are three places that require these lines of code.  They are near both "include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS);" and include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING);

  <div class="row">
    <?php echo $oscTemplate->getContent('index'); ?>
  </div>

Again thanks for starting this as it was one of the features I wanted to include in my new build.  Hope this helps make it easier for 234BS integration.

cm_i_featured_products.php

featured_products.php

cm_i_featured_products.php

Share this post


Link to post
Share on other sites

@Tsimi - Please ignore my prior upload.  In my haste to clean up I accidentally deleted a letter and caused the module to not work correctly.  Please use this file along with the other two. 

 

Also, i forgot to mention the location of where each file is to be placed.

 

cm_i_featured_products.php (class file) => includes/modules/content/index/

 

cm_i_featured_products.php (language file) => includes/languages/english/modules/content/index/

 

featured_products.php => includes/modules/content/index/templates/

 

cm_i_featured_products.php

Edited by marcello

Share this post


Link to post
Share on other sites

@Tsimi  -  Found that when going to the main featured_products.php there were several notices generated due to product_listing.php not being provided the correct variables.  It just appears that the $select_column_list was not included in the query string.  Please see below as it does resolve the issue. 

  $listing_sql = "select p.products_id, SUBSTRING_INDEX(pd.products_description, ' ', 20) as products_description, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price, p.products_date_added, m.manufacturers_name
   from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id
   left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "'
   left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id
   left join featured f on p.products_id = f.products_id
   where p.products_status = '1' and f.status = '1'";

to:

  $listing_sql = "select " . $select_column_list . " p.products_id, SUBSTRING_INDEX(pd.products_description, ' ', 20) as products_description, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price, p.products_date_added, p.manufacturers_id
   from products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id
   left join products_description pd on p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "'
   left join specials s on p.products_id = s.products_id
   left join featured f on p.products_id = f.products_id
   where p.products_status = '1' and f.status = '1'";

At this point, I have tested and haven't found any other issues.  The only questionable functionality of the content module is when entering a category that does not have any features, the all inclusive list of products is displayed (which I prefer); however, it could be coded to go up to the parent category and retrieve only those products.

 

Other than that, let me know if you have any questions as I am moving on to a different project.

Edited by marcello

Share this post


Link to post
Share on other sites

@@marcello

 

That is more then enough. I will take a look at it now and then implement it into a new version.

Thanks again.


When you ask for help/support:

  • Always state your osCommerce version
  • If possible, list up installed add-ons
  • 3rd party templates are not supported in the forum

Latest osC: osCommerce CE (Community Edition aka. Edge)

 

Share this post


Link to post
Share on other sites

Featured Products BS v1.1

 

http://addons.oscommerce.com/info/9355

 

Thanks @@marcello :)

Edited by Tsimi

When you ask for help/support:

  • Always state your osCommerce version
  • If possible, list up installed add-ons
  • 3rd party templates are not supported in the forum

Latest osC: osCommerce CE (Community Edition aka. Edge)

 

Share this post


Link to post
Share on other sites

@@Tsimi :beers:  Again, thank you for getting this started.  I'll help out whenever I can :thumbsup:

 

PS - I've tried deleting the above files in my prior posts to reduce confusion as you have included them with the addon; however, the system will not let me as there appears to be an existing issue with the forum. 

Edited by marcello

Share this post


Link to post
Share on other sites

@@Tsimi

 

One last thing that I didn't catch til just now.  The database instructions do not specify the charset.  Not sure if this was done on purpose to keep it configurable. 

CREATE TABLE `featured` (
  `featured_id` int(11) NOT NULL AUTO_INCREMENT,
  `products_id` int(11) NOT NULL,
  `featured_date_added` datetime DEFAULT NULL,
  `featured_last_modified` datetime DEFAULT NULL,
  `expires_date` datetime DEFAULT NULL,
  `date_status_change` datetime DEFAULT NULL,
  `status` int(1) DEFAULT '1',
  PRIMARY KEY (`featured_id`),
  KEY `idx_products_id` (`products_id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

Share this post


Link to post
Share on other sites

@@Tsimi  Exactly.  I see that this is now in the code; however, for those that did an installation prior may have the wrong settings.  Thanks again for cleaning up those files.  Everything looks good. :thumbsup:

Share this post


Link to post
Share on other sites

Thanks to @@douglaswalker for spotting this.  http://forums.oscommerce.com/topic/408310-adding-font-awesome-icon-to-buy-now-code/?p=1733685

tep_draw_button(IMAGE_BUTTON_BUY_NOW, 'cart', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'sort', 'cPath'))

change 'cart' to 'fa fa-shopping-cart'

tep_draw_button(IMAGE_BUTTON_BUY_NOW, 'fa fa-shopping-cart', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'sort', 'cPath'))

Share this post


Link to post
Share on other sites

@@vampirehunter

 

A screenshot of what exactly? catalog side? admin side? both?

hi yes

both if someone has.

i checked the old version, it has screenshots.

 

So this BS Version is you load it, and then you add new products to be featured.

 

So its not like the other method where the core code is changed and you have a featured on/off button like in this old example tutorial

 

Edited by vampirehunter

Share this post


Link to post
Share on other sites

This Featured Products BS is simple to install code additions to 3 core files and no manual database changes.

To add and remove products you will have a own separate site in the admin section.

It's gonna look like the New products for.... on the home page and you will have a Featured Products listing kinda like the normal product listing but only with featured products.

 

Why don't you quickly install and look at it once. It shouldn't take you more then 5 min.

 

There are other featured products addons for Bootstrap osC but I have never looked at them so can't say much about them.


When you ask for help/support:

  • Always state your osCommerce version
  • If possible, list up installed add-ons
  • 3rd party templates are not supported in the forum

Latest osC: osCommerce CE (Community Edition aka. Edge)

 

Share this post


Link to post
Share on other sites

Hi Tsimi

 

How can i get the sort order to work with kymation's front page modular contribution please?

 

No matter what Sorting value i put Featured Products keep coming on top when i actually want it below another addon (Front Page New Products Carousel v1.1)

 

Thank you for all the time and effort you and others spend in making oscommerce what it is.

Share this post


Link to post
Share on other sites

@@CGhoST

 

Hi CG

The sort order works only for modules within the same group/folder.
For example;

The Modular Front Page uses this code to place the content on the index page (home page / start page)

<?php
    echo $oscTemplate->getContent('front_page');
?>

which means all modules that are inside the folder front_page can be sorted.
My Featured Products BS addon uses this code to show the content on the index page.

<?php
    echo $oscTemplate->getContent('index');
?>

as you can see that module is inside the "index" group and therefore inside the index folder. Which means it has its own sort order within that folder.

You have the following 3 options:

1.)

You install the Featured Products addon that was made to work within that Modular Front Page addon.
http://addons.oscommerce.com/info/9438

2.)

You place the following code

<?php
    echo $oscTemplate->getContent('index');
?>

after

<?php
    echo $oscTemplate->getContent('front_page');
?>

which means that the Featured Products BS contents will be always displayed "after" the Modular Front Page content. So you cannot have the Featured Products lets say between the Carousel and the New Products.

3.)

This is quick and dirty. You install first the Modules Front Page addon then install the Featured Products BS addon but skip Step 5.
Then instead of putting the files inside the new index folder put them inside the front_page folder. Make sure you do the same for the language files.
Now you are able to set a sort order for the Featured Products within the front page modules.


When you ask for help/support:

  • Always state your osCommerce version
  • If possible, list up installed add-ons
  • 3rd party templates are not supported in the forum

Latest osC: osCommerce CE (Community Edition aka. Edge)

 

Share this post


Link to post
Share on other sites

I took the dirty way .. Step 3 .. works nicely  :)

 

It wont have any negative effect right?

 

Could you help me with one more thing please .. How do i increase the number of columns to display 4 instead of 3?

 

On large screens 3 stretches out a lot..

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

×