Hi guys, in previous versions of SCA, I was able t...
# suitecommerce
e
Hi guys, in previous versions of SCA, I was able to extend/wrap this method getApiParams from the Facets.Translator in order to filter items, now that I try to do the same in 2019.1.5, it does not work
@Steve Goldberg do you have any idea about it? or do you know which methods are triggered when shoppers go to shop?
s
Your question is quite vague. What exactly are you trying to do?
e
I want to filter the items displayed on the Product List Page based on the customer category, like adding an extra and permanent filter in each API request. I have done this in previous versions of SCA wrapping getApiParams, I did a test in 2019, I put a debugger in the core file and it seems this method is not triggered anymore in each API request, so right now I am investigating what I need to modify or use.
s
It's getting called on my site whenever I perform an API request
I don't see how your site could function without it
e
that's pretty weird, which version of SCA are you using? I noticed that the Facets.Router changed in this version, so I thought that the getApiParams was not used anymore ...
s
2019.1.2
I am finding it hard to believe that when you put a console.log immediately at the start of the function, it is not called when you perform an items API call
e
I am using 2019.1.5, it could be a bug, I will try to do another test
oh no, what I just do, it is to go to the shop
in that moment I expect to get triggered that method
should not I expect that? I remember it was triggered in that moment for the other versions
s
any time you request product data, so going to initial product list page (eg #search) should trigger it, as should loading a PDP
e
yeah, that is exaclty what I am doing, there is something weird, even when I click on a specific item, this method is not triggered
s
sorry, I just tested that and it's not called on PDPs, and that's probably correct; i think it's to do facets on PLPs only
e
that's fine, but what else can I do to test o resolve this? This is out of my knowledge why it is not trigger even on PLP, on #search it does not
s
OK well I think this is a strange place to do what you want, I would suggest going slightly further back in the chain so it executes more reliably
For example, you could look at the URL the model calls
Facets.Model can be somewhere to look at, particularly its
url
property. Extending/wrapping this could be effective for what you want to achieve
In fact, it may just be simple enough to extend
searchApiMasterOptions
e
Let me take a look at it! Thanks so much!
@Steve Goldberg Another developer and I figured out that for some reason if you try to create a customization in 2019.1.5, they are not loaded in the local server, even the core is not loaded, is there any reason for that? or a workaround? I had to deploy my customization in order to see the changes