Re: Ceon URI Mapping v4.x - Specifying the current URI Mapping for any other Zen Cart
Re: Ceon URI Mapping v4.x - Specifying the current URI Mapping for any other Zen Cart
Quote:
Originally Posted by
franekz
Hi guys,
Many of you want to convert all of products/categories to be used by this module.
This is a very simle code (my site is only english, only GBP etc etc). I did not have enough time to write it properly so you should actually change it if you use more than one language in your shop. But I had only 15 min so the code is as it is.
PHP Code:
<?php
global $db;
/* CATEGORIES */
require_once(DIR_WS_CLASSES . 'class.CeonURIMappingAdminCategoryPages.php');
/* CATEGORIES */
/* PRODUCTS */
require_once(DIR_WS_CLASSES . 'class.CeonURIMappingAdminProductPages.php');
set_time_limit(600);
/* PRODUCTS */
$__i = 0;
if(false) $_cat = $db->Execute("TRUNCATE ceon_uri_mappings");
$ceon_uri_mapping_admin = new CeonURIMappingAdminCategoryPages();
$__products = $db->Execute("SELECT categories_id,parent_id FROM " . TABLE_CATEGORIES);
while (!$__products->EOF) {
$__cat = $__products -> fields;
$__cat_id = $__cat['categories_id'];
$new_uri = $ceon_uri_mapping_admin->autogenCategoryOrProductURIMapping($__cat_id, 'category',NULL,NULL,"en",1);
//echo($new_uri . "</br>");
$_cat = $db->Execute("SELECT * FROM ceon_uri_mappings WHERE associated_db_id = '$__cat_id' AND main_page = 'index'");
if($_cat -> RecordCount() == 0)
$cat = $db -> Execute("INSERT INTO ceon_uri_mappings (uri,language_id,current_uri,main_page,associated_db_id,redirection_type_code) VALUES ('$new_uri','1','1','index','$__cat_id',NULL)");
$__products->MoveNext();
}
$ceon_uri_mapping_admin = new CeonURIMappingAdminProductPages();
$__products = $db->Execute("SELECT products_id, products_type FROM " . TABLE_PRODUCTS);
while (!$__products->EOF) {
set_time_limit(600);
$__prod = $__products -> fields;
$__prod_id = $__prod['products_id'];
$_cat = $db->Execute("SELECT categories_id FROM products_to_categories WHERE products_id = '$__prod_id'");
$cat = $_cat -> fields;
$new_uri = $ceon_uri_mapping_admin->autogenCategoryOrProductURIMapping($cat['categories_id'], 'category',NULL,NULL,"en",1);
$new_uri .= $ceon_uri_mapping_admin->autogenCategoryOrProductURIMapping($__prod_id, 'product',NULL,NULL,"en",1);
$_cat = $db->Execute("SELECT * FROM ceon_uri_mappings WHERE associated_db_id = '$__prod_id' AND main_page = 'product_info'");
//if($__i++ == 10) die();
if($_cat -> RecordCount() == 0)
$cat = $db -> Execute("INSERT INTO ceon_uri_mappings (uri,language_id,current_uri,main_page,associated_db_id,redirection_type_code) VALUES ('$new_uri','1','1','product_info','$__prod_id',NULL)");
//echo($new_uri . "</br>");
$__products->MoveNext();
}
?>
Quote:
Originally Posted by
franekz
It may or does, besides a few minor things, it assigns all items to the product type product general. So document types or any other product type get reassigned to the product type, as written. The data is there available to not have that happen, but it is not fully incorporated.
Re: Ceon URI Mapping v4.x - Specifying the current URI Mapping for any other Zen Cart
Quote:
Originally Posted by
mc12345678
It may or does, besides a few minor things, it assigns all items to the product type product general. So document types or any other product type get reassigned to the product type, as written. The data is there available to not have that happen, but it is not fully incorporated.
As I stated - its not a plugin or mod, it was written to feed ceon's database for that shop. Nothing more.
But it can be amended easily for general use :)
Re: Ceon URI Mapping v4.x - Specifying the current URI Mapping for any other Zen Cart
Quote:
Originally Posted by
franekz
As I stated - its not a plugin or mod, it was written to feed ceon's database for that shop. Nothing more.
But it can be amended easily for general use :)
Agree, and offering a little feedback near the original post for those that choose to pluck it out, find a place to insert it and try to use it. Ie. There was already a cautionary note about the language situation, but there wasn't one about the product type. Now there is :) it's all good.
Re: Ceon URI Mapping v4.x - Specifying the current URI Mapping for any other Zen Cart
Quote:
Originally Posted by
mc12345678
Agree, and offering a little feedback near the original post for those that choose to pluck it out, find a place to insert it and try to use it. Ie. There was already a cautionary note about the language situation, but there wasn't one about the product type. Now there is :) it's all good.
Yes - but actually such a chunks of code are only for those who know how use them. Anyway this is my warning: If you do not understand the code - do not use it.
I intentionally did not mention where to place the code :)
Re: Ceon URI Mapping v4.x - Specifying the current URI Mapping for any other Zen Cart
Quote:
Originally Posted by
mc12345678
Agree, and offering a little feedback near the original post for those that choose to pluck it out, find a place to insert it and try to use it. Ie. There was already a cautionary note about the language situation, but there wasn't one about the product type. Now there is :) it's all good.
I agree.. full disclosure when sharing code with the community is always best.. makes things easier, and saves folks a little hair pulling..
Re: Ceon URI Mapping v4.x - issue with installation in 1.5.3
I have zencart 1.5.3,. INstalled ceon url mapping 4.4.2.
Installation broke admin login to white page. so I troublshot it file by file. Finally found that the ifle that is breaking the installation is admin/includes/functions/general.php. If I revert back to clean install of that file my admin works fine again. Of course the ceon url mapping is then broke.
I've done a compare of the two files but there is alot of changes in the ceon version and my php is not good enough to figure out what the problem might be.
I'm assuming it might be something to do with the file needing to be upgraded to be compatible with 1.5.3 since 1.5.3 had some changes from 1.5.1 in that I noticed 1.5.3 broke other things that worked ok with 1.5.1 and had to be fixed (eg, a template).
help! (Please).
Re: Ceon URI Mapping v4.x - issue with installation in 1.5.3
Quote:
Originally Posted by
thomaswhiteeagle
I have zencart 1.5.3,. INstalled ceon url mapping 4.4.2.
Installation broke admin login to white page. so I troublshot it file by file. Finally found that the ifle that is breaking the installation is admin/includes/functions/general.php. If I revert back to clean install of that file my admin works fine again. Of course the ceon url mapping is then broke.
I've done a compare of the two files but there is alot of changes in the ceon version and my php is not good enough to figure out what the problem might be.
I'm assuming it might be something to do with the file needing to be upgraded to be compatible with 1.5.3 since 1.5.3 had some changes from 1.5.1 in that I noticed 1.5.3 broke other things that worked ok with 1.5.1 and had to be fixed (eg, a template).
help! (Please).
Did you happen to use the files from this post that islocated one page back? http://www.zen-cart.com/showthread.p...16#post1255416
Re: Ceon URI Mapping v4.x - issue with installation in 1.5.3
Quote:
Originally Posted by
mc12345678
Thanks yeah didn't find/see that. will take a look at it. Currently I seem to have ceon url mapping working on the site in spite of not using their version of general.php so I am hesitant to fiddle too much since this is a production site that is the sole income of quite a few people so we don't want to break anything now that we have the upgrade to 1.5.3 working and live. I'll probably wait until the slow time over the weekend and backup the site then try it out in case anything breaks will give me time to recover without to much impact on the business. appreciate the info.
Re: Ceon URI Mapping v4.x - issue with installation in 1.5.3
Quote:
Originally Posted by
thomaswhiteeagle
Thanks yeah didn't find/see that. will take a look at it. Currently I seem to have ceon url mapping working on the site in spite of not using their version of general.php so I am hesitant to fiddle too much since this is a production site that is the sole income of quite a few people so we don't want to break anything now that we have the upgrade to 1.5.3 working and live. I'll probably wait until the slow time over the weekend and backup the site then try it out in case anything breaks will give me time to recover without to much impact on the business. appreciate the info.
Before the more than likely resulting heart attack, how about doing something to not have to work on a live income providing site? Like set up a development/test site? That wayu can find the errors 1) before your customers, and 2) while your customers keep shopping?