Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Addon} Modular Front Page


kymation

Recommended Posts

There should be a similar line in catalog/includes/modules/header_tags/ht_front_title_store_name.php. Find that and make the same replacement.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

There should be a similar line in catalog/includes/modules/header_tags/ht_front_title_store_name.php. Find that and make the same replacement.

 

Regards

Jim

 

Jim, I tried already, because of your posts - same error.

 

Its strange, because its only this file.

I think, maybe it has nothing to to with language.

I will search and let you know.

 

Regards

Nico

Link to comment
Share on other sites

Carine,

 

I think, there is a typo on:

 

var $code = 'flex_slider';

 

because of my error: Fatal error: Class 'fp_flex_slider' not found in C:\xampp\htdocs\catalog\includes\classes\osc_template.php on line 90

 

I changed it to: var $code = 'fp_flex_slider';

 

Now it is working, thanks for sharing.

 

Regards

Nico

Link to comment
Share on other sites

I'm fairly certain that it has nothing to do with the language class. Unfortunately I can't duplicate the error, so I can only guess at fixes. Please let me know if you find what the error really is.

 

That last one is my fault: I changed flex_slider to fp_flex_slider to match the official osCommerce module names.

 

Regards

Jim

Edited by kymation

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Jim,

 

I'm fairly certain that it has nothing to do with the language class. Unfortunately I can't duplicate the error, so I can only guess at fixes. Please let me know if you find what the error really is.

 

Regards

Jim

 

If I take off in catalog/includes/modules/header_tags/ht_front_title_store_name.php this part:

 

include_once( DIR_WS_CLASSES . 'language.php' );

$languages = new language();

 

$this->languages_array = array();

foreach( $languages->catalog_languages as $catalog_language ) {

$this->languages_array[$catalog_language['id']] = $catalog_language['name'];

}

 

everything is working.

 

The question is, is this section really necessary ?

Because it could get in conflict with other addons also?

 

How I can see, there are only two files in header_tags - folder with this language section.

catalog/includes/modules/header_tags/ht_front_title_store_name.php and

ht_other_pages_title_string.php, which causes the same error.

 

I am not sure, but I remember this kind of error also from someone, who included the generic box.

If time, I will have a look at this again.

 

Thanks for your time

Regards

Nico

Edited by Nico01
Link to comment
Share on other sites

That code is necessary if you have more than one language in your store. The generic box, and all other modules that need to be multi-language, have similar code.

 

Others have reported the same problem, but I have never been able to duplicate it. It's likely not what the error message says, and that makes it harder to guess at a solution. I would appreciate any information you can find that would help to solve this mystery.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Jim, I understand.

 

Behind my question I thought this:

 

We have in catalog/includes/modules/header_tags/ht_front_title_store_name.php this part:

 

include_once( DIR_WS_CLASSES . 'language.php' );

$languages = new language();

 

$this->languages_array = array();

foreach( $languages->catalog_languages as $catalog_language ) {

$this->languages_array[$catalog_language['id']] = $catalog_language['name'];

}

 

But also in osc_template:

 

