PeteW1959 Posted November 7, 2013 Share Posted November 7, 2013 I sell tickets and trading space for a bi-annual music festival, and as all products change at the same time, twice a year, latest products isn't really relevant, so I turned it off in the admin panel. Howver the heading 'Latest Products' still shows on the home page and looks a bit lost with nothing underneath it! Is there a way to turn the heading off, or better still wouldn't it make more sense to turn the heading off when the setting is turned off? Quote Link to comment Share on other sites More sharing options...
PeteW1959 Posted November 7, 2013 Author Share Posted November 7, 2013 I have been searching through some files and have spotted what may be a bug. In skins/kurouto/templates/content.homepage.php is the following code segment {if isset($LATEST_PRODUCTS)} <div> <h2>{$LANG.catalogue.latest_products}</h2> If I comment out the H2 line, the heading is no longer shown. However surely the IF statement would mean that the line shouldn't be executed anyway as I have turned off latest products in the control panel. Quote Link to comment Share on other sites More sharing options...
bsmither Posted November 7, 2013 Share Posted November 7, 2013 I assume you haven't made any edits to the controller file that populates this template. In this template file, at the end, add {debug}, then save the template file. In admin, Maintenance, Rebuild, clear the cache. When you browse to the Homepage, there will be a popup window that lists a lot of variables and their values. Scroll to $LATEST_PRODUCTS and let us know what the value is for this. Quote Link to comment Share on other sites More sharing options...
PeteW1959 Posted November 7, 2013 Author Share Posted November 7, 2013 I don't have $LATEST_PRODUCTS in the Smarty Debug Console. The closest is:- catalogue_latest_products => "0"catalogue_latest_products_count => "8" in the Config section. Quote Link to comment Share on other sites More sharing options...
bsmither Posted November 7, 2013 Share Posted November 7, 2013 "I don't have $LATEST_PRODUCTS in the Smarty Debug Console." Would you please check again? It will be after the $LANG section (which comprises the bulk of the console). If $LATEST_PRODUCTS really is not there, then: {if isset($LATEST_PRODUCTS)} must be false and the everything within the {if} and its matching {/if} will not show. Quote Link to comment Share on other sites More sharing options...
PeteW1959 Posted November 7, 2013 Author Share Posted November 7, 2013 There is no $LANG section either, the bulk of the console is $CONFIG. I have only the following:- $CART_ITEMS $CART_TOTAL $CATALOGUE_MODE $CHARACTER_SET $CONFIG $COPYRIGHT $CURRENT_PAGE $DOCUMENT $GLOBALS (this is empty) The code in the if statement must be executing as commenting out the header stops it being displayed; remove the comment marks and the header is displayed again. I have edited some of the files in the Kurouto skin, so as a further test I tried a different skin (Mican) just to make sure that the changes I had made to Kurouto hadn't caused a problem and I get exactly the same results. I have not changed any files outside of the Kurouto skin folder. Quote Link to comment Share on other sites More sharing options...
bsmither Posted November 7, 2013 Share Posted November 7, 2013 This is my console: Smarty Debug Console - "file:templates/content.homepage.php" $CATALOGUE_MODE $CHARACTER_SET $CONFIG $COPYRIGHT $CURRENT_PAGE $DOCUMENT $IS_USER $JS_SCRIPTS $LANG $LATEST_PRODUCTS $ROOT_PATH $SCRIPT_NAME $SECTION_NAME $SESSION_TOKEN $SKIN_CUSTOM $SKIN_FOLDER $SKIN_SUBSET $STORE_LOGO $STORE_URL $TEXT_DIRECTION $VAL_SELF $product $smarty For $GLOBALS, do you at least have this: Smarty_Variable Object (#)->value = something->nocache = false->scope = "file:templates/content.homepage.php" Ok, so half of the variables are not displaying in your console. And one variable that should not be there is displaying. Have your browser show you the HTML source of the page. Somewhere in that source you will see this: <script type="text/javascript"> _smarty_console = window.open("","console64089c3789db.... _smarty_console.document.write("<!DOCTYPE html PUBLIC.... a really, really, really long line _smarty_console.document.close(); </script> You would need to copy that really long line into a text editor and have it wrap the line so you can see all of it. The find $GLOBALS. What is immediately after $GLOBALS? Because, there must be something that is causing the rest of it to not to show in the console. FYI: The variables listed in the console is what the CubeCart controller code (all the classes) is assigning to the skin -- regardless of there being a matching {$PLACEHOLDER} in the skin template to use it. Quote Link to comment Share on other sites More sharing options...
PeteW1959 Posted November 7, 2013 Author Share Posted November 7, 2013 OK, this is strange; the debug console is working properly now, and the only thing I have changed since running it last is the logo! Anyway, the whole debug is there now, but still no $LATEST_PRODUCTS section. After $LANG I have $ROOT_PATH, then the same as you except there is no $product. Quote Link to comment Share on other sites More sharing options...
bsmither Posted November 7, 2013 Share Posted November 7, 2013 Ok, no $LATEST_PRODUCT -- which means there would be no $product ($product is the current element from iterating through the array $LATEST_PRODUCT). Yet, the skin behaves as if $LATEST_PRODUCT was still "set". In admin, Maintenance, Rebuild tab, check Clear Cache and then submit. What do you see now? Do you still have $GLOBALS in the console? Quote Link to comment Share on other sites More sharing options...
PeteW1959 Posted November 7, 2013 Author Share Posted November 7, 2013 I have cleared the cache, refreshed the page and the latest products header has now gone. This is very strange behaviour, as I have cleared the cache every time I have made a change; it is something I do automatically as it is required in most web applications. I will carry on with the tweaks I need to do, and if the problem re-occurs I will try and make a note of exactly what I did immediately before. Thanks for your help. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.