I suggest using a dev environment with Symfony Profiler. At Oro, we have a useful tool for, that allows you to find the template, used for rendering some HTML and understand where it comes from, it’s named Twig Inspector, you can check the documentation.
I just run composer install on my VM and downloaded a few packages but I don’t see a file like app_dev.php or anything… how can I enter my site on dev mode?
First, I tried installing the dev requirements in the VM and found problems with composer update (Lack of memory apparently)… so I’m going back to using it like it was a prod environment.
What I recently noticed is that the shipping tracking form doesn’t look _exactly_ like mine:
There’s a table that keeps everything in its place that I don’t have :(
The thing is, I’ve been looking around and realized this table starts hidden and it’s unhidden upon click on “Add” (Which adds a row based on a template to the table).
I noticed there’s also a file vendor/oro/commerce/src/Oro/Bundle/OrderBundle/Resources/config/oro/twig.yml which contains:
YAML
1
2
bundles:
-OroOrderBundle:Form:fields.html.twig
Which contains lots of block definitions, one in particular that caught my attention was {%block oro_order_shipping_tracking_collection_widget%}. In it I found the definition of the table that holds the tracking records…
What I’m missing here is how this file (fields.html.twig) is related to the general template that creates the popup and how the javascript is brought together as well… Is there any documentation I can check on this?
I also created a file called src/Leeway/Bundle/CollectOnDeliveryBundle/Resources/views/Form/fields.html.twig in which I have the html for rendering the form I created (I copied and adapted it from the shipping tracking file).
I also created a file src/Leeway/Bundle/CollectOnDeliveryBundle/Resources/public/js/app/views/payment-transaction-collection-view.js (which I’m not really sure s actually being used though I guess it should since it’s referenced in the configureOptions method of the collectiontype).
I’m really lost here, any pointers will be much appreciated. Thanks!
I finally nailed it! The problem was I mistakenly changed the css class of a div that was referenced in the collection handling file ( public/bundles/oroui/js/app/modules/init-layout.js ).
In the line 301 it reads var$listContainer=$(this).closest('.row-oro').find(containerSelector).first();.
I had changed “row-oro” class to “row-leeway” (out of a not so smart search & replace when adapting the copied templates).
Once I put it back the way it was it all started working again :)
It is not recommended to make JS depends on CSS classes. Sad to say, but, we still have some old code with this approach, so you should take it into account. In all new stuff, we are trying to make JS depends on data attributes instead of CSS classes.
Author
Replies
Viewing 7 replies - 1 through 7 (of 7 total)
The forum ‘OroCommerce’ is closed to new topics and replies.
We collect cookie information with a goal to provide you with the best user experience. By using this website, you agree to our use of cookies. Read Oro Inc.’s Cookie policy.
We collect cookie information with a goal to provide you with the best user experience. By using this website, you agree to our use of cookies. Read Oro Inc.’s Cookie policy.