function buildBlocks() {

global $language, $PHP_SELF;

 

if ( defined('TEMPLATE_BLOCK_GROUPS') && tep_not_null(TEMPLATE_BLOCK_GROUPS) ) {

$tbgroups_array = explode(';', TEMPLATE_BLOCK_GROUPS);

 

foreach ($tbgroups_array as $group) {

$module_key = 'MODULE_' . strtoupper($group) . '_INSTALLED';

 

if ( defined($module_key) && tep_not_null(constant($module_key)) ) {

$modules_array = explode(';', constant($module_key));

 

foreach ( $modules_array as $module ) {

$class = substr($module, 0, strrpos($module, '.'));

 

if ( !class_exists($class) ) {

include(DIR_WS_LANGUAGES . $language . '/modules/' . $group . '/' . $module);

include(DIR_WS_MODULES . $group . '/' . $class . '.php');

}

 

$mb = new $class();

 

// bof Dynamic Template System

if(!isset($mb->pages) && ($mb->isEnabled())){

$this->pages = 'all';

$mb->execute();

}else{

if(($mb->isEnabled()) && (($mb->pages === 'all') || (in_array($PHP_SELF , explode(';' , $mb->pages))))){

$mb->execute();

}

}

// eof Dynamic Template System

}

 

I thought, maybe the file got it in a double way.

 

Forgive me, if I talking something completely wrong, but this my way to learn ...., thanks.

 

Regards

Nico

Link to comment
Share on other sites

The oscTemplate is just including the $language variable as a global. While globals can cause problems, there is nothing wrong with what is happening there. That should not be causing this problem.

 

You can instantiate a class as many times as you like. For instance, I could do this:

 

include_once( DIR_WS_CLASSES . 'language.php' );
$languages = new language();
$my_languages = new language();
$your_languages = new language();

 

I now have three instances of the language class, assigned to $languages, $my_languages, and $your_languages.

 

I can also reuse the same name for the class instance, so long as I use them in separate functions or classes and don't make the name global. For example:

 

include_once( DIR_WS_CLASSES . 'language.php' );
$languages = new language();

class foo {
 function bar() {
   $languages = new language();
 }
}

 

The second instance is inside a class, so it's completely separate and does not conflict with the one above.

 

You can even include the file more than once, so long as you use include_once or require_once. So this is perfectly acceptable:

 

include_once foo.php;
$foo = new foo;

include_once foo.php;
$bar = new foo;

 

Various people have tested this and found that none of the above are causing this error. That makes me think that it's not really a problem with the class include, but is really some other error that is sending a false error message. That was a big problem with early versions of PHP. You would even get the notorious "Unknown error on line 0", which at least had the advantage of not giving you an incorrect error message to confuse things.

 

I would really like to know what is causing this. Please let me know if you find any more possible explanations.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Having some problems with the modules in /includes/modules/frontpage

The only one working was fp_new_products.php

 

The fp_specials.php did not work, some sql error. Strange.

 

Comparing these fp_new_products.php and fp_specials.php

 

I changed this in fp_specials.php

 

     if ($PHP_SELF == 'index.php' && $cPath == '') {
       $specials_products_query_raw = "
               select
                 p.products_id,
                 pd.products_name,
                 p.products_price,
                 p.products_tax_class_id,
                 p.products_image,
                 s.specials_new_products_price
               from
                 " . TABLE_PRODUCTS . " p
                 join " . TABLE_PRODUCTS_DESCRIPTION . " pd
                   on pd.products_id = p.products_id
                 join " . TABLE_SPECIALS . " s
                   on s.products_id = p.products_id
               where
                 p.products_status = '1'
                 and pd.language_id = '" . ( int ) $languages_id . "'
                 and s.status = '1'
               order by
                 RAND()
               limit
                 " . MODULE_FRONT_PAGE_SPECIALS_MAX_DISPLAY . "
             ";
       // print 'Specials Query: ' . $specials_products_query_raw . '<br />';
       $specials_products_query = tep_db_query( $specials_products_query_raw );

 

into this: (which is similar to the fp_new_products.php)

 

     if ($PHP_SELF == 'index.php' && $cPath == '') {

       // print 'Specials Query: ' . $specials_products_query_raw . '<br />';
       $specials_products_query = tep_db_query( "select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p join " . TABLE_PRODUCTS_DESCRIPTION . " pd on pd.products_id = p.products_id join " . TABLE_SPECIALS . " s on s.products_id = p.products_id where p.products_status = '1' and pd.language_id = '" . ( int ) $languages_id . "' and s.status = '1' order by RAND() limit " . MODULE_FRONT_PAGE_SPECIALS_MAX_DISPLAY );

 

This worked for me. Now, on the other hand, is this a good solution? Or will it give other (hidden) problems after.

 

I have osc2.3.3 and frontpage 1.4 (php 5.3.10)

Edited by boltje
Link to comment
Share on other sites

I had to clean that mess up in order to compare it. The result: absolutely no difference. The SQL is identical (except for the crappy formatting.) Both will give the same result.

 

These modules have all been extensively tested and are working on hundreds of stores. You should not need to fix anything. If you're having problems, please post the exact error message you're getting and I'll try to help. For SQL errors, also give the version of MySQL that you are running.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Sorry Jim, had to write it a bit more clear with the difference in my pages. As you say, there is no difference in de sql statement.

However, i just replaced my file with the original file for example the fp_scroller.php and imidiatly the error is back.

 

(if only fp_new_products is active I don't have the sql error and the results of new product items are on my page.)

 

mysql version 5.5.31

 

This is the result for the fp_scroller.php:

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where p.products_id not in(45, 82)' at line 18

 

select p.products_id, p.products_image, pd.products_name from products p join products_description pd on pd.products_id = p.products_id where p.products_status = '1' and pd.language_id = '4' order by rand() limit 20 where p.products_id not in(45, 82)

 

[TEP STOP]

Link to comment
Share on other sites

The problem is in this SQL: where p.products_id not in(45, 82)

 

That is not a part of this module. You have another addon that is adding that code, possibly some sort of hidden category addon. It's probably a modification to the includes/database.php functions. That is conflicting with the Front Page modules.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

The problem is in this SQL: where p.products_id not in(45, 82)

 

That is not a part of this module. You have another addon that is adding that code, possibly some sort of hidden category addon. It's probably a modification to the includes/database.php functions. That is conflicting with the Front Page modules.

 

Regards

Jim

 

Thanx Jim, Yes I have the SHP module, it has a modification in database.php.

Getting late, try to find things out tomorow.

Link to comment
Share on other sites

I took a look at that addon's code, and I think I see the problem. When you wake up, try this: Find this line in catalog/includes/functions/database:

 

else if(stristr($query, " where "))

 

and replace it with:

 

else if(stristr($query, " where"))

 

Yes, there's just one space difference. At least I think that will work. Please let me know if it does.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

I took a look at that addon's code, and I think I see the problem. When you wake up, try this: Find this line in catalog/includes/functions/database:

 

else if(stristr($query, " where "))

 

and replace it with:

 

else if(stristr($query, " where"))

 

Yes, there's just one space difference. At least I think that will work. Please let me know if it does.

 

Regards

Jim

 

Sometimes life is simple :-) tnx Jim

 

Changed the /includes/functions/database.php for the SHP module (one space less)

Regards

Martin

Link to comment
Share on other sites

Hello,

 

Great work, super useful. I've been playing around with a new oscommerce 2.3.x catalog and have Modular Front Page installed and in use successfully. I had no significant issues initially (that I remember), but after installing another mod (Social Login and Social Share Modules) most current loginradius release and that's where the trouble began (only with the Heading Title portion)... At least I think so, I have looked at your code for a bit, but overall an pretty new to OScommerce CMS structuring so could use a little time saving help if you have any idea what is going on here.

So... I believe before the S.L. mod install my initial load of the store index show "Welcome To XXX Online..." as the Page Heading Title which was correct; the behavior now after the Social Login install is that the Heading Title shows "My Account Information" (at least after login, I have not dug too much yet, but will have some more time to diagnose tomorrow). It could be the case that before I log in (traditionally or social login style) the page headings are correct, but I don't believe so and can't remember the exact behavior from this morning before I got pulled away from working on this issue.

 

live URL... msdrivetrain.com/store

 

Any advice is appreciated and If i missed something obvious in the forum I apologize, I did look.

 

Thanks in advance,

Justin

Link to comment
Share on other sites

The Heading Title is defined in store/includes/languages/english/index.php. It sounds like that file was altered or replaced with the one for the account info page. Anyway, just fix the define for HEADING_TITLE and you should be good.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Hello Jim,

 

Just got back on this, thanks for the advice. I looked and it seems the define there is good..

 

from store/includes/languages/english/index.php

...

define('TABLE_HEADING_DATE_EXPECTED', 'Date Expected');

define('HEADING_TITLE', 'Welcome to ' . STORE_NAME);

define('TABLE_HEADING_IMAGE', '');

...

 

I keep getting pulled away from this project, but now have time to run a quick text search to see if there is a redefinition of the HEADING_TITILE somewhere, it is not redefined anywhere in the english/index file, but you are correct it is happening somewhere and seems to be a static occurrence... The only other thing I'm assuming is that it must happen after your code makes the change and is overwritten with the static entry??? currently idk just guessing.

Link to comment
Share on other sites

OK... I can tentatively state that I think the issue is resolved. Being relatively unfamiliar with the framework overall I have a feeling that my fix may result in non-standard code (I'm sure there was a better way to fix this, If you can speak to a better resolution I would love to hear).

 

I scanned for any and all occurrences of define('HEADING_TITLE and found typical results, but when I came across the socialloginandsocialshare.php occurrence of this it made me curious so I commented this define out and it appears to have correct the issue all together... As stated my concern now is the possibility of non-standard code. It is a mystery to me why that define would overwrite your more dynamic definitions in EVERY occurrence. My limited understanding of the framework is hurting me bad in this regard, but I am picking up on the oscommerce modular structures slowly but surely. I'm not sure what caused the problem initially, but I am thinking an include is probably out of order causing your Page Heading Title in Modular front-page to miss the references for the new login pages and such result in being overwritten and losing the ability to rebind new HEADING_TITLE values via your framework.

 

anyways thanks for setting me on the right track, gotta move to next issue but if I revisit this and find a better solution I'll repost.

 

Thanks for all your great work you've shared.

Justin

Link to comment
Share on other sites

Jim, I installed you brandnew "accordion_categories_menu_1.2.3".

 

Believe it or not - its working now perfect!

 

What did you change in the module ?

 

Thanks for your support.

 

Best regards

Nico

Link to comment
Share on other sites

@@406_JEM

PHP only allows you to define a constant once. A second define of the same constant is ignored and a warning is thrown. You won't see the warning message if you have error reporting turned off. My guess is that the social login addon is defining HEADING_TITLE (improperly) and overriding the proper definition. Removing that define is the correct action.

 

@@Nico01

I juggled the div tags to make the output more consistent. It was producing an incorrect output in some configurations. The result was ... odd. This release should now work with all versions of jQuery UI. I hope.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

I have installed Modular Front Page 1.4 and when I go to install modules i see the button showing 11 modules to install for front page. When I click the install button I see no modules, just the back button at top. I also just installed banner box 121. Any ideas why this is happening. I re-checked installation to make sure files were in correct locations. I am running 2.3.3

 

Fixed the problems, files not loaded properly. Now modules are showing in Admin for front page

Edited by PhilPoxon
Link to comment
Share on other sites

Hi, I installed the Modular front page and when I go into one of my categories a see a series of "Warning: Division by zero in /home/ebatuk5/public_html/index.php on line 73"

 

Warning: Division by zero in /home/ebatuk5/public_html/index.php on line 75

 

how do I fix this?

Link to comment
Share on other sites

This indicates that the maximum number of categories per row is not set in your Admin. Are you running an older version of osCommerce? If so, updating it to version 2.3.3 will fix this problem.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...