Dirty Butter Posted January 31, 2016 Share Posted January 31, 2016 Our estates store is currently set to have the whole store on a percentage off sale. In my way of thinking it then makes no sense for there to be a sales items link in the sitemap. Obviously it makes no sense to have a sales item link if nothing is on sale in the store. The only time it makes sense to me is the situation where some, but not all, items are on sale. The same goes for the Category Menu. Looking at seo.class.php, I changed the !=='0' part to =='1' if ($GLOBALS['config']->get('config', 'catalogue_sale_mode')=='1') { $this->_sitemap_link(array('url' => $store_url.'/index.php?_a=saleitems')); } It seems to be working as I had expected. What seems logical to me may not seem logical to someone else, however. I would be interested in comments on this edit and my reasoning. Quote Link to comment Share on other sites More sharing options...
bsmither Posted January 31, 2016 Share Posted January 31, 2016 While the probability is near zero, it is still not impossible that another sale mode could be developed -- in whatever form(s) that might be. Thus, the 'status' of the store's sale modes may end up being 0, 1, 2, and more. So, we know that "Nothing on sale" and "Everything on sale" are definitely off the table, therefore maybe mode !=='0' && mode !=='2'. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted February 1, 2016 Author Share Posted February 1, 2016 I used the same logic to code whether or not Sale Items shows on the Category Menu, and it's then one less thing to have to remember to adjust manually. I see your logic, but when I tried to implement it I couldn't figure out how the expression as a whole needed to be written. I tried this for line 732: if ($GLOBALS['config']->get('config', 'catalogue_sale_mode') !=='0' && get ('config', 'catalogue_sale_mode') !=='2') { This appeared to work correctly for showing Sales Items in the Category Menu appropriately, but trying to create a sitemap gave a blank page with this in the error log: Quote [31-Jan-2016 18:15:22 America/Chicago] PHP Fatal error: Call to undefined function get() in /home/butter01/public_html/dirtybutterestates.com/classes/seo.class.php on line 732 I tried leaving out the second get and got this debug message: Quote [Warning] /home/butter01/public_html/dirtybutterestates.com/classes/sanitize.class.php:112 - Invalid Security Token[Notice] /home/butter01/public_html/dirtybutterestates.com/includes/functions.inc.php:202 - Undefined variable: _GET[Notice] /home/butter01/public_html/dirtybutterestates.com/includes/functions.inc.php:202 - Undefined variable: _GET[Notice] /home/butter01/public_html/dirtybutterestates.com/includes/functions.inc.php:202 - Undefined variable: _GET I think I created a sitemap to test my =='1' version, but I'm not positive. I'll recheck that and return. Yes, I DID check the sitemap creation using my original =='1' version, and it works properly. Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 1, 2016 Share Posted February 1, 2016 Split across multiple lines for clarity: if( $GLOBALS['config']->get('config', 'catalogue_sale_mode') !== '0' && $GLOBALS['config']->get('config', 'catalogue_sale_mode') !== '2' ) { Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted February 1, 2016 Author Share Posted February 1, 2016 Thank you! That works just fine, both for Category Menu AND for Sitemap in estates with all on sale and plush with per-item sales in effect. Is this worth suggesting as an enhancement on GitHub? Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 1, 2016 Share Posted February 1, 2016 You can certainly post on the Github and make your case for this adjustment to the code logic. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted February 1, 2016 Author Share Posted February 1, 2016 GitHub request https://github.com/cubecart/v6/issues/995 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.