Jump to content

Page lose <head> element when taxes are included in price


Gramzivi

Recommended Posts

Webpage was working perfectly until I wanted to show instead base price, price with VAT.

 

I just changed for group visitors to show prices with taxes. I am getting page that have correct price (with taxes), but there is no head element (so there is no css, javascript, title...)

 

In my php.log file i started to get two errors

 

1.

PHP Notice:  Undefined index: reduction_type

2.

PHP Fatal error:  Cannot use object of type Product as array

Now here is full PHP stack trace of those 2 errors in my php error log:

1.

PHP Notice:  Undefined index: reduction_type in \var\www\presta\tools\smarty\sysplugins\smarty_internal_templatebase.php(157) : eval()'d code on line 878

PHP Stack trace:

PHP   1. {main}() \var\www\presta\index.php:0
PHP   2. DispatcherCore->dispatch() \var\www\presta\index.php:28
PHP   3. ControllerCore->run() \var\www\presta\classes\Dispatcher.php:367
PHP   4. FrontController->display() \var\www\presta\classes\controller\Controller.php:209
PHP   5. SmartyCustomCore->fetch($template = *uninitialized*, $cache_id = *uninitialized*, $compile_id = *uninitialized*, $parent = *uninitialized*, $display = *uninitialized*, $merge_tpl_vars = *uninitialized*, $no_output_filter = *uninitialized*) \var\www\presta\override\classes\controller\FrontController.php:106
PHP   6. Smarty_Internal_TemplateBase->fetch($template = *uninitialized*, $cache_id = *uninitialized*, $compile_id = *uninitialized*, $parent = *uninitialized*, $display = *uninitialized*, $merge_tpl_vars = *uninitialized*, $no_output_filter = *uninitialized*) \var\www\presta\classes\SmartyCustom.php:110
PHP   7. content_57e3dacf339aa0_85955487($_smarty_tpl = *uninitialized*) \var\www\presta\tools\smarty\sysplugins\smarty_internal_templatebase.php:188

2.

PHP Fatal error:  Cannot use object of type Product as array in C:\xampp\htdocs\solo\tools\smarty\sysplugins\smarty_internal_templatebase.php(157) : eval()'d code on line 926

PHP Stack trace:

PHP   1. {main}() \var\www\presta\index.php:0
PHP   2. DispatcherCore->dispatch() \var\www\presta\index.php:28
PHP   3. ControllerCore->run() \var\www\presta\classes\Dispatcher.php:367
PHP   4. FrontController->display() \var\www\presta\classes\controller\Controller.php:209
PHP   5. SmartyCustomCore->fetch($template = *uninitialized*, $cache_id = *uninitialized*, $compile_id = *uninitialized*, $parent = *uninitialized*, $display = *uninitialized*, $merge_tpl_vars = *uninitialized*, $no_output_filter = *uninitialized*) \var\www\presta\override\classes\controller\FrontController.php:106
PHP   6. Smarty_Internal_TemplateBase->fetch($template = *uninitialized*, $cache_id = *uninitialized*, $compile_id = *uninitialized*, $parent = *uninitialized*, $display = *uninitialized*, $merge_tpl_vars = *uninitialized*, $no_output_filter = *uninitialized*) \var\www\presta\classes\SmartyCustom.php:110
PHP   7. content_57e3dacf339aa0_85955487($_smarty_tpl = *uninitialized*) \var\www\presta\tools\smarty\sysplugins\smarty_internal_templatebase.php:188

I am using Prestashop 1.6.1 and PHP 5.6

 

Link to comment
Share on other sites

I fixed the bug

 

Problem was in SNS Camen Theme.

 

\themes\sns_camen\product.tpl

{if !$priceDisplay}
    {convertPrice price=$product.price}
{else}
    {convertPrice price=$accessory.price_tax_exc}
{/if}

Instead $product it needs to be $accessory

{convertPrice price=$accessory.price}
Edited by Gramzivi (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...