Prestashop: Regression related to quick view and hookDisplayProductAdditionalInfo

Created on 8 Oct 2020  路  5Comments  路  Source: PrestaShop/PrestaShop

Describe the bug

Because of this PR:
https://github.com/PrestaShop/PrestaShop/pull/15297

Module developers are unable to determine if product is refreshed in quick view context or not.

Expected behavior

We should be able to check wether module is displayed in quick view or not, previously it was possible.

Steps to Reproduce

Steps to reproduce the "good" behavior from 1.7.6:

  1. Make sure you have ps_sharebuttons module installed and enabled
  2. Edit /themes/classic/modules/ps_sharebuttons/views/templates/hook/ps_sharebuttons.tpl
  3. Put at the beginning of the block: <pre>{$smarty.post|@print_r}</pre>
  4. Go to homepage
  5. Enable quick view on some product with attributes
  6. See that there's an array:
[action] => quickview
[id_product] => 1
[id_product_attribute] => 1
  1. change attribute, see that we still have an access to [action] => quickview

Of course this is wrong that id_product_attribute is not updated etc. and at the end #15297 is helping with that but, let's check this on 1.7.7 now:

  1. Make sure you have ps_sharebuttons module installed and enabled
  2. Edit /themes/classic/modules/ps_sharebuttons/views/templates/hook/ps_sharebuttons.tpl
  3. Put at the beginning of the block: <pre>{$smarty.post|@print_r}</pre>
  4. Go to homepage
  5. Enable quick view on some product with attributes
  6. See that there's an array:
 [action] => quickview
 [id_product] => 1
 [id_product_attribute] => 1
  1. Now the important part, change attribute, new array:
[ajax] => 1
[action] => refresh
[quantity_wanted] => 1

As you can see action is different than in 1.7.6, because of this I can't as a module developer check from .tpl if module is in quick view or not, because of this some of modules I work with doesn't work.

PR to follow.

Additional information

  • PrestaShop version: 1.7.7
  • PHP version: N/A
1.7.7.x Bug Combinations Fixed Minor Nice to have PR available Regression

All 5 comments

Thanks for opening this issue! We will help you to keep its state consistent

Hi @kpodemski ,

I did manage to reproduce your issue in PS 1.7.7.
Result I have in PS 1.7.7 :

Array
(
    [ajax] => 1
    [action] => refresh
    [quantity_wanted] => 1
)

Instead of, like it is in PS 1.7.6 :

Array
(
    [action] => quickview
    [id_product] => 1
    [id_product_attribute] => 1
)

I will add this to the debug roadmap. Thanks for the PR !

@kpodemski I'm sorry but I fail to understand how PR https://github.com/PrestaShop/PrestaShop/pull/15297 could have created this issue. The PR only wraps a hook inside a div 馃 I know PrestaShop has sometimes very weird trick up its sleeves, but that one would be a magical one 馃寛 ?

@matks ajax, as discussed on Slack 馃憤馃徎

Fixed by #21362

Was this page helpful?
0 / 5 - 0 ratings

Related issues

matks picture matks  路  3Comments

centoasa picture centoasa  路  3Comments

rGaillard picture rGaillard  路  3Comments

matks picture matks  路  3Comments

sandra2n picture sandra2n  路  3Comments