Jump to content



Latest News: (loading..)

* * * * * 1 votes

ADD-ON : Dynamic Template System for OsCommerce 2.3.x


  • Please log in to reply
53 replies to this topic

#1   foxp2

foxp2

    strong as a Twig

  • Banned
  • 310 posts
  • Real Name:Laurent
  • Gender:Male
  • Location:France

Posted 18 December 2010 - 12:05 AM

Hi all,

As discussed in this thread with Gyakutsuki, i've wrote a new addon.

This module allows you to manage the display of boxes page by page. (on any page, on all pages or selected pages in the administrative interface)

I hope you enjoy my work. :)

screenshot :

[img]http://img101.imageshack.us/img101/8031/screenshotadmininterfac.png[/img]


[img]http://img130.imageshack.us/img130/8031/screenshotadmininterfac.png[/img]



link : http://addons.oscommerce.com/info/7691
-------------------

#2   DunWeb

DunWeb

    The Censored One

  • Members
  • 12,822 posts
  • Real Name:Chris
  • Gender:Male
  • Location:Ontario, Canada

Posted 18 December 2010 - 01:34 AM

Very nice Laurent, good job.




Chris
:|: Was this post helpful ? Click the LIKE THIS button :|:

See my Profile to learn more about add ons, templates, support plans and custom coding (click here)

#3 ONLINE   Gyakutsuki

Gyakutsuki
  • Members
  • 164 posts
  • Real Name:Loic Richard
  • Gender:Male
  • Location:Montreal

Posted 18 December 2010 - 10:28 AM

Hello,

Regards

Edited by Gyakutsuki, 18 December 2010 - 10:38 AM.

-----------------------------------------
Regards

Loïc

#4 ONLINE   Gyakutsuki

Gyakutsuki
  • Members
  • 164 posts
  • Real Name:Loic Richard
  • Gender:Male
  • Location:Montreal

Posted 18 December 2010 - 10:45 AM

Hello,

You have forgotten to put inside the admin directory all the files else it seems work fine.

Congratulation

Regards

Edited by Gyakutsuki, 18 December 2010 - 10:47 AM.

-----------------------------------------
Regards

Loïc

#5   pdcelec

pdcelec
  • Members
  • 606 posts
  • Real Name:Paul Clifford
  • Gender:Male
  • Location:UK

Posted 18 December 2010 - 03:27 PM

Hi

I have installed it and it works great. However I am receiving these errors which all point to includes/classes/osc_template.php

Date / Time: 18-12-2010 15:21:22
Error Type: [E_NOTICE] Undefined property: categories_images::$pages
On line 69
File includes/classes/osc_template.php
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Date / Time: 18-12-2010 15:21:22
Error Type: [E_NOTICE] Undefined property: scroller::$pages
On line 69
File includes/classes/osc_template.php
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Date / Time: 18-12-2010 15:21:22
Error Type: [E_NOTICE] Undefined property: ht_google_analytics::$pages
On line 69
File includes/classes/osc_template.php
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Date / Time: 18-12-2010 15:21:22
Error Type: [E_NOTICE] Undefined property: ht_mailchimp_360::$pages
On line 69
File includes/classes/osc_template.php
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Date / Time: 18-12-2010 15:21:22
Error Type: [E_NOTICE] Undefined property: ht_opensearch::$pages
On line 69
File includes/classes/osc_template.php
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Edited by pdcelec, 18 December 2010 - 03:27 PM.


#6   foxp2

foxp2

    strong as a Twig

  • Banned
  • 310 posts
  • Real Name:Laurent
  • Gender:Male
  • Location:France

Posted 18 December 2010 - 04:52 PM

thanks for the report :
bug fixes :
in each class of catalog/includes/modules/header_tags ->

ht_category_title :
add parameter :
var pages;
and define it in constructor :
$this->pages = FILENAME_DEFAULT;

ht_google_analytics :
add parameter :
var pages;
and define it in constructor :
$this->pages = 'all';

ht_mailchimp_360 :
add parameter :
var pages;
and define it in constructor :
$this->pages = FILENAME_CHECKOUT_SUCCESS;

ht_manufacturer_title :
add parameter :
var pages;
and define it in constructor :
$this->pages = FILENAME_DEFAULT;

ht_opensearch :
add parameter :
var pages;
and define it in constructor :
$this->pages = 'all';

ht_product_title :
add parameter :
var pages;
and define it in constructor :
$this->pages = FILENAME_PRODUCT_INFO;

-------------------

#7   pdcelec

pdcelec
  • Members
  • 606 posts
  • Real Name:Paul Clifford
  • Gender:Male
  • Location:UK

