Jump to content

404 Page Not Found


devilish

Recommended Posts

Hi, I'm getting a 404 - Page Not Found error when via this link https://wickedstuff.co.nz/test-category/test-category.html to create it 
go to Test Category then to Test2 then Electronics Air-Fi and finally go back Test Category in the main menu. here's my error log.

Your help will be much appreciated.

09 Nov 2017, 19:11 File: [seo.class.php] Line: [662] "UPDATE `CCCubeCart_seo_urls` SET `type` = 'doc',`item_id` = '2',`path` = 'test-category',`custom` = '1' WHERE CCCubeCart_seo_urls.id = '18';" - Duplicate entry 'test-category' for key 'PRIMARY'
09 Nov 2017, 19:10 File: [seo.class.php] Line: [662] "UPDATE `CCCubeCart_seo_urls` SET `type` = 'doc',`item_id` = '2',`path` = 'test-category',`custom` = '1' WHERE CCCubeCart_seo_urls.id = '18';" - Duplicate entry 'test-category' for key 'PRIMARY'
09 Nov 2017, 19:08 File: [seo.class.php] Line: [662] "UPDATE `CCCubeCart_seo_urls` SET `type` = 'doc',`item_id` = '2',`path` = 'test-category',`custom` = '1' WHERE CCCubeCart_seo_urls.id = '18';" - Duplicate entry 'test-category' for key 'PRIMARY'
09 Nov 2017, 19:06 File: [seo.class.php] Line: [662] "UPDATE `CCCubeCart_seo_urls` SET `type` = 'doc',`item_id` = '2',`path` = 'test-category',`custom` = '1' WHERE CCCubeCart_seo_urls.id = '10';" - Duplicate entry 'test-category' for key 'PRIMARY'
09 Nov 2017, 19:05 File: [seo.class.php] Line: [662] "UPDATE `CCCubeCart_seo_urls` SET `type` = 'doc',`item_id` = '2',`path` = 'test-category',`custom` = '1' WHERE CCCubeCart_seo_urls.id = '10';" - Duplicate entry 'test-category' for key 'PRIMARY'
09 Nov 2017, 19:01 File: [seo.class.php] Line: [662] "UPDATE `CCCubeCart_seo_urls` SET `type` = 'doc',`item_id` = '2',`path` = 'test-category',`custom` = '1' WHERE CCCubeCart_seo_urls.id = '10';" - Duplicate entry 'test-category' for key 'PRIMARY'
09 Nov 2017, 18:59 File: [seo.class.php] Line: [662] "UPDATE `CCCubeCart_seo_urls` SET `type` = 'doc',`item_id` = '2',`path` = 'test-category',`custom` = '1' WHERE CCCubeCart_seo_urls.id = '10';" - Duplicate entry 'test-category' for key 'PRIMARY'
09 Nov 2017, 08:01 File: [seo.class.php] Line: [666] "INSERT INTO `CCCubeCart_seo_urls` (`type`,`item_id`,`path`,`custom`) VALUES ('prod','1','test-category/test-product','0');" - Duplicate entry 'test-category/test-product' for key 'PRIMARY'
09 Nov 2017, 08:01 File: [seo.class.php] Line: [666] "INSERT INTO `CCCubeCart_seo_urls` (`type`,`item_id`,`path`,`custom`) VALUES ('saleitems','','sale-items','0');" - Duplicate entry 'sale-items' for key 'PRIMARY'
09 Nov 2017, 08:01 File: [seo.class.php] Line: [666] "INSERT INTO `CCCubeCart_seo_urls` (`type`,`item_id`,`path`,`custom`) VALUES ('prod','1','test-category/test-product','0');" - Duplicate entry 'test-category/test-product' for key 'PRIMARY'
09 Nov 2017, 08:01 File: [seo.class.php] Line: [666] "INSERT INTO `CCCubeCart_seo_urls` (`type`,`item_id`,`path`,`custom`) VALUES ('prod','1','test-category/test-product','0');" - Duplicate entry 'test-category/test-product' for key 'PRIMARY'
Link to comment
Share on other sites

This is what my browser sees:

