A
A
Andrey Bely2020-01-16 14:43:25
1C-Bitrix
Andrey Bely, 2020-01-16 14:43:25

Why do the styles in the component fly off?

Good afternoon.
There was a need for a detailed view of the catalog element (catalog.element) to add recommended products (catalog.recommended.products).
It turned out like this:
5e204c1bd5062711583990.png
I modified the styles of the components (catalog.section, catalog.item) used in this component (catalog.recommended.products) here is what happened:
5e204c397d5db483085749.png
The problem is that when I, being not authorized, enter the detailed view of the product card, it looks like this like this:
5e204c4a1a082418476449.jpeg
And if authorized, then this:
5e204c56584ca487495572.jpeg
As a result, the difference is that the styles and scripts of the custom template are connected for an authorized user, and for an unauthorized user, respectively, they are not connected.
Questions:
1. Why is this happening?
2. Is it allowed to connect a component in a component, if so, how to do it correctly?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Bely, 2020-01-24
@just_guy95

Issue resolved.
I noticed a long time ago that if 2 identical components with 2 different templates are connected on the same page, then 2 templates are necessarily connected and, of course, one interrupts the other. It was in the sale.products.gift component that is included in the template.php of the catalog.element component .
sale.products.gift in its template.php has a nested catalog.item component with the default template included.
In my case, I needed to disable the parameter " Show the "Gifts" block in the detailed view " in the parameters of the catalog component.
If someone has the same question, you can write to me at [email protected]

M
Mikhail, 2020-01-16
@RuComMarket

reset the cache from the bitrix side

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question