[Zen Cart] Pulling Wrong Product Type TPL File

Magic SEO URLs for Zen Cart.
experimedia
Posts: 10
Joined: Sun Jan 13, 2013 9:31 pm

[Zen Cart] Pulling Wrong Product Type TPL File

Postby experimedia » Mon Jan 14, 2013 2:47 pm

Another issue I came across has to do with product types and the TPL files associated with them. Fortunately for my actual store all products are music type so I was able to work around this issue by editing the htaccess file.

It seems that when MSU is installed and when you view a product info page... that all products use the default tpl_product_info_display.php instead of the TPL version intended for that particular product type.

Lets take Music Type for example...

http://test.experimedia.net/index.php?m ... cts_id=169
vs
http://test2.experimedia.net/sample-of- ... e-169.html

You will notice that on the test2 site with MSU installed that these fields are missing.
Artist: The Russ Tippins Band
Music Genre: Jazz

This is because all the product info urls are being rewritten from....
main_page=product_info
when in music product cases they should be rewritten as...
main_page=product_music_info

When I initially stumbled across this I was able to verify this is what was happening by adding some some text into my tpl_product_info_display.php to confirm that the music product pages were in fact now displaying tpl_product_info_display.php instead of the correct file tpl_product_music_info_display.php

inveo
Inveo Support
Posts: 1285
Joined: Sat Feb 02, 2008 12:07 pm
Contact:

Re: [Zen Cart] Pulling Wrong Product Type TPL File

Postby inveo » Mon Jan 14, 2013 2:57 pm

experimedia wrote:This is because all the product info urls are being rewritten from....
main_page=product_info
when in music product cases they should be rewritten as...
main_page=product_music_info


We are afraid it does not seem to be related to MSU (please check demo site where you can see different product types in action).
Since MSU for ZC 4.x Series all product URLs are rewritten to "product_info". Later on, in the run time, proper product type is injected according to the product (by this way more clean URLs are can be produced).

experimedia
Posts: 10
Joined: Sun Jan 13, 2013 9:31 pm

Re: [Zen Cart] Pulling Wrong Product Type TPL File

Postby experimedia » Mon Jan 14, 2013 8:33 pm

Checked out your demo store and you have the same issue happening there.

You can tell by looking at a music product type and you can see there is no artist or genre listed under the model number which is included in the default product music info tpl.

inveo
Inveo Support
Posts: 1285
Joined: Sat Feb 02, 2008 12:07 pm
Contact:

Re: [Zen Cart] Pulling Wrong Product Type TPL File

Postby inveo » Tue Jan 15, 2013 8:45 am

Please change MSU installation code in includes/application_top.php file to:

Code: Select all

include(DIR_WS_INCLUDES . 'magic_seo_url.php');
$current_page_base = $current_page = $_GET['main_page'];
$page_directory = $code_page_directory = DIR_WS_MODULES . 'pages/' . $current_page_base;
include(DIR_WS_INCLUDES . 'init_includes/init_category_path.php');

experimedia
Posts: 10
Joined: Sun Jan 13, 2013 9:31 pm

Re: [Zen Cart] Pulling Wrong Product Type TPL File

Postby experimedia » Tue Jan 15, 2013 10:50 am

That did it. Thanks a ton.

Except I had to make one edit to your code...
Instead of...
magic_seo_urls.php
changed to
magic_seo_url.php

So this is the correct code.

Code: Select all

include(DIR_WS_INCLUDES . 'magic_seo_url.php');
$current_page_base = $current_page = $_GET['main_page'];
$page_directory = $code_page_directory = DIR_WS_MODULES . 'pages/' . $current_page_base;
include(DIR_WS_INCLUDES . 'init_includes/init_category_path.php');

inveo
Inveo Support
Posts: 1285
Joined: Sat Feb 02, 2008 12:07 pm
Contact:

Re: [Zen Cart] Pulling Wrong Product Type TPL File

Postby inveo » Tue Jan 15, 2013 10:51 am

Oh I am sorry (code in my last post was edited).

experimedia
Posts: 10
Joined: Sun Jan 13, 2013 9:31 pm

Re: [Zen Cart] Pulling Wrong Product Type TPL File

Postby experimedia » Tue Jan 15, 2013 10:58 am

Not a problem. Thanks again for being helpful in sorting this out. Now I dont have to manually edit my htaccess file after any regeneration. Fortunately as I mentioned it wasnt a big deal since I only have music products so far.