The code in the footer menu is:
<li><a href="' . zen_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a></li>
What should change to make this the proper Zen Cart function?
Thanks,
Melissa
Printable View
The Usual Suspects
If the exact same link is showing up differently in different places in the same template: 98% of the time the cause is a hardcoded link in the specific template and 2% of the time something is not installed correctly.
If the exact same link always shows up as the Zen Cart URL and not the alternative URL (no matter where the link appears): 70% of the time the link is hardcoded, 28% of the time the link is not in the list of "pages to rewrite" (configuration), and 2% of the time something is not installed correctly.
If the link comes from an "EZ-Page" (some templates use EZ-Pages to define links in the header / footer) and the URL is not being altered: 70% of the time the cause is an incorrect URL specified for the "EZ-Page", 20% of the time the link is not in the list of "pages to rewrite" (configuration), and 10% of the time something is not installed correctly.
Keep in mind Zen Cart allows override folders and will fall back to the files inside the "default_template" (core files in the "default_template" should never be modified). So double check both places.
Last Resort
If after checking the usual suspects problems are still encountered, chances are the installed copy of Zen Cart has been modified in some way which is causing the issue (or USU is not installed correctly). In this case someone with good troubleshooting skills and a strong understanding of Zen Cart (including the templates and modules involved) may need to be engaged.
In the meantime, customers can still browse the site, will get to the correct pages via either URL (Zen Cart default or USU alternative), and the canonical link will keep search engines happy (unless your template removes this feature).
Note 1: For the purposes of this module, a hardcoded link is one not using the function zen_href_link() or using zen_href_link() incorrectly.
Note 2: Ultimate (seo) URLs falls back to using the standard Zen Cart URL generation in the event something goes wrong. This reduces the possibility of website visitors encountering issues. It would be a good idea to check the Zen Cart "debug" logs and PHP "error" logs and see if they contain anything.
Note 3: When upgrading from Zen Cart 1.2.x or 1.3.x to Zen Cart 1.5.x with a version of USU < 2.200, it is vital all portions of the older version of USU are uninstalled before performing upgrading. In most cases rebuilding the site on 1.5.x is the preferred method and lowers the chance of conflicts from older modules not compatible with Zen Cart 1.5.x.
Note 4: Percentages are estimates based upon a VERY small sample representing the number of times a similar problem has been reported.
That is a great explanation - thank you! In this case, the footer links are pulled from the template's language file footer_menu_defines.php instead of template/common/tpl_footer.php. This is the same for many of the responsive templates that I am looking into and each one has the same problem. If I move the shipping link code into the tpl_footer file, I does re-write correctly.
Indeed the canonical link is to the correct page. Works for me!
Thanks you again!
I cant seem to get this mod working on 1.51. Url's are rewritten, But, I get a 404 error when I click on the links. I've tried cleaning cache. store is in root directory. htaccess was set as rewrite base /, then I commented it out after reading that you can do this if store is in base. Tried default template, same problem. Tried with and without www.
Rewritebase (no space)
Is Litespeed Technologies to blame for this?
No other mods to the htaccess file.
Links will only give you a 404 page that says :
404 Not Found
The resource requested could not be found on this server! Powered By LiteSpeed Web Server
LiteSpeed Technologies is not responsible for administration and contents of this web site!
zc of course has an htaccess file in almost every directory. I have not edited any of those
Have you looked at the two links I posted? You probably need to enable LiteSpeed's rewrite module (and allow overrides in .htaccess files). Your host should be able to help you.
Yes I did look thank you. I wouldnt ignore someones ideas, what would be the point. I dont have access to the server. So there is nothing I can do. BTW, simple seo works fine.
Fair enough, just had to ask as you did not answer the questions asked or provide a link so we could see the behavior.
Usually 404 errors are caused by the .htaccess file directives being ignored by the server, the .htaccess placed in the wrong location, or a bad install of the module.
Glad you were able to install a solution which works for you. If you want to troubleshoot this module further on the host, feel free to set up a test site and send me a PM.
A small problem that happens to me: if I leave blank the filed "Enter pages to allow rewrite" then all pages works fine, exclude ask_a_question and reviews pages. Instead if I fill this field with product_info,contact_us,returns,conditions,privacy,about_us, the categories and manufactures don't be rewritten by seo. Is there a way to have all links rewritte, include ask_a_question and reviews?
Thank you
It turns out this fix has caused more problems than it fixed.
Firstly, use_function is used to display the value on the preview screen. Our tabbed configuration has no preview, so this is why we skipped using this function. Since our configuration page shows the input field and uses the same code as default Zen Cart, there is no need to use this fix.
This is why the code is not used for displaying the current value of a configuration field which is how it's used in default Zen Cart. However, the proposed fix is being used to manipulate the value before it's stored in the database which means that it will cause a lot of incorrect data to be stored (for example, the default country ID under Customer Details will get stored as United States instead of 223 and then when the page reloads it'll look like nothing was saved since United States is not an option value in the select field).
We're rolling back this code change in our mods.
Right.. and apparently use_function can be used for MORE than this.. wouldn't you guys be interested in some "spirit" of collaboration in making sure that your module plays nice with others.. Thank goodness lhungil was nice enough to help me fix an issue with the Google Product Search module otherwise I'd still be spitting in the wind..
And this was the exact discovery that we made as well.. my apologies for not posting an update to this.. The Numinix modified configuration.php file does NOT work with USU.. The fix posted earlier helped, but wasn't quite the right fix.. Turns out that it required a bit of a BIGGER fix.. I have included my entire modified configuration.php file with the NEW code that I have working on my development site.. It allows BOTH USU and the Numinix modified configuration.php file to co-exist peacefully.. You all don't HAVE to update your products with these changes, but I'm sure as heck gonna suggest folks use it if they are using your Google Product Search product since it's working on my dev site with NO ISSUES whatsoever..
I'll leave it to your code jockey's to hash out the whys and hows.. I only care that I have a WORKING site..
Code:<?php
/**
* @package admin
* @copyright Copyright 2003-2012 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version GIT: $Id: Author: Ian Wilson Thu Aug 16 12:36:12 2012 +0100 Modified in v1.5.1 $
*/
require('includes/application_top.php');
$action = (isset($_GET['action']) ? $_GET['action'] : '');
if (zen_not_null($action)) {
switch ($action) {
case 'save':
// demo active test
if (zen_admin_demo()) {
$_GET['action']= '';
$messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
zen_redirect(zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $cID));
}
$configuration_value = zen_db_prepare_input($_POST['configuration_value']);
$cID = zen_db_prepare_input($_GET['cID']);
$db->Execute("update " . TABLE_CONFIGURATION . "
set configuration_value = '" . zen_db_input($configuration_value) . "',
last_modified = now() where configuration_id = '" . (int)$cID . "'");
$configuration_query = 'select configuration_key as cfgkey, configuration_value as cfgvalue
from ' . TABLE_CONFIGURATION;
$configuration = $db->Execute($configuration_query);
// set the WARN_BEFORE_DOWN_FOR_MAINTENANCE to false if DOWN_FOR_MAINTENANCE = true
if ( (WARN_BEFORE_DOWN_FOR_MAINTENANCE == 'true') && (DOWN_FOR_MAINTENANCE == 'true') ) {
$db->Execute("update " . TABLE_CONFIGURATION . "
set configuration_value = 'false', last_modified = '" . NOW . "'
where configuration_key = 'WARN_BEFORE_DOWN_FOR_MAINTENANCE'"); }
$configuration_query = 'select configuration_key as cfgkey, configuration_value as cfgvalue
from ' . TABLE_CONFIGURATION;
$configuration = $db->Execute($configuration_query);
zen_redirect(zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $cID));
break;
}
}
$gID = (isset($_GET['gID'])) ? $_GET['gID'] : 1;
$_GET['gID'] = $gID;
$cfg_group = $db->Execute("select configuration_group_title
from " . TABLE_CONFIGURATION_GROUP . "
where configuration_group_id = '" . (int)$gID . "'");
if ($gID == 7) {
$shipping_errors = '';
if (zen_get_configuration_key_value('SHIPPING_ORIGIN_ZIP') == 'NONE' or zen_get_configuration_key_value('SHIPPING_ORIGIN_ZIP') == '') {
$shipping_errors .= '<br />' . ERROR_SHIPPING_ORIGIN_ZIP;
}
if (zen_get_configuration_key_value('ORDER_WEIGHT_ZERO_STATUS') == '1' and !defined('MODULE_SHIPPING_FREESHIPPER_STATUS')) {
$shipping_errors .= '<br />' . ERROR_ORDER_WEIGHT_ZERO_STATUS;
}
if (defined('MODULE_SHIPPING_USPS_STATUS') and (MODULE_SHIPPING_USPS_USERID=='NONE' or MODULE_SHIPPING_USPS_SERVER == 'test')) {
$shipping_errors .= '<br />' . ERROR_USPS_STATUS;
}
if ($shipping_errors != '') {
$messageStack->add(ERROR_SHIPPING_CONFIGURATION . $shipping_errors, 'caution');
}
}
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
<script language="javascript" src="includes/menu.js"></script>
<script language="javascript" src="includes/general.js"></script>
<script type="text/javascript">
<!--
function init()
{
cssjsmenu('navbar');
if (document.getElementById)
{
var kill = document.getElementById('hoverJS');
kill.disabled = true;
}
}
// -->
</script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onLoad="init()">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->
<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
<tr>
<!-- body_text //-->
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="pageHeading"><?php echo $cfg_group->fields['configuration_group_title']; ?></td>
<td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
</tr>
</table></td>
</tr>
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr class="dataTableHeadingRow">
<td class="dataTableHeadingContent" width="55%"><?php echo TABLE_HEADING_CONFIGURATION_TITLE; ?></td>
<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CONFIGURATION_VALUE; ?></td>
<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>
</tr>
<?php
$configuration = $db->Execute("select configuration_id, configuration_title, configuration_value, configuration_key,
use_function from " . TABLE_CONFIGURATION . "
where configuration_group_id = '" . (int)$gID . "'
order by sort_order");
while (!$configuration->EOF) {
if (zen_not_null($configuration->fields['use_function'])) {
$use_function = $configuration->fields['use_function'];
if (preg_match('/->/', $use_function)) {
$class_method = explode('->', $use_function);
if (!is_object(${$class_method[0]})) {
include(DIR_WS_CLASSES . $class_method[0] . '.php');
${$class_method[0]} = new $class_method[0]();
}
$cfgValue = zen_call_function($class_method[1], $configuration->fields['configuration_value'], ${$class_method[0]});
} else {
$cfgValue = zen_call_function($use_function, $configuration->fields['configuration_value']);
}
} else {
$cfgValue = $configuration->fields['configuration_value'];
}
if ((!isset($_GET['cID']) || (isset($_GET['cID']) && ($_GET['cID'] == $configuration->fields['configuration_id']))) && !isset($cInfo) && (substr($action, 0, 3) != 'new')) {
$cfg_extra = $db->Execute("select configuration_key, configuration_description, date_added,
last_modified, use_function, set_function
from " . TABLE_CONFIGURATION . "
where configuration_id = '" . (int)$configuration->fields['configuration_id'] . "'");
$cInfo_array = array_merge($configuration->fields, $cfg_extra->fields);
$cInfo = new objectInfo($cInfo_array);
}
if ( (isset($cInfo) && is_object($cInfo)) && ($configuration->fields['configuration_id'] == $cInfo->configuration_id) ) {
echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $cInfo->configuration_id . '&action=edit') . '\'">' . "\n";
} else {
echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $configuration->fields['configuration_id'] . '&action=edit') . '\'">' . "\n";
}
?>
<td class="dataTableContent"><?php echo $configuration->fields['configuration_title']; ?></td>
<td class="dataTableContent"><?php echo htmlspecialchars($cfgValue, ENT_COMPAT, CHARSET, TRUE); ?></td>
<td class="dataTableContent" align="right"><?php if ( (isset($cInfo) && is_object($cInfo)) && ($configuration->fields['configuration_id'] == $cInfo->configuration_id) ) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $configuration->fields['configuration_id']) . '" name="link_' . $configuration->fields['configuration_key'] . '">' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>
</tr>
<?php
$configuration->MoveNext();
}
?>
</table></td>
<?php
$heading = array();
$contents = array();
switch ($action) {
case 'edit':
$heading[] = array('text' => '<b>' . $cInfo->configuration_title . '</b>');
if ($cInfo->set_function) {
eval('$value_field = ' . $cInfo->set_function . '"' . htmlspecialchars($cInfo->configuration_value, ENT_COMPAT, CHARSET, TRUE) . '");');
} else {
$value_field = zen_draw_input_field('configuration_value', htmlspecialchars($cInfo->configuration_value, ENT_COMPAT, CHARSET, TRUE), 'size="60"');
}
$contents = array('form' => zen_draw_form('configuration', FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $cInfo->configuration_id . '&action=save'));
if (ADMIN_CONFIGURATION_KEY_ON == 1) {
$contents[] = array('text' => '<strong>Key: ' . $cInfo->configuration_key . '</strong><br />');
}
$contents[] = array('text' => TEXT_INFO_EDIT_INTRO);
$contents[] = array('text' => '<br><b>' . $cInfo->configuration_title . '</b><br>' . $cInfo->configuration_description . '<br>' . $value_field);
$contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_update.gif', IMAGE_UPDATE, 'name="submit' . $cInfo->configuration_key . '"') . ' <a href="' . zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $cInfo->configuration_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
break;
default:
if (isset($cInfo) && is_object($cInfo)) {
$heading[] = array('text' => '<b>' . $cInfo->configuration_title . '</b>');
if (ADMIN_CONFIGURATION_KEY_ON == 1) {
$contents[] = array('text' => '<strong>Key: ' . $cInfo->configuration_key . '</strong><br />');
}
$contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $cInfo->configuration_id . '&action=edit') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a>');
$contents[] = array('text' => '<br>' . $cInfo->configuration_description);
$contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . zen_date_short($cInfo->date_added));
if (zen_not_null($cInfo->last_modified)) $contents[] = array('text' => TEXT_INFO_LAST_MODIFIED . ' ' . zen_date_short($cInfo->last_modified));
}
break;
}
if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
echo ' <td width="25%" valign="top">' . "\n";
$box = new box;
echo $box->infoBox($heading, $contents);
echo ' </td>' . "\n";
}
?>
</tr>
</table></td>
</tr>
</table></td>
<!-- body_text_eof //-->
</tr>
</table>
<!-- body_eof //-->
<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
Working on a site that was running USU 2.10 and getting a BOATLOAD of errors in their error log.. I upgraded to to 2.12 and now occasionally still get this error:
HELP!!Quote:
Undefined variable: _sid in /home/XXXXXX/public_html/includes/classes/seo.url.php on line 215
Having a hard time wrapping my head around exactly what is not working fine... Can you provide a detailed response include what you expect to happen and what is happening?
I should note there is a known bug in 2.212 with the "write a review" button when the "Enter pages to allow rewrite" option is blank. This can be fixed by editing "/includes/classes/seo.url.php". Around line 270 add the line in red:
Code:case ($page == FILENAME_PRODUCT_REVIEWS_INFO):
$url = $this->make_url($page, $this->get_product_name($p2[1], $cID), 'products_id_review_info', $p2[1], SEO_URL_END, $separator);
break;
case ($page == FILENAME_PRODUCT_REVIEWS_WRITE):
case ($page == FILENAME_DEFAULT):
$container[$p2[0]] = $p2[1];
break;
case ($page == FILENAME_PRODUCT_INFO):
Around line 200, try adding an explicit $_sid = null;
Can you verify line 215 is "case (zen_not_null($_sid)):" for me? What version of PHP is the host running? Any other messages? Just curious because I have not seen this one before!Code:global $request_type, $http_domain, $https_domain, $session_started;
$_sid = null;
if(($add_session_id == true) && ($session_started) && (SESSION_FORCE_COOKIE_USE == 'False')) {
Can you try going to CONFIGURATION > CUSTOMER DETAILS and try changing the default country ID? Because use_function shouldn't be used inside the field, but only for the preview, it will cause the dropdown to display "none" as selected, even though if you verify in your database, it will be set to the correct country ID that you had selected.
PHP version 5.3.24
Lines 200-209
Line 215Code:if(($add_session_id == true) && ($session_started) && (SESSION_FORCE_COOKIE_USE == 'False')) {
if(defined('SID') && zen_not_null(SID)) {
$_sid = SID;
}
else if((($request_type == 'NONSSL') && ($connection == 'SSL') && (ENABLE_SSL == 'true')) || (($request_type == 'SSL') && ($connection == 'NONSSL'))) {
if($http_domain != $https_domain) {
$_sid = zen_session_name() . '=' . zen_session_id();
}
}
}
Gonna make this change report back if the error goes away..Code:case (zen_not_null($_sid)):
Here's what I see:
http://i60.tinypic.com/1rf7l2.png
Here's the modified code I used (what I posted earlier was WRONG WRONG WRONG -- it was the original code)
Code:<?php
/**
* @package admin
* @copyright Copyright 2003-2012 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version GIT: $Id: Author: Ian Wilson Thu Aug 16 12:36:12 2012 +0100 Modified in v1.5.1 $
*/
// configuration
//if (!defined('NUMINIX_DEMO')) define('NUMINIX_DEMO', 'true'); // set to true or false
// end
require('includes/application_top.php');
$action = (isset($_GET['action']) ? $_GET['action'] : '');
// modified demo ability of Zen Cart to store demo configuration on an IP basis if user is not a superuser
$demo_config = false;
$configuration_table = TABLE_CONFIGURATION;
if (NUMINIX_DEMO == 'true') {
// get the admin profile level
$admin_profile = $db->Execute("SELECT admin_profile FROM " . TABLE_ADMIN . " WHERE admin_id = " . (int)$_SESSION['admin_id'] . " AND admin_profile = 1 LIMIT 1;");
// proceed if user is not a superuser
if ($admin_profile->RecordCount() == 0) {
$demo_config = true;
$configuration_table = TABLE_DEMO_CONFIGURATION;
$demo_where_and = ' AND ip_address = "' . $_SERVER["REMOTE_ADDR"] . '"';
$demo_where = ' WHERE ip_address = "' . $_SERVER["REMOTE_ADDR"] . '"';
// build configuration table
$all_configuration = $db->Execute("SELECT * FROM " . TABLE_CONFIGURATION . " ORDER BY configuration_id ASC");
if ($all_configuration->RecordCount() > 0) {
while (!$all_configuration->EOF) {
// check if configuration exists in demo
$all_demo_configuration = $db->Execute("SELECT * FROM " . TABLE_DEMO_CONFIGURATION . " WHERE configuration_key = '" . $all_configuration->fields['configuration_key'] . "' AND ip_address = '" . $_SERVER["REMOTE_ADDR"] . "' LIMIT 1;");
if (!($all_demo_configuration->RecordCount() > 0)) {
// add the configuration setting
$db->Execute("INSERT INTO " . TABLE_DEMO_CONFIGURATION . " (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function, configuration_tab, ip_address)
VALUES (
" . (int)$all_configuration->fields['configuration_id'] . ",
'" . addslashes(zen_db_prepare_input($all_configuration->fields['configuration_title'])) . "',
'" . addslashes(zen_db_prepare_input($all_configuration->fields['configuration_key'])) . "',
'" . addslashes(zen_db_prepare_input($all_configuration->fields['configuration_value'])) . "',
'" . addslashes(zen_db_prepare_input($all_configuration->fields['configuration_description'])) . "',
" . (int)$all_configuration->fields['configuration_group_id'] . ",
" . (int)$all_configuration->fields['sort_order'] . ",
'" . addslashes(zen_db_prepare_input($all_configuration->fields['last_modified'])) . "',
'" . addslashes(zen_db_prepare_input($all_configuration->fields['date_added'])) . "',
'" . addslashes(zen_db_prepare_input($all_configuration->fields['use_function'])) . "',
'" . addslashes(zen_db_prepare_input($all_configuration->fields['set_function'])) . "',
'" . addslashes(zen_db_prepare_input($all_configuration->fields['configuration_tab'])) . "',
'" . addslashes(zen_db_prepare_input($_SERVER["REMOTE_ADDR"])) . "'
);");
}
$all_configuration->MoveNext();
}
}
}
}
if (zen_not_null($action)) {
switch ($action) {
case 'save':
// demo active test
if (zen_admin_demo()) {
$_GET['action']= '';
$messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
zen_redirect(zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $cID));
}
if (NUMINIX_DEMO == 'true') {
// get the admin profile level
$admin_profile = $db->Execute("SELECT admin_profile FROM " . TABLE_ADMIN . " WHERE admin_id = " . (int)$_SESSION['admin_id'] . " AND admin_profile = 1 LIMIT 1;");
if ($admin_profile->RecordCount() == 1) {
$demo_admin_superuser = true;
}
}
foreach($_POST as $cfgID => $cfgValue) {
$strpos = strpos($cfgID, 'cfg_');
if ($strpos !== FALSE) {
$cID = zen_db_prepare_input(substr($cfgID, $strpos + 4));
$configuration_value = zen_db_prepare_input($cfgValue);
$db->Execute("update " . $configuration_table . "
set configuration_value = '" . zen_db_input($configuration_value) . "',
last_modified = now() where configuration_id = '" . (int)$cID . "'" . $demo_where_and);
if ($demo_admin_superuser) {
$db->Execute("update " . TABLE_DEMO_CONFIGURATION . "
set configuration_value = '" . zen_db_input($configuration_value) . "',
last_modified = now() where configuration_id = '" . (int)$cID . "';");
}
}
}
$configuration_query = 'select configuration_key as cfgkey, configuration_value as cfgvalue
from ' . $configuration_table . $demo_where;
$configuration = $db->Execute($configuration_query);
// set the WARN_BEFORE_DOWN_FOR_MAINTENANCE to false if DOWN_FOR_MAINTENANCE = true
if ( (WARN_BEFORE_DOWN_FOR_MAINTENANCE == 'true') && (DOWN_FOR_MAINTENANCE == 'true') ) {
$db->Execute("update " . $configuration_table . "
set configuration_value = 'false', last_modified = '" . NOW . "'
where configuration_key = 'WARN_BEFORE_DOWN_FOR_MAINTENANCE'" . $demo_where_and);
}
zen_redirect(zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID']));
break;
}
}
$gID = (isset($_GET['gID'])) ? $_GET['gID'] : 1;
$_GET['gID'] = $gID;
$cfg_group = $db->Execute("select configuration_group_title
from " . TABLE_CONFIGURATION_GROUP . "
where configuration_group_id = '" . (int)$gID . "'");
if ($gID == 7) {
$shipping_errors = '';
if (zen_get_configuration_key_value('SHIPPING_ORIGIN_ZIP') == 'NONE' or zen_get_configuration_key_value('SHIPPING_ORIGIN_ZIP') == '') {
$shipping_errors .= '<br />' . ERROR_SHIPPING_ORIGIN_ZIP;
}
if (zen_get_configuration_key_value('ORDER_WEIGHT_ZERO_STATUS') == '1' and !defined('MODULE_SHIPPING_FREESHIPPER_STATUS')) {
$shipping_errors .= '<br />' . ERROR_ORDER_WEIGHT_ZERO_STATUS;
}
if (defined('MODULE_SHIPPING_USPS_STATUS') and (MODULE_SHIPPING_USPS_USERID=='NONE' or MODULE_SHIPPING_USPS_SERVER == 'test')) {
$shipping_errors .= '<br />' . ERROR_USPS_STATUS;
}
if ($shipping_errors != '') {
$messageStack->add(ERROR_SHIPPING_CONFIGURATION . $shipping_errors, 'caution');
}
}
// START fix code to utilize the use_function (1 / 3)
// Basically we moved this code inside the HTML generation
// END fix code to utilize the use_function (1 / 3)
function cleanConfigurationTab($str) {
return strtolower(ereg_replace("[^A-Za-z0-9]", "", $str));
}
?>
<!doctype html>
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
<link rel="stylesheet" href="includes/modules/tabbed_configuration/css/tabbed_configuration.css">
<script language="javascript" src="includes/menu.js"></script>
<script language="javascript" src="includes/general.js"></script>
<script type="text/javascript">
<!--
function init()
{
cssjsmenu('navbar');
if (document.getElementById)
{
var kill = document.getElementById('hoverJS');
kill.disabled = true;
}
}
// -->
</script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script src="includes/modules/tabbed_configuration/js/jquery-main.js"></script>
<script src="includes/modules/tabbed_configuration/js/jquery-easyResponsiveTabs.js"></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onLoad="init()">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->
<div class="wrap">
<div class="mod-header">
<h1><?php echo $cfg_group->fields['configuration_group_title']; ?></h1>
</div>
<?php // START fix code to utilize the use_function (2 / 3)
$configuration_query =
'SELECT configuration_id, configuration_title, ' .
'configuration_value, configuration_description, ' .
'configuration_key, use_function, set_function, ' .
'configuration_tab ' .
'FROM ' . $configuration_table . ' ' .
'WHERE configuration_group_id = \'' . (int)$gID . '\'' . $demo_where_and . ' ' .
'ORDER BY sort_order, configuration_tab ASC';
$configuration = $db->Execute($configuration_query);
while (!$configuration->EOF) {
if(zen_not_null($configuration->fields['use_function'])) {
if (preg_match('/->/', $configuration->fields['use_function'])) {
$class_method = explode('->', $configuration->fields['use_function']);
if (!is_object(${$class_method[0]})) {
include(DIR_WS_CLASSES . $class_method[0] . '.php');
${$class_method[0]} = new $class_method[0]();
}
zen_call_function($class_method[1], $configuration->fields['configuration_value'], ${$class_method[0]});
} else {
zen_call_function($configuration->fields['use_function'], $configuration->fields['configuration_value']);
}
}
$configuration->MoveNext();
}
// The stock Zen Cart configuration file "reloads" the
// page between displaying configuration settings and
// editing a configuration setting. This "extra" query
// is needed to "replicate" the default Zen Cart behavior.
$configuration = $db->Execute($configuration_query);
$tabs = array();
while (!$configuration->EOF) {
if (!array_key_exists($configuration->fields['configuration_tab'], $tabs) && $configuration->fields['configuration_tab'] != '') {
$tabs[$configuration->fields['configuration_tab']] = array('options' => array());
}
if ($configuration->fields['configuration_tab'] == '') $configuration->fields['configuration_tab'] = 'General';
$tabs[$configuration->fields['configuration_tab']]['options'][] = array(
'configuration_id' => $configuration->fields['configuration_id'],
'configuration_title' => $configuration->fields['configuration_title'],
'configuration_description' => $configuration->fields['configuration_description'],
'configuration_value' => $configuration->fields['configuration_value'],
'configuration_key' => $configuration->fields['configuration_key'],
'use_function' => $configuration->fields['use_function'],
'set_function' => $configuration->fields['set_function']
);
$configuration->MoveNext();
}
// END fix code to utilize the use_function (2 / 3) ?>
<div class="mod-content">
<?php
echo zen_draw_form('configuration', FILENAME_CONFIGURATION, 'gID=' . (int)$_GET['gID'] . '&action=save');
?>
<div id="tabs">
<?php
foreach($tabs as $tab => $tab_vals) {
// build the tab
?>
<ul class="mod-tabs resp-tabs-list">
<li><?php echo $tab; ?></li>
</ul>
<div class="mod-tabs-content resp-tabs-container">
<div>
<table class="mod-table">
<tbody>
<?php
foreach($tab_vals['options'] as $configuration_option) {
echo '<tr>' . "\n";
// START fix code to utilize the use_function (3 / 3)
echo ' <td class="cl">' . $configuration_option['configuration_title'] . '<br />';
$configuration_value = $configuration_option['configuration_value'];
if(zen_not_null($configuration_option['use_function'])) {
// Run the use_function for display purposes
if (preg_match('/->/', $configuration_option['use_function'])) {
$class_method = explode('->', $configuration_option['use_function']);
if (!is_object(${$class_method[0]})) {
include(DIR_WS_CLASSES . $class_method[0] . '.php');
${$class_method[0]} = new $class_method[0]();
}
$configuration_value = zen_call_function($class_method[1], $configuration_option['configuration_value'], ${$class_method[0]});
} else {
$configuration_value = zen_call_function($configuration_option['use_function'], $configuration_option['configuration_value']);
}
}
echo '<small><i>Current Value: ' . $configuration_value . '</i></small></td>' . "\n";
// END fix code to utilize the use_function (3 / 3)
echo ' <td class="cl is-details"><em>' . $configuration_option['configuration_description'] . '</em></td>' . "\n";
echo ' <td class="cl">' . "\n";
if ($configuration_option['set_function']) {
eval('$value_field = ' . $configuration_option['set_function'] . '"' . htmlspecialchars($configuration_option['configuration_value'], ENT_COMPAT, CHARSET, TRUE) . '");');
} else {
$value_field = zen_draw_input_field('cfg_' . $configuration_option['configuration_id'], htmlspecialchars($configuration_option['configuration_value'], ENT_COMPAT, CHARSET, TRUE), 'size="60"');
}
echo ' ' . preg_replace('/<br>/', '', str_replace('configuration_value', 'cfg_' . $configuration_option['configuration_id'], $value_field), 1) . "\n";
echo ' </td>' . "\n";
echo '</tr>' . "\n";
}
?>
</tbody>
</table>
</div>
</div>
<?php
}
?>
<div class="mod-buttons">
<button class="mod-buttons-call"><?php echo TEXT_BUTTON_SAVE_CHANGES; ?></button>
<a href="<?php echo zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID']); ?>" class="mod-buttons-second"><?php echo TEXT_BUTTON_CANCEL; ?></a>
</div>
</div>
</form>
</div>
<div class="mod-footer">
<div class="mod-copyright">
<span>© <?php echo date('Y'); ?> <a href="http://www.numinix.com" target="_blank">Numinix.com</a></span>
<a href="http://www.numinix.com" target="_blank"><img src="includes/modules/tabbed_configuration/images/logo_numinix.png" alt="Numinix" /></a>
</div>
</div>
</div>
<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
I truly haven't done this in a long time on a 1.3.9h cart but I'm stumped at this point. If I upload the file for installation then of course I get the TABLE_ADMIN_PAGES' doesn't exist message. I read in this thread that this was supposed to be taken care of last year and it still seems to be in the code. Did or did not this get fixed for 1.3.9h? I'll be glad to comment out lines if I need but why isn't the if statement working? if(function_exists('zen_register_admin_page')) says if it exists to go forward - well it doesn't exist. This is a clean version of 1.3.9h with no mods installed.
This was corrected for "clean" installations of Ultimate (seo) URLs in version 2.212.
If you are getting this message a previous version was detected. I would suspect the database was not "clean" (did the database table "seo_cache" already exist? Where all configuration options from previous versions removed?).
There is a known bug in versions <= 2.212 under Zen Cart 1.3.9h when upgrading from versions <= 2.210. If one does not want to simply remove the old version (files and database) and re-install... One could try making the following change to "/admin/includes/init_includes/init_seo_config.php" around line 387 replacing:
with:Code:// Update the admin page language key
$check = $db->Execute(
'SELECT `page_key` FROM `' . TABLE_ADMIN_PAGES . '` ' .
'WHERE `page_key` = \'configUltimateSEO\''
);
if(!$check->EOF) {
zen_db_perform(TABLE_ADMIN_PAGES, array('language_key' => 'SEO_CONFIGURATION_GROUP_TITLE'), 'update', '`page_key`=\'' . $check->fields['page_key'] .'\'');
}
// Remove the old admin page if present
if(function_exists('zen_deregister_admin_pages')) {
if(zen_page_key_exists('UltimateSEO')) zen_deregister_admin_pages('UltimateSEO');
}
Note: The next release of this module will include a massive rewrite (the anchor text is about the only remaining portion of the original code). As this project is currently not being funded (and only worked on in my spare time), dates for BETA and FINAL releases are not set.Code:if(function_exists('zen_deregister_admin_pages')) {
// Update the admin page language key
$check = $db->Execute(
'SELECT `page_key` FROM `' . TABLE_ADMIN_PAGES . '` ' .
'WHERE `page_key` = \'configUltimateSEO\''
);
if(!$check->EOF) {
zen_db_perform(TABLE_ADMIN_PAGES, array('language_key' => 'SEO_CONFIGURATION_GROUP_TITLE'), 'update', '`page_key`=\'' . $check->fields['page_key'] .'\'');
}
// Remove the old admin page if present
if(zen_page_key_exists('UltimateSEO')) zen_deregister_admin_pages('UltimateSEO');
}
Aha, yes, the files were new but there had been a previous installation in the database and the table was still there. I had removed the config settings and didn't think the table would matter. I commented out the lines and finished the installation.
Thanks for the nugget of info. Shall hopefully stick in my head somewhere so it doesn't get lost!
After looking through this forum I have not been able to find the previous thread relating to the fix for the ceon sage pay server payment I frame issue, we have the same issue and have also turned off automatic rewriting but would like to fix the issue and turn the rewriting back on. A link to the thread would be appreciated.
As stated the cause is your 3rd party module is not coded as a Zen Cart page ("pages" on a Zen Cart site which use application_top.php should be coded as a Zen Cart page 98% of the time).
While not specific to "CEON Sage Pay", the options listed in this post about 3rd party modules not integrating as a Zen Cart page (but loading application_top) apply. Not my favorite workaround, but it works.
currently upgrading form 1.39 to 1.5.1
SIMPLE SEO URL is not supported in 1.5.1. However, as most other Zenners know the BIG problem with installing the ULTIMATE SEO URL mod is we will lose all the page URLs currently indexed by Google. a BIG problem . Is there anyway around this, i.e. to maintain current URLs set by SIMPLE SEO URL ? I know there is a paid mod that supposedly redirects the old Simple SEO URLs
If you use Ceon URI [http://www.zen-cart.com/downloads.php?do=file&id=889] you can set the url for each product manually to the same url it is now.
UPDATE: My web guy just installed Ultimate SEO as part of the 1.5.1 upgrade. Replacing my old Zen Simple SEO. Surprisingly after he installed Ultimate SEO, the URL redirects from Simple SEO appear to have maintained, they are exactly the same..?? I thought Ultimate SEO would not have the same URL redirects created from Simple SEO ?? Per what Ive read in this forum.. Am I missing something?
This thread is specifically for SUPPORT of Ultimate URLs. Any problems caused by other modules, questions about other modules, or discussion of other modules are best done in either the other module's support thread or by creating a new thread.
Yes, and there is a support thread for CEON URI.
There is a new re-incarnation of "Simple SEO" for Zen Cart 1.5.x. Have not tried the latest release, so cannot comment on if it is just a rework for Zen Cart 1.5.x or if it also includes much needed bugfixes for "Simple SEO".
This is not a problem caused by Ultimate URLs. The default URLs from Zen Cart AND the alternative ones generated by Ultimate URLs work. Further, Ultimate URLs does not remove Zen Cart parameters from the URL (it just makes them shorter). This allows Ultimate URLs to be completely removed (except for the .htaccess file) without breaking links (especially those from search engines).
I'm not sure the same can be said for the other major alternate URL tools. You would need to check their readme and support threads.
I'd "guess" your "web guy" did not completely remove "Simple SEO"... Possibly portions were left installed to allow the old URLs to continue working... Or manual 301 redirects were added... Or Ultimate URLs is not completely installed (or installed correctly)...
With a link to your site, some example URLs, and some more information (what is listed in admin -> configure)... We may be able to provide more insight... Although your "web guy" may also be able to answer the question for you...
Note: This is a good question (and one I'd investigate further if I was in your shoes). Don't mind these sort of questions, as they may be useful to people who use either module. If you find the cause / effect, I'd suggest posting the the answer to both threads. Adding to the readme of Simple SEO what to do when installing to not lose links would be helpful for people who use that modules... And I'd not be opposed to adding a section "migrating from XXX" to the readme of Ultimate URLs...
Website ver 1.3.9 is:
www.cvtreasures.com
Upgraded 1.5.1 version currently in testing mode is:
http://dipinfotech.co.in/cvtreasures/
Here is an example of product URL :
http://dipinfotech.co.in/cvtreasures...rongmen-p-2515
It appears as though your original 1.3.9h store is actually using Ultimate URLs (not Simple SEO). :smile:
You may want to revisit the "settings" for Ultimate URLs on the new site and tweak them to fit your needs. Not saying there is a "need", but it may be a good time to revisit the settings after an upgrade.
Note: Upgrading to a new version of Zen Cart (following the upgrade documentation) should not cause any problems if both the old and new store are both using Ultimate URLs. Ultimate URLs will automatically handle URLs generated: with different settings (for Ultimate URLs), older versions of Ultimate URLs, and by the native Zen Cart code.
Simple SEO does not usually add any anchor at the end such as "-p-123" on every link... Are you 100% sure files from both are not installed?
Hmmm, it appears I may be wrong... Looks like older versions of Simple SEO did use anchors for every link... As they use the same anchors, should be few (if any) problems converting from the older versions of Simple SEO to Ultimate URLs...
If one of the newer versions of Simple SEO (which omit anchors whenever possible) was installed, then additional coding / changes would be necessary.
Note: Support for the "news and article manager" add-on was removed from current versions of Ultimate URLs as the 3rd party module does not appear to be actively maintained - or fully compatible with Zen Cart 1.5.x.
hello everyone,
I have installed Ultimate SEO for a client, it works fine when I select the English language
http://www.gems4u.se/store/silver-je...emstones-c-25/
But when I choose Swedish language pack it shows
http://www.gems4u.se/store/-c-25/
Any idea how do I fix URLS for Swedish language?
What version of Zen Cart do you have installed?
What version of Ultimate URLs do you have installed?
What is in the Zen Cart debug logs?
What is in any configured PHP error logs (or server error logs)?
If using Zen Cart 1.5+, can you verified the "Swedish" language pack you installed uses "UTF-8" as the character encoding and character set (language files, database, and Zen Cart configuration)? If any of these do not match, they could be the source of your issues...
Thanks for the reply. I have version 1.5.1 installed. I actually upgraded zen cart from version 1.3.8. So what do you suggest I should change the charset as well?
my zencart version 1.5.1 japanese
web server: nginx
I have zencart 1.39h and zencart 1.5.1 both on my web server, 1.39h used the old version of Ultimate SEO, 1.5.1 used the Ultimate SEO final version. so how to write the rewrite rule in nginx, it can make them both work, thanks very much
A quick search of this thread (click on search thread) reveals: this post.
Hi Everyone
I have ultimate seo urls installed and working for the most part just fine.
I have one small issue
In my featured sideboxes and special sideboxes the add to cart button is producing the following URL structrure
http://www.avinstalls.co.uk/future-a...s_id=7&sort=2a
This url works however the question mark at the end of the product URL should be a & mark not a ? I believe that this is causing soft 404
Can anyone point me in the right direction I have de installed this mod and indeed zencart reverts to using the & instead of a ? so by the process of elimination it is definitely something to do with this mod.
Any help would be greatly appreciated perhaps there is something in the HTML output file that needs tweaking.
Many Thanks
Please explain why you think the question mark should be an ampersand. See RFC 3986 for details on how URLs are constructed.
Zen Cart uses something similar to "http://www.avinstalls.co.uk/index.php?main_page=product_info&products_id=26&action=buy_now&alpha_filter_id=84&filter_i d=39&language=en&manufacturers_id=7&sort=2a".
Ultimate URLs uses something similar to "http://www.avinstalls.co.uk/future-automation-ceiling-tv-lift-mechanism-ch6-p-76.html?action=buy_now&alpha_filter_id=84&filter_id=39&language=en&manufacturers_id=7&so rt=2a"
Note the presence of a question mark is used to indicate the start of the "query" by both. This follows RFC 3986:Most likely the actual cause your site is configured to issue a 302 redirect to another page (shopping cart) when a visitor "follows" that link. When multiple DIFFERENT links all redirect to the same page (and the page specifies the meta tag for "noindex"), some Search Engines may assume the links are for pages which do not exist and treat them as a 404 (and label them as soft 404s).Code:URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
Have you tried adjusted your settings in webmaster tools (or robots.txt) to indicate URLs containing the query parameter "action=buy_now" should be excluded from being followed? Or adding a "nofollow" to the link? Or changing the "link" to a website form (such as the product pages use)?
Hello,
I recently upgraded to the version 2.121. Is there any way to show the url only in the default language (English) even for the other language pages?
I run Zen Cart 1.3.9h in both English & Japanese with PHP 5.2.17 & MySQL 5.0.95. Any feedback would be appreciated.
Thank you,
Hi Ihungil
Many thanks for your response makes allot of sense thanks for shedding some more light on this problem.
I would like to try excluding them using robots text but I cant seem to find any resources to help me write something to exclude the query parameter "action=buy_now"
sorry to be a pain but could you assists or point me in the right direction.
Regards
Boyd
Hi Ihungil
Many thanks for your response it makes sense.
Have you tried adjusted your settings in webmaster tools (or robots.txt) to indicate URLs containing the query parameter "action=buy_now" should be excluded from being followed? Or adding a "nofollow" to the link? Or changing the "link" to a website form (such as the product pages use)?
I have had a look online to see how to exclude the the query parameter "action=buy_now" in the robots txt file but cant seem to find any help there I would also like to try adding a nofollow to the link but again sorry to say not sure where to start, any help or a point in the right direction would be greatly appreciated.
regards
Boyd
Adjust to fit your needs:
Code:User-agent: *
Crawl-delay: 30
Disallow: /cgi-bin/
Disallow: /*action=buy_now
Disallow: /editors/
Hi Ihungil
I got a bit problem on the Add to Cart button on All Products, New Products and Featured Products pages.
The original link is domain/index.php?main_page=products_all&disp_order=x&action=buy_now&products_id=xxxx.
It suppose to be rewrited as: domain/products_all.html?action=buy_now&products_id=xxxx&disp_order=6.
However, it was rewrited as: domain/(product name)-p-(products_id).html?action=buy_now&disp_order=6.
I thank it come from the function href_link(), but I don't know how to modify. Please help.
Thanks
When click it, the product was added to shopping cart and the current page was redirected to 404 page.
If the Ultimate SEO was turn off, the button works fine.
The code locate on \templates\tpl_modules_products_all_listing.php (about line 90)
I made a bit modification like belowPHP Code:
if (PRODUCT_ALL_LISTING_MULTIPLE_ADD_TO_CART > 0 && $products_all->fields['products_qty_box_status'] != 0) {
// $how_many++;
$link = TEXT_PRODUCT_ALL_LISTING_MULTIPLE_ADD_TO_CART . "<input type=\"text\" name=\"products_id[" . $products_all->fields['products_id'] . "]\" value=\"0\" size=\"4\" />";
} else {
$link = '<a href="' . zen_href_link(FILENAME_PRODUCTS_ALL, zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_all->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT) . '</a> ';
}
}
The $a issued domain/products_all.html?disp_order=6.PHP Code:
if (PRODUCT_ALL_LISTING_MULTIPLE_ADD_TO_CART > 0 && $products_all->fields['products_qty_box_status'] != 0) {
// $how_many++;
$link = TEXT_PRODUCT_ALL_LISTING_MULTIPLE_ADD_TO_CART . "<input type=\"text\" name=\"products_id[" . $products_all->fields['products_id'] . "]\" value=\"0\" size=\"4\" />";
} else {
$a = zen_href_link(FILENAME_PRODUCTS_ALL, zen_get_all_get_params(array('action')));
$b = zen_href_link(FILENAME_PRODUCTS_ALL, zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_all->fields['products_id']);
echo "$a <br />$b<br />";
$link = '<a href="' . zen_href_link(FILENAME_PRODUCTS_ALL, zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_all->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT) . '</a> ';
}
}
The $b issued domain/(product name)-p-(products_id).html?action=buy_now&disp_order=6.
I think that the products_id trigger the Ultimate SEO.
I try to add a currency update form in product_info display page, but after redirect, the URL back to dynamic, why?
the url for product page on my server is correct, even the form action url has not prblem.
which is :
before form submit:
http://temp.local/test-examples-c-23/test-120-p-84.html
form action url in view html mode:
http://temp.local/test-examples-c-23/test-120-p-84.html
after form submit
http://temp.local/index.php?main_pag...id=84&cPath=23
form code:
<?php echo zen_draw_form('currencies_form_header', zen_href_link(zen_get_info_page($products_id), 'cPath=' . $cPath . '&products_id=' . $products_id, $request_type), 'get');
echo zen_draw_hidden_field('main_page','product_info');
echo zen_draw_hidden_field('cPath',$cPath);
echo zen_draw_hidden_field('products_id',$'products_id);
echo zen_draw_pull_down_menu('currency', $currencies_array, $_SESSION['currency'], 'onchange="this.form.submit();"') . zen_hide_session_id().'</form>';
?>
after submited and the page reload as:
http://test.local/index.php?main_pag...d=18&cPath=1_2
where is the problem? i test ultimate seo 2.101 on another test site, that version is good.
which is :
before form submit:
http://temp.local/test-examples-c-23/test-120-p-84.html
after form submited
http://temp.local/test-examples-c-23/test-120-p-84.html
Background (why):
Because the Zen Cart code for currencies issues the redirect (instead of silently handling the request and continuing to display the requested page). The redirect you are seeing is NOT part of Ultimate URLs.
The Zen Cart currencies code is loaded at breakpoint 90.
The Zen Cart language code is loaded at breakpoint 110.
The Ultimate URLs code is loaded at breakpoint 120.
So basically the code handling the "currency change" occurs before Zen Cart has loaded any language information (needed to read the product name, category name, manufacturer name, etc)... So when it constructs the URL, "stock" Zen Cart URLs are used because the language information is not available.
Thoughts:
Can I ask what problem you believe is caused by the stock Zen Cart URL being shown in the address bar only after selecting a dropdown from a form?
If it REALLY bothers you to see the Zen Cart "default" URLs in the address bar... You can simply turn on "automatic redirects" in the Ultimate URLs settings (automatic redirects are not enabled by default). When enabled, requests for a different URL from the canonical URL will trigger a 301 redirect to the canonical URL.
NOTE: When a browser (or search engine) visit the page using a "stock" Zen Cart URL, the canonical link will contain the URL as generated by Ultimate URLs. This holds true no matter what is shown in the web browser's address bar.
thanks for your answer. Now i know there is no way for seo to fix the problem as languages/currency handle the redirect before seo url.
as your mentioned, "automatic redirects" does FIX the url! however, some new problems come....
I used "Multilanguage Ultimate SEO" in plugin area, which is based on your mod plus some fixes for language prefix, for eample, http://test.local/en/.... for english, http://test.local/fr/.... for french, etc.
It was working except the currency code i mention above. however, after i enable the "auto redirect", all url change from http://test.local/en/xxxxx-p-id.html to http://test.local/xxxxx-p-id.html?languages_id=1, even the http://test.local/shopping_cart.html becomes http://test.local/shopping_cart.html?languages_id=1
can you tell me what is problem and which code handle this, i am trying to figure out how to fix it....
Please ask in the "multilanguage" mod... I do not support the changes made by that module...
If I was forced to guess, I'd venture the other module (or your merge) does not correctly alter the URL generation as per your desired URL. The "auto redirect" in this version of Ultimate URLs simply calls href_link to determine the final URL.
May also be worth reading the past comments in this thread in regards to the 3rd party module you mention.
One parameter (disp_order=x) was introduced into the link. Is this parameter that interrupts the rewrite rule?
Probably not. I'm out of town at the moment. If you can send me a link to the example page (want to see all of the HTTP codes), I'll take a look when I get back. Feek free to send in a PM (so I do not forget).
Hi
I have zen cart 1.5.1 installed on a subdomain. Ultimate seo urls Version: 2.212 is installed. All looks good except for in admin in the top navigation bar, the link to "Online Catalog" is not working correctly. It opens to
http://testsite.mywebsite.com/.html
As expected it opens to a 403 page. Any ideas what to do about this problem? The .htaccess is the one supplied with the module and only the RewriteBase changed from /shop/ to /. Nothing else has been altered in the file.
When I turn off the seo module the problem goes away and the link opens to the shop.
Other modules installed so far:
quick updates
stock by attributes
easy populate
backup mysql
theme forest exodus template
Just to rule out the template I switched to classic and it made no difference
thanks
First comment out the line containing RewriteBase (add a # as the first character on that line). This line is not needed when Zen Cart is installed in the web server's root directory.
Second open up "/admin/includes/header.php" and edit the link for the "online catalog" to use "HTTP_CATALOG_SERVER . DIR_WS_CATALOG" for the href attribute.
There is a good chance this change will be present in v160 of Zen Cart.
perfect! That fixed it. Thank you :-)
Hi,
I've been using your plugin with zencart 1.5.0 for some time now.
Somthing seems to be wrong though as loading times skyrocket with the plugin enabled.
After some digging I discovered it generates almost 30000 queries per page load.
Disabling the plugin reduces amount of queries to about 211.
I proceeded to try various combinations of caching settings, but nothing helped so far.
Do you have any idea as to why the plugin generates this many sql queries?
url: www dot coins-stamps-rotterdam dot nl
Not sure why you are seeing so many queries. I've rarely seen a request with the latest stable release of Ultimate URLs exceed an average of 150 additional queries (with Ultimate URL enabled and the caches disabled).
One of the times I've seen a massive number of additional queries, a page existed with a massive number of internal links to different products, categories, ez-pages, and manufacturers. Usually in this case enabling the individual caches reduces these requests (unless the host does not allow PHP eval()).
Another time I've seen a massive number of additional queries, the root cause was a problem with the database. Once the database server was out of memory (poor server management) and in the other case the server was having issues with data corruption (server hardware replaced to fix). This case also required running a repair of the SQL tables after the hosting provider corrected the server issues.
Another time the problem, something was missed (or incorrectly merged) when installing the module. This caused Zen Cart to issue duplicate queries attempting to retrieve data.
I'd be very interested to know what is causing the enormous number of extra queries in your hosting environment. Is it every page? One specific page? Anything in the Zen Cart debug logs? Answers to the other questions in the "Posting Tips"? Can you provide more details on the server environment?
The global USU cache
Saves "name" results in memory for the current web request.
- Check if name is already in memory. Return the name if cached.
- If not cached, issue one SQL query per name needed. Cache the name(s) in memory. Return the name.
The individual USU caches (products, categories, mfgs, ez-pages)
Saves "name" results in memory for the current web request.
Additionally saves "name" results using database storage.
On startup (once per page request).
- If cached copy exists in the database and has expired, delete from the database.
- If cached copy exists in the database and has not expired, load into memory.
- If not cached in the database, run one SQL query to load all names, save into database and memory.
Zen Cart 1.5.1+ (data_diggers) memory query cache
Stores SELECT queries in a memory cache. Greatly reduces the number of queries run against the database by Zen Cart (in general). Will be used by this module if present (and most the caching done by USU internally is not needed when this is present / enabled).
The Zen Cart persistent SQL cache
Saves SQL queries according to configure settings. When enabled, this will be used by Ultimate URLs to cache all SQL queries for 43200 seconds (or 12 hours). This cache cannot be reset inside Ultimate URLs and is independent. If your hosting provider limits the number of SQL queries (or throttles them) and you cannot move to a better hosting provider, enabling this in Zen Cart 1.5+ w/ file based caching can help... But keep in mind a file lookup is usually more expensive than a database lookup (and will typically be slower).
I have a file in the store root (Zen Cart is in the 'store' directory, just to confirm) that needs to not be rewritten but is being rewritten. The file is: ShippingZZencart.php from stamps.com
I thought the last lines of the htaccess were to prevent rewriting real files but they don't seem to be. This is the htaccess file contents.
###############################################################################
# Common directives
###############################################################################
# NOTE: Replace /shop/ with the relative web path of your catalog in the "Rewrite Base" line below:
Options +FollowSymLinks
RewriteEngine on
RewriteBase /store/
###############################################################################
# Start Ultimate SEO URLs
###############################################################################
# Handles the new URL formats
RewriteRule ^(.*)-c-([0-9_]+)/(.*)-p-([0-9]+)(.*)$ index\.php?main_page=product_info&products_id=$4&cPath=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-c-([0-9_]+)/(.*)-pi-([0-9]+)(.*)$ index\.php?main_page=popup_image&pID=$4&cPath=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-c-([0-9_]+)/(.*)-pr-([0-9]+)(.*)$ index\.php?main_page=product_reviews&products_id=$4&cPath=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-c-([0-9_]+)/(.*)-pri-([0-9]+)(.*)$ index\.php?main_page=product_reviews_info&products_id=$4&cPath=$2&%{QUERY_STRING } [L]
# Original (unchanged) URL formats
RewriteRule ^(.*)-p-([0-9]+)(.*)$ index\.php?main_page=product_info&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-m-([0-9]+)(.*)$ index\.php?main_page=index&manufacturers_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pi-([0-9]+)(.*)$ index\.php?main_page=popup_image&pID=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pr-([0-9]+)(.*)$ index\.php?main_page=product_reviews&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pri-([0-9]+)(.*)$ index\.php?main_page=product_reviews_info&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-ezp-([0-9]+)(.*)$ index\.php?main_page=page&id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-c-([0-9_]+)(.*)$ index\.php?main_page=index&cPath=$2&%{QUERY_STRING} [L]
# All other pages
# Don't rewrite real files or directories
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index\.php?main_page=$1&%{QUERY_STRING} [L]
I would guess the 3rd party module you installed is not integrated as a Zen Cart page, yet calls Zen Cart's application_top.
If the "guess" is correct, This is a known issue with certain 3rd party modules. The fix is for the 3rd party modules to correctly implement their new "page" (URL) as an actual Zen Cart page (instead of trying to cherry pick).
One workaround is to disable "automatic redirects" for Ultimate URLs. Another is to manually edit the "automatic redirect" code to ignore the URL.
Feel free to SEARCH this thread (if the guess above is correct) as I have previously posted the workarounds for handling these problematic 3rd party modules.
I am contemplating converting my client from Ceon URI Mapping to Ultimate SEO
What do I need to do so that the current URIs aren't sent to 404 purgatory?? I looked through this thread, and didn't see anything that provides a "how-to" or a "checklist" when converting from one module to another.. Any tips on the conversion from one module to another??
DivaVocals, your latest code fixed the Create Account Default Country ID issue, but doesn't fix the issue with Ultimate URLs. I don't see a reason why this plugin needs to use the use_function column the way that it is. The author may want to see how we make fields in Numinix mods and follow that pattern.
If anyone is interested in testing a beta update of this plugin for Zen Cart 1.5.3, please PM me.
This plugin already works in 1.5.3. I also have an updated version close to release.
This does work on 1.5.0 version but stop some other modules to work like
Order Question
Mailhive
It does not let open file in root for any module as soon as I turn it off from admin all these modules files in root are accessible and modules work fine.
I removed/make changes in .htaccess but it did not resolve problem.
Another problem after installing this module: getting session timeout very often/ page not found when tried to login from timeout session page.
Any idea how to get these fixed?
Why following have index in this?
Enter pages to allow rewrite
index, product_info, products_new, products_all, featured_products, specials, contact_us, conditions, privacy, reviews, shippinginfo, faqs_all, site_map, gv_faq, discount_coupon, page, page_2, page_3, page_4
I removed index from there and it solved my issue. Will this cause any other issue?
Hi lhungil
There are two files included in v212 and disappeared in v215: admin\includes\functions\general.php and \includes\classes\db\mysql\query_factory.php. Do I need delete the codes added by the v212 in those two files?
In readme file, you mentioned "Plugin Manager". What is it and where to get it?
Another suggestion: embedding links in readme file. Example: fix the Numinex changes, without a link, user should go through the thread to make sure to find right info.
@jsarwar. I do not use those 3rd party "modules". My guess based upon your comments is those 3rd party modules have "standalone" files in the store root and partially load portions of Zen Cart instead of fully integrating with Zen Cart. You may wish to review the other posts in this thread about dealing with 3rd party modules not written as Zen Cart pages which call the internal application_top code in Zen Cart.
@su35
v2.12 is the latest "stable" release. This thread is for officially supported stable releases only.
Hi lhungil,
Why following have index in this?
Enter pages to allow rewrite
index, product_info, products_new, products_all, featured_products, specials, contact_us, conditions, privacy, reviews, shippinginfo, faqs_all, site_map, gv_faq, discount_coupon, page, page_2, page_3, page_4
I removed index from there and it solved my issue. Will this cause any other issue?
How the "pages to rewrite" setting works is clearly documented in the module and also in this thread. The answer you seek can be found in those materials.
Well, I have been reading through forum all day yesterday and have tried all suggested changes in rewrite rule but it did not work.
I was also getting "Session time out" and page not found error very often. For example if customer change shipping method on checkout they get time out page and if they click on login they get page not found error.
Last night I removed index from that list and it solved both problems. All root files are working and no "Time out/page not found" issue.
But I see now categories does not open with url.html
In .htaccess I have all rules which came with module.
A Quick Search reveal the following: application_top.php Ultimate URLs.
When you look at a "stock" Zen Cart URL you will notice "?main_page=xxxx" The "xxxx" is the name of the Zen Cart page. So when you tell Ultimate URLs to not modify any URLs for Zen Cart "index" pages... The result is those pages will not have altered URLs (including category, manufacturers, etc).
There were no suggested changes to make to rewrite rules. Any mistakes made while altering the .htaccess file will result in not only 404 / Page Not Found errors, but may also cause other issues.
Most likely unrelated to anything in this module. This module does not do anything which impacts "sessions".
NOTE: "Order Question" is not listed as compatible with Zen Cart 1.3.9h or Zen Cart 1.5.x. Both the modules you mention call core Zen Cart code (application_top.php) while not fulling integrating as Zen Cart pages (main_page=xxx). Two potential workarounds have been listed more than once in this thread.
Link you post if not working. I tried Product_listing but it did not work for categories pages.
Changes I was referring to are mentioned in forum. e.g. Rewrite rule base etc.
First I removed index which fix all issues except categories url were not in .html format then I worked more and found out everything works fine if I turn off enable redirects...
There are no places in THIS thread where it says change the rewrite rules to workaround issues with 3rd party modules. And none mentioning making such a change to fix issue with 3rd party code placed in the root (instead of written as a Zen Cart page) which calls application_top.php. And definitely none posted by the current maintainer suggesting such changes would fix the problem at hand.
Which you would have found had you done a basic search. Disabling "automatic redirects" is one of the two suggested workarounds for handling 3rd party code placed in the root (instead of written as a Zen Cart page) which calls application_top.php.
I am glad you found the correct solution and thank you for letting us know one of the suggested workarounds does in fact correct the issues you were experiencing.
Has any one used this on the Zen Cart 1.5.3?
Thanks and sorry I missed that!
Hi Bro
I got blank page and error after upgrading last update ultimate seo
I get this massage :
PHP Fatal error: Call to undefined function zen_get_ip_address() in /home/busaxcom/public_html/shop/includes/init_includes/init_sessions.php on line 34
what should i do ? :huh:
Check your installation to be sure all files are in the right place. That error usually means a missing file. What version of Zen Cart do you have?
Line 34 of the file "/includes/init_sessions.php" from a stock Zen Cart 1.3.9h+ installation does not call to "zen_get_ip_address()"... Ultimate URLs does not modify this core Zen Cart file either...
Best guesses as to the cause are:
- You are not running Zen Cart 1.3.9h or newer.
- Other 3rd party modifications to Zen Cart have broken things (modified init_sessions.php, etc).
- Files in your Zen Cart installation are corrupt (or from mixed versions of Zen Cart).
- The installation was not completed correctly / fully (missing files, files placed in the wrong places, "backup" copies of files left in folders, incorrect merges of core files, steps missed, etc).
If replying, please respond with answers to the questions in the "Posting Tips". Also include the previous version of Ultimate SEO URLs you are trying to "upgrade" (and what version you want installed).