Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Gauravk Posted August 17, 2021 Posted August 17, 2021 We have a custom block calling a FAQ block under the product details in one of the the product category. Now we are adding another category of product and same FAQ block showing under that category too, which we don't want. Is there any anyway we can call FAQ custom block inside the product page from ACP - Products - Store Display - Description (WSIWYG editor)?
Marc Posted August 17, 2021 Posted August 17, 2021 Not within the core platform unfortunately, as blocks show on page types, rather than specific pages. So for example, if you add a block to a topic page, it will show on all topic pages. The same applies to products.
Gauravk Posted August 17, 2021 Author Posted August 17, 2021 Thanks Marc, I understand that functionality. What I mean is to call html or php code to call that FAQ custom block code in Source of relevant product. Like here:
Marc Posted August 17, 2021 Posted August 17, 2021 27 minutes ago, Gauravk said: Thanks Marc, I understand that functionality. What I mean is to call html or php code to call that FAQ custom block code in Source of relevant product. Like here: I have spoken to one of our developers who will see what is possible and respond at some point later today. As block items are subject to caching, this is something that needs thinking about Gauravk 1
Gauravk Posted August 17, 2021 Author Posted August 17, 2021 Many thanks Marc and dev team, I'm waiting with my fingers crossed. Marc 1
Gauravk Posted August 18, 2021 Author Posted August 18, 2021 Happy to pay other coders for this code edit to call custom block (1 FAQ) block in selective products only.
Daniel F Posted August 18, 2021 Posted August 18, 2021 You could switch from the WYSIWYG block to a PHP block and wrap the output into a condition like Quote {{if \IPS\Request::i()->id == X}} my output {{else if \IPS\Request::i()->id == Y}} my output for the other product {{endif}} Marc 1
Gauravk Posted August 18, 2021 Author Posted August 18, 2021 Thanks @Daniel F for the help. Can you please help with actual condition to be placed in PHP block for the FAQ block at the bottom? https://carnity.com/store/product/66-desert-driving-masterclass I tried this way inserting block as advised in backend but it didn't work
Jim M Posted August 21, 2021 Posted August 21, 2021 Looks like that template code was not placed in an executable space. Was this placed in the WYSIWYG editor? I'm afraid, it will not execute there and will need to be placed in a template.
Gauravk Posted August 21, 2021 Author Posted August 21, 2021 35 minutes ago, Jim M said: Looks like that template code was not placed in an executable space. Was this placed in the WYSIWYG editor? I'm afraid, it will not execute there and will need to be placed in a template. It was indeed place in a source tab and not in WYSIWYG. Appreciate if you and your team can guide, find, or design an easy usable workaround for this issue please.
Jim M Posted August 21, 2021 Posted August 21, 2021 10 minutes ago, Gauravk said: It was indeed place in a source tab and not in WYSIWYG. Appreciate if you and your team can guide, find, or design an easy usable workaround for this issue please. Source tab in the editor would still not work as it is still the editor, not a template.
Gauravk Posted August 21, 2021 Author Posted August 21, 2021 1 minute ago, Jim M said: Source tab in the editor would still not work as it is still the editor, not a template. Thank you I have realized that. Can you please advise, how to make it work?
Jim M Posted August 21, 2021 Posted August 21, 2021 Just now, Gauravk said: Thank you I have realized that. Can you please advise, how to make it work? You would need to place this in an area which can execute template code as Daniel instructed with either putting it in a PHP block or a theme template. This is getting outside of our support so I will move this topic to the community support forum.
Gauravk Posted August 21, 2021 Author Posted August 21, 2021 As usual - Totally and extremely disappointed with IPS Product, IPS support, IPS logical reasonings and problem solving. If such bug or badly design features without a grain of common sense fall outside the support, then why we ask to waste time on tickets (first) then forum to waste customer 5 days time and still make their site looks like a joke in public.
Gauravk Posted August 21, 2021 Author Posted August 21, 2021 Please change this to Sell virtually - ONLY ONE TYPE OF PRODUCT. https://invisioncommunity.com/features/commerce/ Because WYSIWYG under product listing will show ONLY ONE TYPE OF BLOCK in all products from selling milk to space shuttle to needle to baby toys.
Recommended Posts