hydro Posted June 6, 2007 Share Posted June 6, 2007 Ok put the original seo_products.php back then just change the query in the generate_name function only. So to bring up models instead of product names change the function: from function generate_name($products_id) { global $languages_id; $name = ''; $name_query = tep_db_query("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$products_id . "' and language_id = '" . (int)$languages_id . "'"); if( $names_array = tep_db_fetch_array($name_query) ) { $name = $names_array['products_name']; $name = $this->create_safe_string($name); } return $name; } to function generate_name($products_id) { global $languages_id; $name = ''; $name_query = tep_db_query("select products_model from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'"); if( $names_array = tep_db_fetch_array($name_query) ) { $name = $names_array['products_model']; $name = $this->create_safe_string($name); } return $name; } Don't change the validation queries. Just the above change should be enough. Thanks. I got that to work. However, if I turn the Auto-Name Builder on, for newly added products it automatically generate names based on the products_name instead of products_model. How can I get it to auto generate name based on the Products_model as well? Second Question: I have a link to a pdf file, but clicking on that redirects me to the cookie-usage.php file instead. Why is that? Also occasionally I get the cookie-usage page and refreshing the page again and it goes away. Why? Third, from SEO point of view, probably using the Products_name will do better in search engine, but since it gives a long string, it look suspicious / spammy and thus discourage people from clicking it. What do you guys think? For example, are you more likely to click on Fujitsu-max3735nc.htm or fujitsu_max3735nc_73gb_15000rpm_ultra320_scsi_hard_drive.htm (possibly longer) Sorry for all the questions and thank you for your answers. Quote Link to comment Share on other sites More sharing options...
Guest Posted June 6, 2007 Share Posted June 6, 2007 (edited) Would you also consider adding a select all in the controller section? It might be convenient in cases where there are hundreds of products or categories and rather than having to check each product or category to insert, just select all. it's already there, use the "Select" header (hover the mouse over it to see what it says). There is a jscript function that supports it. I would recommend spending a bit of time reading the documentation to familiarize yourself with the SEO-G features. Edited June 6, 2007 by enigma1 Quote Link to comment Share on other sites More sharing options...
Guest Posted June 6, 2007 Share Posted June 6, 2007 (edited) Thanks. I got that to work. However, if I turn the Auto-Name Builder on, for newly added products it automatically generate names based on the products_name instead of products_model. How can I get it to auto generate name based on the Products_model as well? You need to implement the same changes on the seo_url.php on the catalog end under the auto_builder function Second Question: I have a link to a pdf file, but clicking on that redirects me to the cookie-usage.php file instead. Why is that? Also occasionally I get the cookie-usage page and refreshing the page again and it goes away. Why? I don't know because I do not see it here. You need to be specific, like posting a url to a failing page. If you have custom features you should know the necessary integration steps and undestand how each module works Third, from SEO point of view, probably using the Products_name will do better in search engine, but since it gives a long string, it look suspicious / spammy and thus discourage people from clicking it. What do you guys think? For example, are you more likely to click on Fujitsu-max3735nc.htm or fujitsu_max3735nc_73gb_15000rpm_ultra320_scsi_hard_drive.htm (possibly longer) This behavior is controlled by the "linkage" options. See the documentation about it. You can have short links with the products name only. Edited June 6, 2007 by enigma1 Quote Link to comment Share on other sites More sharing options...
beano Posted June 6, 2007 Share Posted June 6, 2007 Huh? There's documentation?? :huh: Quote Link to comment Share on other sites More sharing options...
Guest Posted June 6, 2007 Share Posted June 6, 2007 Huh? There's documentation?? :huh: From the readme.htm On the first screen (main-level) a list of supported types represented by the various class scripts appears. Select Manufacturers click "Details". On the new screen (the sub-level) click the manufacturers button. Select all manufacturers from the "select" header hit "Insert" to generate the manufacturers names. Go back to the main level select the categories. Click "Details" and on the new screen click the categories button. Select all categories from the "select" header, hit "Insert" to generate the categories names. Repeat the same procedure for the products. Again click the "Categories" button and select all categories. All products will be inserted. A separate filter mechanism for products within a category is also provided for development purposes. is there a point to re-post the document here? Quote Link to comment Share on other sites More sharing options...
mzollmann Posted June 6, 2007 Share Posted June 6, 2007 First I would like to say thank you for the contribution. I have installed this to my dev site and everything seems to have merged nicely. But when I go to the main site it will render the main page and all of the links that SEO-G generates are showing up correctly. But if I click on any .html link it throws a 404 file not found error. I believe that it is not redirecting it to the osC url, I have checked and double checked the .htaccess file and all seems to be in order. I believe the contrib is working correctly, when I pull up a report it shows all the generated links for the main page. Has anyone else run into this? Kind of at a loss on where to look at next. TIA Z Quote Link to comment Share on other sites More sharing options...
mrbill Posted June 6, 2007 Share Posted June 6, 2007 Hello All, osC details osCommerce 2.2-MS2 PHP Version: 4.3.8 (Zend: 1.3.0) Apache Release 10331100 MySQL 4.0.27-standard Problem The oddest thing happens when I hit refresh or occasionally when I hit a category link. I am taken to the login page rather than the page I was on or wanted to go to via the link. Any ideas how to fix this or a clue why it might be acting this way? More info: the links are correctly assigning the name of the proper page, example CAT.html for CAT category as well as the CAT_brown.html for the BROWN CAT contained in the CAT category. But if I click the link to the CAT_brown.html I am taken to login.html instead. Quote osC details osCommerce 2.2-MS2 PHP Version: 4.3.8 (Zend: 1.3.0) Apache Release 10331100 MySQL 4.0.27-standard Link to comment Share on other sites More sharing options...
mrbill Posted June 6, 2007 Share Posted June 6, 2007 In addition to the above post from me - I also noticed that my PRODUCT REVIEW pages are not always getting picked up with and without reviews being contained. By that I mean the pages are not automatically being created with http://domain/product_reviews_CAT-BROWN.html. The page just goes back to the product page at http://domain/CAT-BROWN.html or the next click or refresh will take me to LOGIN.html again and not the product itself or the review of the product. Quote osC details osCommerce 2.2-MS2 PHP Version: 4.3.8 (Zend: 1.3.0) Apache Release 10331100 MySQL 4.0.27-standard Link to comment Share on other sites More sharing options...
Guest Posted June 6, 2007 Share Posted June 6, 2007 First I would like to say thank you for the contribution. I have installed this to my dev site and everything seems to have merged nicely. But when I go to the main site it will render the main page and all of the links that SEO-G generates are showing up correctly. But if I click on any .html link it throws a 404 file not found error. I believe that it is not redirecting it to the osC url, I have checked and double checked the .htaccess file and all seems to be in order. I believe the contrib is working correctly, when I pull up a report it shows all the generated links for the main page. Has anyone else run into this? Kind of at a loss on where to look at next. TIA Z see posts #248, #252 in this thread. Make sure you did the changes in .htaccess Quote Link to comment Share on other sites More sharing options...
Guest Posted June 6, 2007 Share Posted June 6, 2007 In addition to the above post from me - I also noticed that my PRODUCT REVIEW pages are not always getting picked up with and without reviews being contained. By that I mean the pages are not automatically being created with http://domain/product_reviews_CAT-BROWN.html. The page just goes back to the product page at http://domain/CAT-BROWN.html or the next click or refresh will take me to LOGIN.html again and not the product itself or the review of the product. post a url to the reviews page that has the problem, this happens if your configure.php is not setup correctly (or if you do not have the proper secondary handlers setup for the products under G-Types. Quote Link to comment Share on other sites More sharing options...
rizzy Posted June 6, 2007 Share Posted June 6, 2007 I am sure it is something simple and stupid, but I just installed this and I am getting this: 1146 - Table 'table_osc.TABLE_SEO_URL' doesn't exist select seo_url_get from TABLE_SEO_URL where seo_url_org = 'http://domain.com/osc/index.php' The tables is in the database so I don't know why it is saying this? Any general ideas thoughts? Quote Link to comment Share on other sites More sharing options...
Guest Posted June 7, 2007 Share Posted June 7, 2007 (edited) I am sure it is something simple and stupid, but I just installed this and I am getting this:The tables is in the database so I don't know why it is saying this? Any general ideas thoughts? make sure you did items 2 and 6 from the documentation. Recheck the installtion instructions Edited June 7, 2007 by enigma1 Quote Link to comment Share on other sites More sharing options...
mzollmann Posted June 7, 2007 Share Posted June 7, 2007 see posts #248, #252 in this thread. Make sure you did the changes in .htaccess Thanks for the response enigma1. My problem was that I did not have the mod_rewrite module enabled in Apache. Once I enabled it everything works perfectly. Thank you for putting me on the right track. Again thanks for a great contribution. Z Quote Link to comment Share on other sites More sharing options...
davetarmac Posted June 7, 2007 Share Posted June 7, 2007 is that local? if not post a direct link to the product to see the problem. I have sent you a PM with the link in. Thank you. Quote Link to comment Share on other sites More sharing options...
tyveris Posted June 7, 2007 Share Posted June 7, 2007 Hello, i have a problem now with the contribution. Normally it works great. But if i want to start elm@r i get an error: Fatal error: Call to a member function on a non-object in /var/www/vhost/damrotech/includes/functions/html_output.php on line 74 Here is line 73 to 75: //-MS- SEO-G Added $link = $g_seo_url->get_seo_url($link, $separator); //-MS- SEO-G Added EOM I have enabled in elm@r the define('ELMAR_SEO_URLS', true); but it dont work. Every time the same error. I have also excluded the file in the admin section of seo-g but with nor result. Same error. Can anybody help me ? The contribution is working great, and i have no problems bevor ... Thanks. Tyv Quote Link to comment Share on other sites More sharing options...
tyveris Posted June 7, 2007 Share Posted June 7, 2007 Hello, i have a problem now with the contribution. Normally it works great. But if i want to start elm@r i get an error: Fatal error: Call to a member function on a non-object in /var/www/vhost/damrotech/includes/functions/html_output.php on line 74 Here is line 73 to 75: //-MS- SEO-G Added $link = $g_seo_url->get_seo_url($link, $separator); //-MS- SEO-G Added EOM I have enabled in elm@r the define('ELMAR_SEO_URLS', true); but it dont work. Every time the same error. I have also excluded the file in the admin section of seo-g but with nor result. Same error. Can anybody help me ? The contribution is working great, and i have no problems bevor ... Thanks. Tyv So, i found a new problem ^^ I see some error messages in m ylog files like this: apache2: PHP Fatal error: main(): Failed opening required 'ipn.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/vhost/damrotech/root.php on line 146 This "ipn.php" is a file from the PayPalIPN Module. Now i see PayPal cant "call" back to the server and confirm the order. I think this is a greater problem for someone (we use other software to verify) The root.php says on line 146: // Signal SEO-G translation. $g_seo_flag = true; require(basename($PHP_SELF)); } elseif( file_exists(basename($osc_parse['path']))) { $PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF'] = $_SERVER['PHP_SELF'] = $_SERVER['SCRIPT_NAME'] = $osc_parse['path']; if(basename($_SERVER['PHP_SELF']) == 'root.php' ) { echo '<b>SEO-G Error</b>: Invalid Self-Request, passed URI Request: ' . $_SERVER['REQUEST_URI']; exit(); } in " if( $g_seo_url->get_osc_url($g_server . $_SERVER['REQUEST_URI'], $osc_url, $osc_params, $osc_parse) ) {" Hope the problem isnt big and we can solve it. Tyv Quote Link to comment Share on other sites More sharing options...
Guest Posted June 7, 2007 Share Posted June 7, 2007 I have sent you a PM with the link in. Thank you. Did you mess the secondary handlers in the G-Types page? Make sure they're present. Because the reviews button for the "Matrix" does not show the secondary handler with the URL. Setup the secondary handlers properly and clear the reports. Currently you have: /dvd-movies/action-dvd/the-matrix.html for product /dvd-movies/action-dvd/the-matrix.html for reviews Quote Link to comment Share on other sites More sharing options...
davetarmac Posted June 7, 2007 Share Posted June 7, 2007 Did you mess the secondary handlers in the G-Types page? Make sure they're present. Because the reviews button for the "Matrix" does not show the secondary handler with the URL. Setup the secondary handlers properly and clear the reports. Currently you have: /dvd-movies/action-dvd/the-matrix.html for product /dvd-movies/action-dvd/the-matrix.html for reviews Everything in the G-Types handlers is default: categories - handler: <none> - class:seo_categories.php products - handler:product_reviews.php, product_reviews_write.php, product_reviews_info.php - class:seo_products.php manufacturers - handler: <none> - class:seo_manufacturers.php strict validation is off, again, as default. Quote Link to comment Share on other sites More sharing options...
Guest Posted June 7, 2007 Share Posted June 7, 2007 (edited) So, i found a new problem ^^I see some error messages in m ylog files like this: apache2: PHP Fatal error: main(): Failed opening required 'ipn.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/vhost/damrotech/root.php on line 146 This "ipn.php" is a file from the PayPalIPN Module. Now i see PayPal cant "call" back to the server and confirm the order. I think this is a greater problem for someone (we use other software to verify) Hope the problem isnt big and we can solve it. Tyv Ok, for the ipn.php I don't know the file you're using but in general any php file in your store that is called separately (ie is not part of the osc framework) and has a visible link (ie it goes through the tep_href_link function) you place it in the exclusion list so SEO-G does not tranlate it. Because such files may not include the application_top.php file. So goto osC Admin->SEO-G->G-Exclude and add the ipn.php in it. See if that works. (I will make a note in the documentation for the next version about this). For elmar ask stefan for details (post in the elmar support forum), I do not know how the module works I briefly checked the files and seems it parses server parameters that perhaps SEO-G does not rectify. The problem I have is the description is not in English so I am having a hard-time understanding the code flow. Edited June 7, 2007 by enigma1 Quote Link to comment Share on other sites More sharing options...
Guest Posted June 7, 2007 Share Posted June 7, 2007 Everything in the G-Types handlers is default:categories - handler: <none> - class:seo_categories.php products - handler:product_reviews.php, product_reviews_write.php, product_reviews_info.php - class:seo_products.php manufacturers - handler: <none> - class:seo_manufacturers.php strict validation is off, again, as default. the secondary handlers represent real files they are not just names. If it's like that why your reviews show: /oscomm/reviews.html So looks to me you have a reviews.php instead of product_reviews.php? Why is that? Quote Link to comment Share on other sites More sharing options...
davetarmac Posted June 7, 2007 Share Posted June 7, 2007 the secondary handlers represent real files they are not just names. If it's like that why your reviews show:/oscomm/reviews.html So looks to me you have a reviews.php instead of product_reviews.php? Why is that? I haven't a clue why it is doing that, but if you do: oscomm/product_reviews.php oscomm/reviews.php oscomm/product_reviews.html oscomm/reviews.html they all take you to the same page, reviews.html I have both reviews.php and product_reviews.php. Is there a setting I could put in to the SEO-G Types to fix this? Or even anything at all? Quote Link to comment Share on other sites More sharing options...
Guest Posted June 7, 2007 Share Posted June 7, 2007 I haven't a clue why it is doing that, but if you do:oscomm/product_reviews.php oscomm/reviews.php oscomm/product_reviews.html oscomm/reviews.html they all take you to the same page, reviews.html I have both reviews.php and product_reviews.php. Is there a setting I could put in to the SEO-G Types to fix this? Or even anything at all? Ok took me a little while to replicate it, so there is a problem. Functions set_id, set_path, translate_params must change. Now this issue did not occur when I used the flat structure for links generation but I was able to see it with the dir structure. All changes are for the catalog\includes\classes\seo_url.php 1. In translate_params function Use this section for the page case instead of the old one case 'page': if( isset($flags_array['page']) || !tep_not_null($inner[1]) ) break; if( !is_numeric($inner[1]) ) { return 2; } $handler = ''; if( !$this->handler_flag && count($flags_array) == 1 ) { $handler = str_replace('.php', SEO_DEFAULT_INNER_SEPARATOR, $this->path); $this->handler_flag = true; } $seo_params_array[$handler . 'p' . $inner[1]] = '99' . '_' . '-1'; $flags_array['page'] = $inner[1]; break; 2. replace set_id function use this instead: function set_id($query_raw, &$seo_params_array) { $result = $handler = false; $params_query = tep_db_query($query_raw); if( $entry = tep_db_fetch_array($params_query) ) { if( tep_not_null($entry['seo_types_handler']) ) { $handler_array = explode(',', $entry['seo_types_handler']); foreach($handler_array as $key => $value ) { $value = trim($value); if( $this->path == $value ) { $handler = $value; break; } } } if( $handler && !$this->handler_flag) { $handler = str_replace('.php', SEO_DEFAULT_INNER_SEPARATOR, $handler); $seo_params_array[$handler . $entry['seo_name']] = $entry['sort_order'] . '_' . $entry['seo_types_linkage']; $this->handler_flag = true; } else { $seo_params_array[$entry['seo_types_prefix'] . $entry['seo_name']] = $entry['sort_order'] . '_' . $entry['seo_types_linkage']; } $result = true; } return $result; } 3. replace set_path function use this: function set_path($query_raw, &$tmp_array, &$depth, &$sort_order) { $result = $handler = false; $params_query = tep_db_query($query_raw); if( $entry = tep_db_fetch_array($params_query) ) { if( !$depth ) { if( tep_not_null($entry['seo_types_handler']) ) { $handler_array = explode(',', $entry['seo_types_handler']); foreach($handler_array as $key => $value) { if( $this->path == $value ) { $handler = $value; break; } } } if( $handler && !$this->handler_flag ) { $handler = str_replace('.php', SEO_DEFAULT_INNER_SEPARATOR, $handler); $tmp_array[] = $handler . $entry['seo_name']; $this->handler_flag = true; } else { $tmp_array[] = $entry['seo_types_prefix'] . $entry['seo_name']; } $sort_order = $entry['sort_order'] . '_' . $entry['seo_types_linkage']; } else { $tmp_array[] = $entry['seo_name']; } $depth++; $result = true; } return $result; } I will do some more testing and include the fix with the next version. Thanks for the report. Quote Link to comment Share on other sites More sharing options...
trogette Posted June 7, 2007 Share Posted June 7, 2007 I was just coming to look at the product review issue, am pleased to say the fix seems to work fine here :) I just had a thought though, the default set-up means that products that are linked to more than one category will have different URLs pointing to the same page. Does anyone think this may cause issues with search engines down-grading for duplicate content? I'm probably teaching grannies to suck eggs, but it really hadn't occured to me before! I wonder if there's a way of passing the breadcrumb to the product page without it showing in the URL? (It might well do this already, I haven't looked that closely at it yet.) Quote Link to comment Share on other sites More sharing options...
Guest Posted June 7, 2007 Share Posted June 7, 2007 I was just coming to look at the product review issue, am pleased to say the fix seems to work fine here :) I just had a thought though, the default set-up means that products that are linked to more than one category will have different URLs pointing to the same page. Does anyone think this may cause issues with search engines down-grading for duplicate content? I'm probably teaching grannies to suck eggs, but it really hadn't occured to me before! I wonder if there's a way of passing the breadcrumb to the product page without it showing in the URL? (It might well do this already, I haven't looked that closely at it yet.) It's being addressed since version 1.13 and is documented. The linkage field works as an override option between the different parameters. For optimum link generation specify a different linkage value for each entry. When the linkage value is the same among the entries, the parameters for these entries when found, are maintained with the SEO links. For example: Linkage for manufacturers = 1, Sort Order 1 Linkage for categories = 1, Sort Order 2 Linkage for products = 1, Sort Order 3 a final link with manufacturers_id, cpath, products_id will appear as: mfc_oscommerce_category_contributions_product_seo-g In contrast when the linkage is different: (Recommended) Linkage for manufacturers = 3, Sort Order 1 Linkage for categories = 2, Sort Order 2 Linkage for products = 1, Sort Order 3 a final link with manufacturers_id, cpath, products_id will appear as: product_seo-g Quote Link to comment Share on other sites More sharing options...
trogette Posted June 7, 2007 Share Posted June 7, 2007 That hasn't had any effect on my live site. On my local site it either doesn't change the URL or it causes the product URL to appear the same as the category URL. 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.