[ic] Code behaves differently on catalog pages and in IC
Jobs
Ton Verhagen
tverhagen at alamerce.nl
Tue Feb 5 12:48:26 EST 2008
Quoting Racke:
>Ton Verhagen wrote:
> > Dear All,
> >
> > In order to generate Google sitemaps for our various
> > domains we developed a UserTag called google-sitemap.
> >
> >
> > Brief background:
> > 1. Sites are multi-lingual
> > 2. Each 'language' has its own domain name
> > (e.g. English: mydomain.com, German: mydomain.de, etc.)
> >
> > 3. Relevant code:
> > # Set domain. Make sure proper domain shows up in links
> > my $vhost = $opts->{domain} || '';
> > my $vendurl_save = $Config->{VendURL};
> > $Config->{VendURL} = "http://${vhost}" if $vhost;
> > ...
> > generate urls using area tag
> > ...
> > # Reset domain setting
> > $Config->{VendURL} = $vendurl_save if $vhost;
> >
> >
> >
> > The above code works fine as long as the UserTag is being
> > used on a catalog page or on the test-code form in the admin.
> >
> > When called like: [google-sitemap domain="www.mydomain.de"]
> > The domain www.mydomain.de shows up in all URL's.
> > So far so good.
> >
> > However when the UserTag is called in an Interchange Job the
> > wrong domain (always default domain) shows up in the generated
> > links. No matter which domain name is provided in the UserTag call.
> > It looks like VendURL is not being set to the domain name provided.
> >
> > Any ideas what causes this behaviour, and more importantly,
> > how could we fix this?
> > We would like to have the UserTag behave the same, no matter where
> > it is called: in IC Jobs or on normal catalog pages.
>
>How does your job looks like ?
Placed text file(s) in Interchange install dir etc/Jobs/google_sitemaps
with content:
[google-sitemap domain="www.mydomain.de"
sitemap_name='sitemap_tj_de.xml'
sitemap_subdir=html
products=1
menus="catalog/brands catalog/Sieraden"
default_changefreq="weekly"
ping_google=1
][/google-sitemap]
Cron:
su -f -c '/usr/local/interchange/bin/interchange
--runjobs=mycatalog=google_sitemaps' interch
variable table:
SERVER_NAME www.mydomain.com
Aliases for catalog 'mycatalog' in interchange.cfg:
Catalog mycatalog directory /catalog/install/dir/mycatalog
Catalog mycatalog script www.mydomain.com/cgi-bin/mycatalog
Catalog mycatalog alias www.mydomain.com
Catalog mycatalog alias www.mydomain.de
Catalog mycatalog alias www.mydomain.nl
etc.
Best regards,
Ton
--
Alamerce Nederland --- Cornerstone of eBusiness
Phone +31-40-2374381 info at alamerce.nl http://www.alamerce.nl
eCommerce Solutions -- Consulting -- Website & Interchange Hosting
More information about the interchange-users
mailing list