Posted 18 December 2010 - 08:00 PM

Thanks

Works a charm. It is also fairly easy to adapt the modular front page contribution using the same methods and the other modular contributions

#8   DiablOCorsa

DiablOCorsa
  • Members
  • 11 posts
  • Real Name:Pásztóy Tamás

Posted 19 December 2010 - 08:55 AM

There is a mistake in the English version. It makes public uploads being not allowed.

In EN\catalog\includes\modules\boxes\bm_whats_new.php the 77th row is wrong.
It should be this:
            return array('MODULE_BOXES_WHATS_NEW_STATUS', 'MODULE_BOXES_WHATS_NEW_CONTENT_PLACEMENT', 'MODULE_BOXES_WHATS_NEW_SORT_ORDER', 'MODULE_BOXES_WHATS_NEW_DISPLAY_PAGES');

This row is correct in the French version.

ATTENTION!
This contribution blocks http://addons.oscommerce.com/info/7626/v,23  Modular Front Page

#9   pdcelec

pdcelec
  • Members
  • 606 posts
  • Real Name:Paul Clifford
  • Gender:Male
  • Location:UK

Posted 19 December 2010 - 12:28 PM

View PostDiablOCorsa, on 19 December 2010 - 08:55 AM, said:



ATTENTION!
This contribution blocks http://addons.oscommerce.com/info/7626/v,23  Modular Front Page

I have both installed and everything works fine. There is some alteration needed in the modular front page modules but they are simple changes
Add
var $pages;
below
    var $enabled = false;

And
Add
$this->pages = FILENAME_DEFAULT;
below

       $this->enabled = ( MODULE_FRONT_PAGE_BANNER_ROTATOR_STATUS == 'True' ); (Where BANNER_ROTATOR is the name of the module) Do this in all of the modules and everything operates fine

#10   foxp2

foxp2

    strong as a Twig

  • Banned
  • 310 posts
  • Real Name:Laurent
  • Gender:Male
  • Location:France

Posted 19 December 2010 - 05:03 PM

i've posted a new package.
it's compatible with all oscommerce's modules 2.3.x.
i've added some lines in javascript code (for a binding [mode two-way] with input selectors) as illustrated below :
[img]http://img708.imageshack.us/img708/8813/bindingfalse.png[/img]

[img]http://img833.imageshack.us/img833/4238/bindingtrue.png[/img]

[img]http://img262.imageshack.us/img262/6172/bindingtruepages.png[/img]


so :
Error Type: [E_NOTICE] Undefined property: xxxxxx::$pages -> fixed
This contribution blocks Modular Front Page -> fixed
You have forgotten to put inside the admin directory all the files -> fixed

thanks to all for bug reports and suggestions
-------------------

#11   DiablOCorsa

DiablOCorsa
  • Members
  • 11 posts
  • Real Name:Pásztóy Tamás

Posted 19 December 2010 - 06:28 PM

pdceles' solution is wrong, because you can't ban modules with it.

Yours is perfect now.

osc_template.php file need to be changed only in the first version, reinstalling is not needed.

Thank you!

#12   foxp2

foxp2

    strong as a Twig

  • Banned
  • 310 posts
  • Real Name:Laurent
  • Gender:Male
  • Location:France

Posted 19 December 2010 - 08:08 PM

View PostDiablOCorsa, on 19 December 2010 - 06:28 PM, said:

osc_template.php file need to be changed only in the first version, reinstalling is not needed.
'tep_cfg_select_pages' function in file  'catalog/admin/includes/functions'  must also be changed .(this parameter [$mb->pages !== 'null'] is no longer used)
-------------------

#13   pdcelec

pdcelec
  • Members
  • 606 posts
  • Real Name:Paul Clifford
  • Gender:Male
  • Location:UK

Posted 19 December 2010 - 11:13 PM

View PostDiablOCorsa, on 19 December 2010 - 06:28 PM, said:

pdceles' solution is wrong, because you can't ban modules with it.

Yours is perfect now.

osc_template.php file need to be changed only in the first version, reinstalling is not needed.

Thank you!
Thanks for the positive posting, but I never said that modules could be banned with it. And the name is pdcelec NOT
pdceles (copy and paste is an easy thing to do, if you cannot do it then dont).

Edited by pdcelec, 19 December 2010 - 11:14 PM.


#14   mongoled

mongoled
  • Members
  • 61 posts
  • Real Name:Andrew

Posted 22 December 2010 - 08:53 AM

View Postpdcelec, on 18 December 2010 - 08:00 PM, said:

