Page 1 of 1

[Zen Cart] Pulling Wrong Product Type TPL File

Posted: Mon Jan 14, 2013 2:47 pm
by experimedia
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

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

Posted: Mon Jan 14, 2013 2:57 pm
by inveo
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).

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

Posted: Mon Jan 14, 2013 8:33 pm
by experimedia
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.

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

Posted: Tue Jan 15, 2013 8:45 am
by inveo
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');

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

Posted: Tue Jan 15, 2013 10:50 am
by experimedia
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');

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

Posted: Tue Jan 15, 2013 10:51 am
by inveo
Oh I am sorry (code in my last post was edited).

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

Posted: Tue Jan 15, 2013 10:58 am
by experimedia
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.

Cart  
(empty)

Cart Check out  »

Prices are tax inclusive.

The VAT rate for your country (US) * is 0,0 % because it is not a member of the European Union (EU).

* Please create an account if your country does not match.

Community feed
  • [Zen Cart] Can't execute Magic SEO URLs sitemaps
    I installed Magic SEO URLs Sitemaps Add-On for ZenCart MSU4.x/MSU5.x 2.0 on my server, when I try to generate sitemaps using: https://www.pechesudv155.owally.com/sitemaps.php I received :...
    by peter@pechesud.com
  • [phpBB3] Sharing users between phpBB / PrestaShop
    Hi i have 2 question 1- prestashop module support phpBB 3.3 ? 2- why we can not login in prestashop and phpbb with same user?
    by zohall
  • [phpBB3] AJAX Userinfo Extension
    Hi! I'm having trouble with this extension: https://www.phpbb.com/customise/db/exte ... _userinfo/ I tried asking support from the author but for no avail, since now. My request for support...
    by Lord Phobos
  • [phpBB3] Upgrade to phpBB 3.2.3
    Hello.. after Upgrade to phpBB 3.2.3 I am getting this message.. How can I solve this issue..? Thank you
    by ingbrzy
  • [phpBB3] URL path changed
    Hello.. I have changed my site path after moving to new hosting and now can not activate SEO module.. new path http://www.miuios.cz/domains/miuios.cz/ could you help me? thank you
    by ingbrzy2
Join our support forum » Pre-Sales Questions »
Featured Testimonials

We installed the WordPress Accelerator plugin and it's great! With 2 other plugins the website is blazing fast!!

Milko, the owner of Boxershorts Heren

Magic SEO URLs have helped me to get the number one spot on Yahoo for a number of my products. One of them has 1,800,000 hits, but I'm number one!

Todd, the owner of UpStart Battery

More Testimonials »