Christopher Short Posted May 1, 2018 Share Posted May 1, 2018 In the templates/content.product.php file, at line 216 you see: {if isset($PRODUCT.discounts)} <p>(<a href="#quantity_discounts">{$LANG.catalogue.bulk_discount}</a>)</p> {/if} {if ($CTRL_ALLOW_PURCHASE) && (!$CATALOGUE_MODE)} <div class="row collapse"> {if $PRODUCT.available <= 0} <div class="small-12 columns"> <input type="submit" value="{$LANG.common.unavailable}" class="button small disabled expand marg-top" disabled> </div> {else} I have custom code here... Then there is: <div class="medium-2 columns show-for-medium-up"> <input type="text" name="quantity" value="1" class="quantity required text-center"> <input type="hidden" name="add" value="{$PRODUCT.product_id}"> <input type="hidden" name="leadtime_overlay" value="1"> </div> <div class="small-12 medium-10 columns"> <button type="submit" value="{$LANG.catalogue.add_to_basket}" class="button postfix">{$LANG.catalogue.add_to_basket}</button> </div> {/if} </div> Can you help me figure out where to put my custom code in 6.2.0? Quote Link to comment Share on other sites More sharing options...
bsmither Posted May 1, 2018 Share Posted May 1, 2018 (edited) In the Foundation skin that ships with CC620... Please look in element.product.call_to_action.php, near line 34. Edited May 1, 2018 by bsmither Quote Link to comment Share on other sites More sharing options...
Christopher Short Posted May 1, 2018 Author Share Posted May 1, 2018 42 minutes ago, bsmither said: In the Foundation skin that ships with CC620... Please look in element.product.call_to_action.php, near line 34. Thanks Quote Link to comment Share on other sites More sharing options...
Christopher Short Posted May 1, 2018 Author Share Posted May 1, 2018 So after the upgrade, I have a blank homepage. Where should I be looking to start the debug on that? I have loaded my old skin in the mean time. Quote Link to comment Share on other sites More sharing options...
bsmither Posted May 1, 2018 Share Posted May 1, 2018 I believe the core CC620 code is fine. I, too, have a blank screen because of a problem with the Foundation skin that ships with CC620. As far as the Foundation skin is concerned, other than a few tweaks here and there, the significant difference is minification. There are two parts. Part1: Collecting all the CSS files and concatenating them into one big file, writing that file to the /cache/ folder, then putting HTML in the template that makes that cached file the page's CSS resource link. Collecting all the JS files, and doing the same. Part2: Having Smarty send its rendered output through a new Smarty output filter. This filter wrings all the whitespace out of the HTML, resulting in (mostly) one single line of HTML code. I have eliminated Part2 causing my problem. I have bypassed the code changes made in Part1. Now, I get the page, but the Foundation javascript fails to start. What is mostly different about my server environment is I run Windows with PHP 5.4.44. But I have not yet proven this is the incompatible factor. Oddly, I have another Windows server running PHP 7.1, but it has a fresh CC620Beta1 installed. It works fine. Quote Link to comment Share on other sites More sharing options...
Christopher Short Posted May 1, 2018 Author Share Posted May 1, 2018 30 minutes ago, bsmither said: I believe the core CC620 code is fine. I, too, have a blank screen because of a problem with the Foundation skin that ships with CC620. As far as the Foundation skin is concerned, other than a few tweaks here and there, the significant difference is minification. There are two parts. Part1: Collecting all the CSS files and concatenating them into one big file, writing that file to the /cache/ folder, then putting HTML in the template that makes that cached file the page's CSS resource link. Collecting all the JS files, and doing the same. Part2: Having Smarty send its rendered output through a new Smarty output filter. This filter wrings all the whitespace out of the HTML, resulting in (mostly) one single line of HTML code. I have eliminated Part2 causing my problem. I have bypassed the code changes made in Part1. Now, I get the page, but the Foundation javascript fails to start. What is mostly different about my server environment is I run Windows with PHP 5.4.44. But I have not yet proven this is the incompatible factor. Oddly, I have another Windows server running PHP 7.1, but it has a fresh CC620Beta1 installed. It works fine. So I should have waited longer then I just spent a couple hours comparing code to make sure I moved my custom stuff over. Quote Link to comment Share on other sites More sharing options...
bsmither Posted May 1, 2018 Share Posted May 1, 2018 I made a mistake regarding the Foundation javascript. That got fixed. Whew! What is the version of PHP on your server, and is it a Windows server? Quote Link to comment Share on other sites More sharing options...
Christopher Short Posted May 1, 2018 Author Share Posted May 1, 2018 13 minutes ago, bsmither said: I made a mistake regarding the Foundation javascript. That got fixed. Whew! What is the version of PHP on your server, and is it a Windows server? php 5.6, not windows. I believe it is red hat linux Quote Link to comment Share on other sites More sharing options...
bsmither Posted May 1, 2018 Share Posted May 1, 2018 Do you have PHP's error_log file? Quote Link to comment Share on other sites More sharing options...
Christopher Short Posted May 1, 2018 Author Share Posted May 1, 2018 3 minutes ago, bsmither said: Do you have PHP's error_log file? not that I see. Not sure where to find them if I did. Quote Link to comment Share on other sites More sharing options...
bsmither Posted May 1, 2018 Share Posted May 1, 2018 Creating the error_log. Quote Link to comment Share on other sites More sharing options...
Christopher Short Posted May 1, 2018 Author Share Posted May 1, 2018 Invalid argument supplied for foreach() in ****/classes/catalogue.class.php on line 258: foreach ($products as $product) { Invalid argument supplied for foreach() in ****/modules/plugins/extended_leadtimes/hooks/class.catalogue.category_product_list_return.php on line 15: foreach($productList as $key => $val){ Quote Link to comment Share on other sites More sharing options...
bsmither Posted May 1, 2018 Share Posted May 1, 2018 Nothing interesting in that log. Let's see if some output gets sent out by bypassing one of the new things the CC620 skin is doing. In the CC620 Foundation template element.js_foot.php: Replace the entire contents with: <script src="{$STORE_URL}/skins/{$SKIN_FOLDER}/js/vendor/jquery.rating.min.js" type="text/javascript"></script> <script src="{$STORE_URL}/skins/{$SKIN_FOLDER}/js/vendor/jquery.validate.js" type="text/javascript"></script> <script src="{$STORE_URL}/skins/{$SKIN_FOLDER}/js/vendor/jquery.cookie.js" type="text/javascript"></script> <script src="{$STORE_URL}/skins/{$SKIN_FOLDER}/js/vendor/jquery.bxslider.js" type="text/javascript"></script> <script src="{$STORE_URL}/skins/{$SKIN_FOLDER}/js/vendor/jquery.chosen.js" type="text/javascript"></script> {foreach from=$BODY_JS item=js}{$js}{/foreach} {foreach from=$JS_SCRIPTS key=k item=script} <script src="{$STORE_URL}/{$script|replace:'\\':'/'}" type="text/javascript"></script> {/foreach} <script>{literal}$(document).foundation({equalizer:{equalize_on_stack:true}});$('.bxslider').bxSlider({auto:true,captions:true});$('.chzn-select').chosen({width:"100%",search_contains:true});{/literal}</script> {* {assign var=js_foot value=[ 'skins/{$SKIN_FOLDER}/js/vendor/jquery.rating.min.js', 'skins/{$SKIN_FOLDER}/js/vendor/jquery.validate.js', 'skins/{$SKIN_FOLDER}/js/vendor/jquery.cookie.js', 'skins/{$SKIN_FOLDER}/js/vendor/jquery.bxslider.js', 'skins/{$SKIN_FOLDER}/js/vendor/jquery.chosen.js']} {foreach from=$BODY_JS item=js} {$js_foot[] = $js} {/foreach} {foreach from=$JS_SCRIPTS key=k item=script} {$js_foot[] = $script} {/foreach} {combine input=$js_foot output='cache/js_foot.{$SKIN_FOLDER}.js' age='604800' debug=false} *} In element.css.php: Replace the entire contents with: <link href="//fonts.googleapis.com/css?family=Open+Sans:400,700" rel="stylesheet" type='text/css'> <link href="{$STORE_URL}/skins/{$SKIN_FOLDER}/css/normalize.css" rel="stylesheet"> <link href="{$STORE_URL}/skins/{$SKIN_FOLDER}/css/foundation.css" rel="stylesheet"> <link href="{$STORE_URL}/skins/{$SKIN_FOLDER}/css/cubecart.css" rel="stylesheet"> <link href="{$STORE_URL}/skins/{$SKIN_FOLDER}/css/cubecart.common.css" rel="stylesheet"> <link href="{$STORE_URL}/skins/{$SKIN_FOLDER}/css/cubecart.helpers.css" rel="stylesheet"> {if !empty($SKIN_SUBSET)} <link href="{$STORE_URL}/skins/{$SKIN_FOLDER}/css/cubecart.{$SKIN_SUBSET}.css" rel="stylesheet"> {/if} <link href="{$STORE_URL}/skins/{$SKIN_FOLDER}/css/jquery.bxslider.css" rel="stylesheet"> <link href="{$STORE_URL}/skins/{$SKIN_FOLDER}/css/jquery.chosen.css" rel="stylesheet"> {foreach from=$CSS key=css_keys item=css_files} <link href="{$STORE_URL}/{$css_files}" rel="stylesheet" type="text/css" media="screen"> {/foreach} {* {assign var=css_input value=[ 'skins/{$SKIN_FOLDER}/css/normalize.css', 'skins/{$SKIN_FOLDER}/css/foundation.css', 'skins/{$SKIN_FOLDER}/css/cubecart.css', 'skins/{$SKIN_FOLDER}/css/cubecart.common.css', 'skins/{$SKIN_FOLDER}/css/cubecart.helpers.css', 'skins/{$SKIN_FOLDER}/css/jquery.bxslider.css', 'skins/{$SKIN_FOLDER}/css/jquery.chosen.css']} {foreach from=$CSS key=css_keys item=css_files} {$css_input[] = $css_files} {/foreach} {if !empty($SKIN_SUBSET)} {$css_input[] = 'skins/{$SKIN_FOLDER}/css/cubecart.{$SKIN_SUBSET}.css'} {/if} {combine input=$css_input output='cache/css.{$SKIN_FOLDER}.css' age='604800' debug=false} *} In element.js_head.php: Replace the entire contents with: <script src="{$STORE_URL}/skins/{$SKIN_FOLDER}/js/vendor/modernizr.js"></script> <script src="{$STORE_URL}/skins/{$SKIN_FOLDER}/js/vendor/jquery.js"></script> {foreach from=$HEAD_JS item=js}{$js}{/foreach} {* {assign var=js_head value=[ 'skins/{$SKIN_FOLDER}/js/vendor/modernizr.js', 'skins/{$SKIN_FOLDER}/js/vendor/jquery.js']} {foreach from=$HEAD_JS item=js} {$js_head[] = $js} {/foreach} {combine input=$js_head output='cache/js_head.{$SKIN_FOLDER}.js' age='604800' debug=false} *} In admin, clear the cache. 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.