X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Adding custom product tab breaks x-mobile skin (https://forum.x-cart.com/showthread.php?t=72634)

jmedinger 08-21-2015 02:37 AM

Adding custom product tab breaks x-mobile skin
 
Using X-Cart 4.7.2

We've added a custom tab into the product detail page by editing /include/produt_tabs.php and adding
Code:

$product_tabs[] = array(
'title'  => 'Description',
'tpl'    => 'customer/main/tab_desc.tpl',
'anchor' => 'description'
);

We've also got the x-cart-mobile module installed and as soon as we make this template change, the mobile product page stops working with a javascript error and refuses to load.

I've tracked this down to be caused by the {include file=$tab.tpl nodialog='Y'} in this code in \skin\common_files\modules\Xcart_Mobile\customer\m ain\product.tpl
Code:

{if $product_tabs}
  {foreach from=$product_tabs item=tab key=ind}
    <div data-role="collapsible" data-collapsed="true">
      <h3>{$tab.title}</h3>
      <div>{include file=$tab.tpl nodialog='Y'}</div>
    </div>
  {/foreach}
{/if}

but I can't figure out how to amend it so that it doesn't get confused by a tab that hasn't been dynamically created.

Can anyone suggest a way to work around this?

Thanks!

razortw 08-25-2015 04:12 AM

Re: Adding custom product tab breaks x-mobile skin
 
Quote:

Originally Posted by jmedinger
Using X-Cart 4.7.2

We've added a custom tab into the product detail page by editing /include/produt_tabs.php and adding
Code:

$product_tabs[] = array(
'title'  => 'Description',
'tpl'    => 'customer/main/tab_desc.tpl',
'anchor' => 'description'
);

We've also got the x-cart-mobile module installed and as soon as we make this template change, the mobile product page stops working with a javascript error and refuses to load.

I've tracked this down to be caused by the {include file=$tab.tpl nodialog='Y'} in this code in \skin\common_files\modules\Xcart_Mobile\customer\m ain\product.tpl
Code:

{if $product_tabs}
  {foreach from=$product_tabs item=tab key=ind}
    <div data-role="collapsible" data-collapsed="true">
      <h3>{$tab.title}</h3>
      <div>{include file=$tab.tpl nodialog='Y'}</div>
    </div>
  {/foreach}
{/if}

but I can't figure out how to amend it so that it doesn't get confused by a tab that hasn't been dynamically created.

Can anyone suggest a way to work around this?

Thanks!

Could you please share the error with us?
Thanks.

jmedinger 08-25-2015 04:41 AM

Re: Adding custom product tab breaks x-mobile skin
 
The error is a 500 Internal Server Error with the following javascript error.

Firebug reports the javascript error to be
Code:

$(document).bind('pagechangefailed', function() {
  console.log('pagechangefailed');
});
$( document ).bind('pageloadfailed', function( event, data ){
  console.log('pageloadfailed');

although how this is related to the addition of a product tab on the desktop templates is beyond me!
See Firebug screenshot here http://dev.growhigh.co.uk/images/error.jpg


All times are GMT -8. The time now is 07:25 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.