install.xml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <modification>
  3. <name>Reverb Integration</name>
  4. <code>reverb</code>
  5. <version>1.0.3</version>
  6. <author>Reverb OpenCart</author>
  7. <link>https://reverb.com/au/page/integrations</link>
  8. <!--
  9. ========================================================================
  10. FILE: admin/view/template/catalog/product.twig
  11. Injects a Reverb tab into the product edit page.
  12. Tab content is loaded via AJAX from extension/module/reverb/productTab
  13. so no PHP controller patching is required. Saving is handled by the
  14. OC event hooks registered in the module install() method.
  15. error="skip" on each operation means a single search miss will not
  16. abort the other operation.
  17. ========================================================================
  18. -->
  19. <file path="admin/view/template/catalog/product.twig">
  20. <!-- Tab nav item — inserted after the SEO tab -->
  21. <operation error="skip">
  22. <search><![CDATA[<li><a href="#tab-seo" data-toggle="tab">{{ tab_seo }}</a></li>]]></search>
  23. <add position="after"><![CDATA[<li><a href="#tab-reverb" data-toggle="tab">Reverb</a></li>]]></add>
  24. </operation>
  25. <!-- Tab pane placeholder + AJAX loader — inserted before the SEO pane -->
  26. <operation error="skip">
  27. <search><![CDATA[<div class="tab-pane" id="tab-seo">]]></search>
  28. <add position="before"><![CDATA[
  29. <div class="tab-pane" id="tab-reverb">
  30. <div id="reverb-tab-content" style="padding:20px;">
  31. <i class="fa fa-spinner fa-spin"></i> Loading&hellip;
  32. </div>
  33. </div>
  34. <script>
  35. (function () {
  36. $(document).ready(function () {
  37. var p = new URLSearchParams(window.location.search);
  38. var url = 'index.php?route=extension/module/reverb/productTab'
  39. + '&user_token=' + encodeURIComponent(p.get('user_token') || '')
  40. + '&product_id=' + encodeURIComponent(p.get('product_id') || 0);
  41. $.get(url).done(function (html) {
  42. $('#reverb-tab-content').html(html);
  43. }).fail(function () {
  44. $('#reverb-tab-content').html('<p class="text-danger"><i class="fa fa-exclamation-circle"></i> Could not load Reverb tab. Check that the Reverb module is installed correctly.</p>');
  45. });
  46. });
  47. }());
  48. </script>
  49. ]]></add>
  50. </operation>
  51. </file>
  52. </modification>