However, if I open the FILE /catalog/view/theme/default/template/product/product.twig - the change is NOT there.
So, 2 questions:
1.) If the change that's made in admin is NOT saved in the FILE, then WHERE is it saved????
2.) If it's saved somewhere else, why is there a template file, if it does nothing?
Opencart Developer - My Extension Showcase
Contact me at aeon.yoda@gmail.com
Which REALLY makes me wonder.... WHY. IS. THERE. A. TEMPLATE. FILE. THEN.
And how the hell is this all supposed to work now? Do we change the template file, or the code in the admin?
It's like the OC developers decided "hey, you know how, like, people were used to making changes to the template FILES, and learned PHP code, etc? Guess what? Now we're going to store SOME changes in files, and SOME in database, and good frickin' luck trying to figure out what's where."...
Don't use dramatic sentences when you don't understand something.. makes you sound like a moron. Files are there because up until you made that change.. where did you expect the template to exist? The database holds the overrides to theme only.. similar to how ocmod and vQmod work.. you have your base, then an override script to find/replace just the parts you want to change. Doesn't make sense to hold full themes in a database.. only the overridden lines. Remember the definition of a "template" is "a preset format for a document or file, used so that the format does not have to be recreated each time it is used." So you shouldn't be editing templates directly anyway.Which REALLY makes me wonder.... WHY. IS. THERE. A. TEMPLATE. FILE. THEN.
If you do alter twig files directly, you won't see the changes initially because twig uses a template cache. It's hidden on the dashboard for some reason but if you look at the little gear icon on the right side near the top, that is the template cache clear. So if you make changes to the twig files directly, you will need to clear the cached version for those changes to take affect. The overrides in the admin will always take effect on the cached file version.
The purpose of this is 1) for the cloud version of OpenCart, it allows customers to make changes to their own cart, based off a common code baseline. If they make a mistake they can simply remove their custom overrides and go back to the default. 2) You don't have to worry as much about losing custom changes to files when you upgrade opencart on your own server. You can go back and reference the changes you made as they are saved in the database.
Sometimes (almost always in my case ) the developers know the better method.
You should try when possible to never alter files and only use overrides... that's just a general rule to life.
I have code equivalent to this:
In the vqmod
Code: Select all
<file path="catalog/view/theme/default/template/product/product.twig">
<operation>
<search><![CDATA[<div id="product"> {% if options %}]]></search>
<add position="before"><![CDATA[
{% if my_var %}
<div class="form-group">
<h2><a href="{{ my_var}}" > {{ my_var_desc }} </a></h2>
</div>
{% endif %}
]]></add>
</operation>
</file>
Code: Select all
{% for discount in discounts %}
<li>{{ discount.quantity }}{{ text_discount }}{{ discount.price }}</li>
{% endfor %}
{% endif %}
</ul>
{% endif %}
{# Insert the code above Right Here #}
<div id="product"> {% if options %}
<hr>
<h3>{{ text_option }}</h3>
{% for option in options %}
{% if option.type == 'select' %}
<div class="form-group{% if option.
Also ensure to assign proper permissions recursively to the system/storage folder as per the install.txt file indicates from the original ZIP file of Opencart. In addition, all caches should be cleared out, including browser cache. Overall, there are three caches that are recommended to be cleared when using TWIG files.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
None the less, am going to first clear the three caches at once for now. till u get back to me with the storage structure.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
I have noticed something though, there's no file corresponding to the product.twig file in the vqmod so i dont think that part is being seen at all. i dont know why. There are files corresponding to all other files modified by the vqmod except that one. could that be it? if so how do i resolve that?
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Oh, do you mean the vqmod itself? Ah in that case i will contact them asap. I guess i misunderstood you there .
Then this analogy is incorrect. Users can still encounter errors without having any logs recorded on file. Since the reported issue is about an extension you are trying to build as it has nothing to do with the Opencart core and that you are using virtual tools, the solutions would be quite limited on this end.Also if there was a problem, it would log normally. since its not logging then i assumed there were no errors.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Users browsing this forum: No registered users and 570 guests