<div id="box-documents">
   <nav>
      <ul class="main-menu">
         <li><a href="https://wickedstuff.co.nz" title="Home"><i class="fa fa-home"></i></a></li>
                           <li><a href="test-category.html" title="Test Category" >Test Category</a></li>
                  <li><a href="https://wickedstuff.co.nz/privacy-policy.html" title="Privacy Policy" >Privacy Policy</a></li>
                  <li><a href="https://wickedstuff.co.nz/returns-policy.html" title="Returns Policy" >Returns Policy</a></li>
                  <li><a href="https://wickedstuff.co.nz/store-policies.html" title="Store Policies" >Store Policies</a></li>
         
                           <li><a href="https://wickedstuff.co.nz/contact-us.html" title="Contact Us">Contact Us</a></li>
                   
         <div class="clear"></div>
      </ul>
   </nav>
</div>

Please carefully note that the second list item, the one for the category, does not have a full and complete URL -- it is a relative path. Thus, the browser is attempting to figure out the complete URL and is inadvertently using the /test-category/ part of the path as the path to the actual site - as opposed to the path to the document.

Compare the template code for these list items and note that all should have {$STORE_URL} (or something like it) as a lead-in.

Also, since you are editing a template, have Cubecart clear it's cache (admin, Maintenance, Rebuild tab, Clear Cache).

Edited by bsmither
Link to comment
Share on other sites

25 minutes ago, bsmither said:

This is what my browser sees:


<div id="box-documents">
   <nav>
      <ul class="main-menu">
         <li><a href="https://wickedstuff.co.nz" title="Home"><i class="fa fa-home"></i></a></li>
                           <li><a href="test-category.html" title="Test Category" >Test Category</a></li>
                  <li><a href="https://wickedstuff.co.nz/privacy-policy.html" title="Privacy Policy" >Privacy Policy</a></li>
                  <li><a href="https://wickedstuff.co.nz/returns-policy.html" title="Returns Policy" >Returns Policy</a></li>
                  <li><a href="https://wickedstuff.co.nz/store-policies.html" title="Store Policies" >Store Policies</a></li>
         
                           <li><a href="https://wickedstuff.co.nz/contact-us.html" title="Contact Us">Contact Us</a></li>
                   
         <div class="clear"></div>
      </ul>
   </nav>
</div>

Please carefully note that the second list item, the one for the category, does not have a full and complete URL -- it is a relative path. Thus, the browser is attempting to figure out the complete URL and is inadvertently using the /test-category/ part of the path as the path to the actual site - as opposed to the path to the document.

Compare the template code for these list items and note that all should have {$STORE_URL} (or something like it) as a lead-in.

Also, since you are editing a template, have Cubecart clear it's cache (admin, Maintenance, Rebuild tab, Clear Cache).

Thanks for the fast reply, sorry for dumb question, which file should I edit and what should I add? seo.class.php

Edited by devilish
Link to comment
Share on other sites

Somehow, the code for the main nav menu is now inside the documents box. Nothing wrong with that.

I don't have a copy of GalaxyX, so I can't give 100% advice.

In /skins/galaxyx/templates/, look for box.documents.php, box.navigation.php, and element.navigation_tree.php.

The <ul class="main-menu"> is what you are going to find first. Then determine where the list items come from.

Hopefully, it will be obvious what is missing.

Edited by bsmither
Link to comment
Share on other sites

3 minutes ago, bsmither said:

Somehow, the code for the main nav menu is now inside the documents box. Nothing wrong with that.

I don't have a copy of GalaxyX, so I can't give 100% advice.

In /skins/galaxyx/templates/, look for box.documents.php, box.navigation.php, and element.navigation_tree.php.

The <ul class="main-menu"> is what you are going to find first. Then determine where the list items come from.

Hopefully, it will be obvious what is missing.

for box.documents.php

{*
 * CubeCart v6
 * ========================================
 * CubeCart is a registered trade mark of CubeCart Limited
 * Copyright CubeCart Limited 2015. All rights reserved.
 * UK Private Limited Company No. 5323904
 * ========================================
 * Web:   http://www.cubecart.com
 * Email:  [email protected]
 * License:  GPL-3.0 https://www.gnu.org/licenses/quick-guide-gplv3.html
 *}
