Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

My idea for Blog in osCommerce


Recommended Posts

Hi guys!

My simple idea for a blog in osCommerce - you need to use only two conditions:
- Add one variable to table categories_description - categories_style_type
- Add one variable for the products table - products_blog_status

Then, in the files: new_products.php, product_listing.php, product_info.php:

  if ($categories_style_type == '1') {
   } elseif { 
   ($categories_style_type == '2')
   } else {}

So you can switch between different design for the product and for the blog.

 

 

Further, the modules in a database query, add:

end p.categories_style_type = '1'

So you can disable this blog in the product modules.

 

For comparison, look like a different page:

- Category product page http://titanium.oscommerce.ru/dlya-muzhchin/obuv
- Blog page category http://titanium.oscommerce.ru/blog/2016

- Product page http://titanium.oscommerce.ru/dlya-muzhchin/dzhinsy-kurtki/dzhinsy/3301-dzhinsy-slim
- Blog page http://titanium.oscommerce.ru/blog/2016/chem-nosit-palto

 

In this case, it is fully supported by related content.

Look, maybe you will like this idea.

No outside url's in signatures allowed - thanks

Link to comment
Share on other sites

Hello, Rolf!

 

I did it very simply.

 

The file includes/languages/english.php add line 28:

define('DATE_FORMAT_SHORT_DAY', '%d');
define('DATE_FORMAT_SHORT_MONTH', '%B'); 

At the end of the file \includes\functions\general.php add:

   // DAY
   function tep_date_short_day($raw_date) {
    if ( ($raw_date == '0000-00-00 00:00:00') || ($raw_date == '') ) return false;

    $year = (int)substr($raw_date, 0, 4);
    $month = (int)substr($raw_date, 5, 2);
    $day = (int)substr($raw_date, 8, 2);
    $hour = (int)substr($raw_date, 11, 2);
    $minute = (int)substr($raw_date, 14, 2);
    $second = (int)substr($raw_date, 17, 2);

    return strftime(DATE_FORMAT_SHORT_DAY, mktime($hour,$minute,$second,$month,$day,$year));
  }
   // MONTH
   function tep_date_short_month($raw_date) {
    if ( ($raw_date == '0000-00-00 00:00:00') || ($raw_date == '') ) return false;

    $year = (int)substr($raw_date, 0, 4);
    $month = (int)substr($raw_date, 5, 2);
    $day = (int)substr($raw_date, 8, 2);
    $hour = (int)substr($raw_date, 11, 2);
    $minute = (int)substr($raw_date, 14, 2);
    $second = (int)substr($raw_date, 17, 2);

    return strftime(DATE_FORMAT_SHORT_MONTH, mktime($hour,$minute,$second,$month,$day,$year));
  }

The file /includes/modules/product_listing.php use the date code:

$prod_list_contents .= '        <div class="entry-timeline">' . "\n";
$prod_list_contents .= '         ' . tep_date_short_day($listing['products_date_added']) . '<span>' . substr(tep_date_short_month($listing['products_date_added']), 0, 3) . '</span>' . "\n";
$prod_list_contents .= '         <div class="timeline-divider"></div>' . "\n";
$prod_list_contents .= '        </div>' . "\n";


 

 

No outside url's in signatures allowed - thanks

Link to comment
Share on other sites

Hello, Rolf!

 

I did it very simply.

 

The file includes/languages/english.php add line 28:

define('DATE_FORMAT_SHORT_DAY', '%d');
define('DATE_FORMAT_SHORT_MONTH', '%B'); 

At the end of the file \includes\functions\general.php add:

   // DAY
   function tep_date_short_day($raw_date) {
    if ( ($raw_date == '0000-00-00 00:00:00') || ($raw_date == '') ) return false;

    $year = (int)substr($raw_date, 0, 4);
    $month = (int)substr($raw_date, 5, 2);
    $day = (int)substr($raw_date, 8, 2);
    $hour = (int)substr($raw_date, 11, 2);
    $minute = (int)substr($raw_date, 14, 2);
    $second = (int)substr($raw_date, 17, 2);

    return strftime(DATE_FORMAT_SHORT_DAY, mktime($hour,$minute,$second,$month,$day,$year));
  }
   // MONTH
   function tep_date_short_month($raw_date) {
    if ( ($raw_date == '0000-00-00 00:00:00') || ($raw_date == '') ) return false;

    $year = (int)substr($raw_date, 0, 4);
    $month = (int)substr($raw_date, 5, 2);
    $day = (int)substr($raw_date, 8, 2);
    $hour = (int)substr($raw_date, 11, 2);
    $minute = (int)substr($raw_date, 14, 2);
    $second = (int)substr($raw_date, 17, 2);

    return strftime(DATE_FORMAT_SHORT_MONTH, mktime($hour,$minute,$second,$month,$day,$year));
  }

The file /includes/modules/product_listing.php use the date code:

$prod_list_contents .= '        <div class="entry-timeline">' . "\n";
$prod_list_contents .= '         ' . tep_date_short_day($listing['products_date_added']) . '<span>' . substr(tep_date_short_month($listing['products_date_added']), 0, 3) . '</span>' . "\n";
$prod_list_contents .= '         <div class="timeline-divider"></div>' . "\n";
$prod_list_contents .= '        </div>' . "\n";

is this going to be in a module?

it would be great to have blog

Link to comment
Share on other sites

  • 2 years later...

Is it really worth the effort to come up with a blog or forum, and integrate it with osC? You're going to find yourself spending an incredible amount of time adding new features to your blog so that it looks decent and has an acceptable set of features. I would think it would be a much better investment (in your time) to just install a full blog (e.g., Wordpress) or forum (e.g., SMF) on the site and use that. If it is critical that a single signon work for both, I think something has been done along those lines in the past. If not, there's always a CMS (Wordpress, Joomla, Drupal) with a shopping cart module -- single signon, ability to arbitrarily jump all over the place, and consistent styling (at the cost of not as good a cart).

Link to comment
Share on other sites

  • 2 weeks later...

For a real store, especially with an exclusive product, the information content module is very important. An important role is played by the Article Manager, but it has not been updated for a long time and is not very well connected with the content of goods. A blog is a convenient and good solution.

Support forum for osCommerce in russian language - from Ashkelon. Support since 2002.

Best regards,

Fredi

Link to comment
Share on other sites

It all depends on whether it's a one-way information flow (from seller to potential customer), or you need a two-way conversation. When someone says "blog", that sounds like they're asking for a conversational system. To meet expectations of functionality and ease of use, that's a whole application in and of itself. I would hesitate to try to build a whole new WordPress-like thing stuck on the side of osC. If such capability is needed, I would think it better to install something existing (like WP) and somehow tie it in to the store, such as through a shared ID/password. On the other hand, if all you need is to push information in one direction (store to customer), it might be worth the effort to come up with a mini-blog of some sort ("information content module").

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...