install.xml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <modification>
  3. <name>Reverb Integration</name>
  4. <code>reverb</code>
  5. <version>1.0.4</version>
  6. <author>Reverb OpenCart</author>
  7. <link>https://reverb.com/au/page/integrations</link>
  8. <!--
  9. ========================================================================
  10. FILE: admin/controller/common/header.php
  11. Loads reverb.css so the sidebar icon class is defined before the
  12. column_left template renders.
  13. ========================================================================
  14. -->
  15. <file path="admin/controller/common/header.php">
  16. <operation error="skip">
  17. <search><![CDATA[addStyle('view/stylesheet/opencart.css');]]></search>
  18. <add position="after"><![CDATA[
  19. $this->document->addStyle('view/stylesheet/reverb.css');]]></add>
  20. </operation>
  21. </file>
  22. <!--
  23. ========================================================================
  24. FILE: admin/controller/common/column_left.php
  25. Adds the Reverb menu item to the left-hand navigation, positioned
  26. above the Sale (menu-sale) block. A regex search is used so the match
  27. is whitespace-agnostic across OC3 minor versions.
  28. ========================================================================
  29. -->
  30. <file path="admin/controller/common/column_left.php">
  31. <operation error="skip">
  32. <search regex="true"><![CDATA[if \(\$sale\) \{\s+\$data\['menus'\]\[\]\s*=\s*array\(]]></search>
  33. <add position="before"><![CDATA[
  34. // Reverb
  35. if ($this->user->hasPermission('access', 'extension/module/reverb')) {
  36. $data['menus'][] = array(
  37. 'id' => 'menu-reverb',
  38. 'icon' => 'reverb-nav-icon',
  39. 'name' => 'Reverb',
  40. 'href' => $this->url->link('extension/module/reverb', 'user_token=' . $this->session->data['user_token'], true),
  41. 'children' => array()
  42. );
  43. }
  44. ]]></add>
  45. </operation>
  46. </file>
  47. <!--
  48. ========================================================================
  49. FILE: admin/view/template/catalog/product_form.twig
  50. (OC3 uses product_form.twig, NOT product.twig)
  51. Injects a Reverb tab into the product edit page.
  52. Tab content is loaded via AJAX from extension/module/reverb/productTab.
  53. Saving is handled by OC event hooks registered in module install().
  54. ========================================================================
  55. -->
  56. <file path="admin/view/template/catalog/product_form.twig">
  57. <!-- Tab nav item — inserted after the Design tab (last tab in OC3) -->
  58. <operation error="skip">
  59. <search><![CDATA[<li><a href="#tab-design" data-toggle="tab">{{ tab_design }}</a></li>]]></search>
  60. <add position="after"><![CDATA[<li><a href="#tab-reverb" data-toggle="tab">Reverb</a></li>]]></add>
  61. </operation>
  62. <!-- Tab pane + AJAX loader — inserted before the Design pane -->
  63. <operation error="skip">
  64. <search><![CDATA[<div class="tab-pane" id="tab-design">]]></search>
  65. <add position="before"><![CDATA[
  66. <div class="tab-pane" id="tab-reverb">
  67. <div id="reverb-tab-content" style="padding:20px;">
  68. <i class="fa fa-spinner fa-spin"></i> Loading&hellip;
  69. </div>
  70. </div>
  71. <script type="text/javascript">
  72. (function () {
  73. $(document).ready(function () {
  74. var p = new URLSearchParams(window.location.search);
  75. var url = 'index.php?route=extension/module/reverb/productTab'
  76. + '&user_token=' + encodeURIComponent(p.get('user_token') || '')
  77. + '&product_id=' + encodeURIComponent(p.get('product_id') || 0);
  78. $.get(url).done(function (html) {
  79. $('#reverb-tab-content').html(html);
  80. }).fail(function () {
  81. $('#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 and enabled.</p>');
  82. });
  83. });
  84. }());
  85. </script>
  86. ]]></add>
  87. </operation>
  88. </file>
  89. </modification>