<div id="box-documents">
   <nav>
      <ul class="main-menu">
         <li><a href="{$STORE_URL}" title="{$LANG.common.home}"><i class="fa fa-home"></i></a></li>
         {if isset($DOCUMENTS) && count($DOCUMENTS) > 0}
         {foreach from=$DOCUMENTS item=document}
         <li><a href="{$document.doc_url}" title="{$document.doc_name}" {if $document.doc_url_openin}target="_blank"{/if}>{$document.doc_name}</a></li>
         {/foreach}
         {/if}
         {if isset($CONTACT_URL)}
         <li><a href="{$CONTACT_URL}" title="{$LANG.documents.document_contact}">{$LANG.documents.document_contact}</a></li>
         {/if}
         {foreach from=$DOCUMENTS_LIST_HOOKS item=list_item}
         <li><a href="{$list_item.href}" title="{$list_item.title}">{$list_item.title}</a></li>
         {/foreach} 
         <div class="clear"></div>
      </ul>
   </nav>
</div>

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

for box.navigation.php

{*
 * CubeCart v6
 * ========================================
 * CubeCart is a registered trade mark of CubeCart Limited
 * Copyright CubeCart Limited 2015. All rights reserved.
 * UK Private Limited Company No. 5323904
 * ========================================
 * Web:   http://www.cubecart.com
 * Email:  [email protected]
 * License:  GPL-3.0 https://www.gnu.org/licenses/quick-guide-gplv3.html
 *}
{if $CATEGORIES}
{$CATEGORIES}
{else}
<h3><i class="fa fa-ellipsis-h"></i> {$LANG.navigation.title}</h3>
<div class="panel navigation">
  <ul> 
        {$NAVIGATION_TREE}
        {if $CTRL_CERTIFICATES && !$CATALOGUE_MODE}
        <li><a href="{$STORE_URL}/gift-certificates.html" title="{$LANG.navigation.giftcerts}">{$LANG.navigation.giftcerts}</a></li>
        {/if}
        {if $CTRL_SALE}
        <li><a href="{$STORE_URL}/sale-items.html" title="{$LANG.navigation.saleitems}">{$LANG.navigation.saleitems}</a></li>
        {/if}
     </ul>
</div>
{/if}

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

for element.navigation_tree.php

{*
 * CubeCart v6
 * ========================================
 * CubeCart is a registered trade mark of CubeCart Limited
 * Copyright CubeCart Limited 2015. All rights reserved.
 * UK Private Limited Company No. 5323904
 * ========================================
 * Web:   http://www.cubecart.com
 * Email:  [email protected]
 * License:  GPL-3.0 https://www.gnu.org/licenses/quick-guide-gplv3.html
 *}
<li class="has-dropdown">
   <a href="{$BRANCH.url}" title="{$BRANCH.name}">{$BRANCH.name}</a>
   {if isset($BRANCH.children)}
   <ul class="dropdown">
      <li><h3 class="branch-name">{$BRANCH.name}</h3></li>
      {$BRANCH.children}
   </ul>
   {/if}
</li>

Link to comment
Share on other sites

In box.documents.php, this part of the code:

      <ul class="main-menu">
         <li><a href="{$STORE_URL}" title="{$LANG.common.home}"><i class="fa fa-home"></i></a></li>
         {if isset($DOCUMENTS) && count($DOCUMENTS) > 0}
         {foreach from=$DOCUMENTS item=document}
         <li><a href="{$document.doc_url}" title="{$document.doc_name}" {if $document.doc_url_openin}target="_blank"{/if}>{$document.doc_name}</a></li>
         {/foreach}
         {/if}

This shows the Home icon, then links to each document (Privacy, etc).

What is missing is the code that puts the link to "Test Category" between Home and Privacy. Are you sure you are looking in the GalaxyX skin folder?

For GalaxyX, it is not too strange that somehow, the skin is convincing CubeCart to load the categories in the document bar. And getting it wrong.

Link to comment
Share on other sites

31 minutes ago, bsmither said:

In box.documents.php, this part of the code:


      <ul class="main-menu">
         <li><a href="{$STORE_URL}" title="{$LANG.common.home}"><i class="fa fa-home"></i></a></li>
         {if isset($DOCUMENTS) && count($DOCUMENTS) > 0}
         {foreach from=$DOCUMENTS item=document}
         <li><a href="{$document.doc_url}" title="{$document.doc_name}" {if $document.doc_url_openin}target="_blank"{/if}>{$document.doc_name}</a></li>
         {/foreach}
         {/if}

