Jump to content

[Resolved] Sitemap Sale Mode Logic


Dirty Butter

Recommended Posts

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.

Link to comment
Share on other sites

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'.

 

Link to comment
Share on other sites

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.

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
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...