Totally Zenned
- Join Date:
- Jan 2007
- Location:
- Los Angeles, California, United States
- Posts:
- 10,011
- Plugin Contributions:
- 3
Responsive DIY Template Default for v1.5.x
Wouldn't it be LESS coding to put the needed conditional statements in the "tpl_product_info_display.php" file?? One file with the code required to handle ALL viewports??
<!--bof Product description -->rbarbour:
Not true at all.
Copy and rename tpl_product_info_display.php as:
tpl_product_info_display_4_phones.php
tpl_product_info_display_4_tablets.phpNow you have:
tpl_product_info_display.php
tpl_product_info_display_4_phones.php
tpl_product_info_display_4_tablets.phpAll 3 files will "require" the same module files ect.
Now, find and insert the proper script code for each file
Inserting the TPP code in tpl_product_info_display.php
<!--eof Product description --> <!--bof Product description -->Inserting the Accordian code in tpl_product_info_display_4_tablets.php
<!--eof Product description --> <!--bof Product description -->Inserting the "Toggle" code tpl_product_info_display_4_phones.php
<!--eof Product description -->> Is all that you need to do in those files.
>
> Now to display the correct tpl file, open
>
> /includes/modules/pages/product_info/main_template_vars.php
>
> find:
> ```
$tpl_page_body = '/tpl_product_info_display.php';
and change to:
if ( $detect->isMobile() && !$detect->isTablet() ){
$tpl_page_body = '/tpl_product_info_display_4_phones.php';
} else if( $detect->isTablet() ){
$tpl_page_body = '/tpl_product_info_display_4_tablets.php';
} else {
$tpl_page_body = '/tpl_product_info_display.php';
}
> That's it!
>
> The original code returned it was to complicated to switch between css and php using media queries. 2.0 solved this issue in a VERY EASY way, it's now being over complicated.
>
> If you utilize other product types, simply repeat for those product types.
>
> I didn't install these but I did provide an example on this templates dev site:
>
> <http://zcadditions>[.]com/new_default
> Look at the text under the products price
My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.