This shows the Home icon, then links to each document (Privacy, etc).

What is missing is the code that puts the link to "Test Category" between Home and Privacy. Are you sure you are looking in the GalaxyX skin folder?

For GalaxyX, it is not too strange that somehow, the skin is convincing CubeCart to load the categories in the document bar. And getting it wrong.

Yes downloaded from server /public_html/skins/galaxyx/templates. this maybe the cause.

I came up with a workaround regarding this topic you help me out with.

I'm adding categories to the document bar via documents. 

doc1.PNG

doc2.PNG

It fixes this issue we were having, I e-mailed the skin's publisher and have had no reply, this is why used this method.

mobile1.PNG

Fixed

mobile2.PNG

 

Edited by devilish
Link to comment
Share on other sites

4 minutes ago, bsmither said:

I see what may be happening.

I've made documents into categories, but not categories into documents.

I will need to study this.

Thanks, just to let know, I backed up all the changes we made to the Galaxy theme and have it on file, 
Note: this current site is a new installation with data based tables dropped, The Galaxy theme was reinstall with a fresh original copy.

I them over write the /public_html/skins/galaxyx/css files with my saved one's. the only other file changed was element.social.php

Hope this helps

Link to comment
Share on other sites

1 hour ago, bsmither said:

I wonder if this setting will change things:

admin, Store Settings, Search Engines, "Add subcategroies to category URL path", set to No.

Didn't work, I cleared the cache.

Edited by devilish
Link to comment
Share on other sites

1 hour ago, bsmither said:

How did you create the document titled Test Category?

Is this simply copying the actual category HTML into the Edit Document, Contents tab?

See what happens when you delete the contents in the URL field of the Edit Document, General tab.

Just created test category document then used the URL from the test category that I created in the category section of the admin

test-category.html

C1.PNG

C2.PNG

 

--------------------------------------------------------------------------------------------------------------------------------------------------------------

C3.PNG

C1.PNG

here's the admin login details, I'll delete this info as soon as you reply to this post.

Edited by devilish
Link to comment
Share on other sites

Ok, so with the URL removed (this is supposed to be a full and complete URL that points to a document somewhere, not ncessarily to your site, possible a PDF perhaps), everything is working as it should.

CubeCart forms the real URL for the document "Test Category" (doc_id 2) as 'test-category-d2'.

Thus, CubeCart forms the real URL for the category "Test Category" (cat_id 1) as 'test-category'.

There should not be any more database errors "duplicate entry'. (Except for the Sale Items error message. That one is strange.)

What we can try is to specify the full and complete URL for the "Test Category" category in the [destination] URL of the document.

That seems to work except for the fact there is no drop-down for its sub-categories (sub-cat Test2).

So, what is your intent? To combine categories and documents onto one bar? (Might run out of room!)

Link to comment
Share on other sites

47 minutes ago, bsmither said:

Ok, so with the URL removed (this is supposed to be a full and complete URL that points to a document somewhere, not ncessarily to your site, possible a PDF perhaps), everything is working as it should.

CubeCart forms the real URL for the document "Test Category" (doc_id 2) as 'test-category-d2'.

Thus, CubeCart forms the real URL for the category "Test Category" (cat_id 1) as 'test-category'.

There should not be any more database errors "duplicate entry'. (Except for the Sale Items error message. That one is strange.)

What we can try is to specify the full and complete URL for the "Test Category" category in the [destination] URL of the document.

That seems to work except for the fact there is no drop-down for its sub-categories (sub-cat Test2).

So, what is your intent? To combine categories and documents onto one bar? (Might run out of room!)

ideally my intent is to combine categories and documents onto the main bar menu. the store policies link will have all the website policies on the one page.  contact link will stay in bar.
menu bar will be structured with main categories then have sub categories on the main categories page which will remove the need for a drop down menu in the main bar.

it's what i'm trying to achieve with your help

thanks

Edited by devilish
Link to comment
Share on other sites

Then the approach you've taken will work with the proviso that the URL specified in the Edit Document, General tab is full and complete, containing the seo-path of the target category. For example: //wickedstuff.co.nz/test-category.html (leave off the http or https so that the browser adds it to match the protocol of the original page request).

No drop-downs on the nav bar.

 

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