Thanks

Works a charm. It is also fairly easy to adapt the modular front page contribution using the same methods and the other modular contributions
Hello, would you care to comment how one would go about achieving this. Could you also comment on how this word work functionally.

i.e. would we be able to control the modular from page features, on any given page we require?

Thanks

Andrew

#15   foxp2

foxp2

    strong as a Twig

  • Banned
  • 310 posts
  • Real Name:Laurent
  • Gender:Male
  • Location:France

Posted 22 December 2010 - 04:48 PM

it's very easy to extend the control of `Dynamic Template System` with all modules :
e.g, you would like to take the control of ht_google_analytics's module :
catalog/includes/modules/header_tags/ht_google_analytics.php,
you add this parameter :
var pages;
in constructor :
$this->pages = MODULE_HEADER_TAGS_GOOGLE_ANALYTICS_DISPLAY_PAGES;
in install method :
  	tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Display in pages.', 'MODULE_HEADER_TAGS_GOOGLE_ANALYTICS_DISPLAY_PAGES', 'all', 'select pages where this module should be displayed ', '6', '0','tep_cfg_select_pages(' , now())"); 
and add the key in keys method :
MODULE_HEADER_TAGS_GOOGLE_ANALYTICS_DISPLAY_PAGES

ht_google_analytics before changes :

[img]http://img691.imageshack.us/img691/2812/beforew.png[/img]

ht_google_analytics after changes :

[img]http://img51.imageshack.us/img51/8940/afterb.png[/img]

easier, you die ...
-------------------

#16   hose30

hose30
  • Members
  • 31 posts
  • Real Name:Joey

Posted 30 December 2010 - 01:52 PM

Hi,

I have installed this. but it is not working correctly.

On my index page I have only selected the search info box to be displayed in the right hand column - which it does.

However it will display anything else on the page (I have the modular front page installed too) and can be seen here:
http://www.ascafo.com/shop/

The source is viewable from the browser if there is an issue here.

Thanks for your help.

Joe

#17   burt

burt

    Code Monkey

  • Community Team
  • 7,871 posts
  • Real Name:G Burton
  • Gender:Male
  • Location:UK/DEV/on

Posted 17 January 2011 - 01:28 PM

A very nice and valuable modification to osCommerce.  Thank you Laurent.
Dummies guide to designing osCommerce 2.3 Click Me

Or maybe a ready made theme for your shop ??

Warning: My posts may contain Horsemeat.

#18 ONLINE   Gyakutsuki

Gyakutsuki
  • Members
  • 164 posts
  • Real Name:Loic Richard
  • Gender:Male
  • Location:Montreal

Posted 17 January 2011 - 01:42 PM

Must be integrated in osc 2.3.2 :)
-----------------------------------------
Regards

Loïc

#19   burt

burt

    Code Monkey

  • Community Team
  • 7,871 posts
  • Real Name:G Burton
  • Gender:Male
  • Location:UK/DEV/on

Posted 17 January 2011 - 01:49 PM

Just a quick change to make it easier to select all pages but then remove one or tow (eg have a box on all pages except index) - haven't tested fully, but might give you an idea;

admin/includes/functions/general.php

Add:
$string .= '<input type="checkbox" class="check_all" name="check_all" />' . CHECK_ALL . '<br /><br />';

After:
$string .= '<br /><strong>&nbsp;&nbsp;' . ONE_BY_ONE . '</strong><br /><br />';

Add:
$('.check_all').click(function () {
  $(this).parents('fieldset:eq(0)').find(':checkbox').attr('checked', this.checked);
  $('.AnyPages').attr('checked', false);
  $('.AllPages').attr('checked', false);
});

After:
jQuery(document).ready(function () {

admin/includes/languages/english.php

Add:
define('CHECK_ALL', 'Quick (Un)Tick');

No doubt you can refine this if you see fit.

Edited by burt, 17 January 2011 - 01:49 PM.

Dummies guide to designing osCommerce 2.3 Click Me

Or maybe a ready made theme for your shop ??

Warning: My posts may contain Horsemeat.

#20   burt

burt

    Code Monkey

  • Community Team
  • 7,871 posts
  • Real Name:G Burton
  • Gender:Male
  • Location:UK/DEV/on

Posted 18 January 2011 - 03:05 PM

Laurent - would it be possible to split the index page into 3, based on "category_depth".  It might be that the shop wants no columns in index.php, but columns when viewing product listings or manufacturers...
Dummies guide to designing osCommerce 2.3 Click Me

Or maybe a ready made theme for your shop ??

Warning: My posts may contain Horsemeat.