install.xml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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/view/template/common/header.twig
  11. Loads reverb.css in the <head> so the sidebar icon class is available
  12. before column_left renders. Searching for </head> is version-agnostic
  13. across all OC3 minor releases and avoids relying on a specific
  14. addStyle() call in the PHP controller.
  15. ========================================================================
  16. -->
  17. <file path="admin/view/template/common/header.twig">
  18. <operation error="skip">
  19. <search><![CDATA[</head>]]></search>
  20. <add position="before"><![CDATA[<link href="view/stylesheet/reverb.css" rel="stylesheet" type="text/css">
  21. ]]></add>
  22. </operation>
  23. </file>
  24. <!--
  25. ========================================================================
  26. FILE: admin/controller/common/column_left.php
  27. Adds the Reverb menu item to the left-hand navigation, positioned
  28. above the Sale (menu-sale) block. The literal `if ($sale) {` appears
  29. exactly once in OC3 — just before $data['menus'][] is assigned for
  30. menu-sale — making it a reliable anchor across all OC3 minor versions.
  31. ========================================================================
  32. -->
  33. <file path="admin/controller/common/column_left.php">
  34. <operation error="skip">
  35. <search><![CDATA[if ($sale) {]]></search>
  36. <add position="before"><![CDATA[
  37. // Reverb
  38. if ($this->user->hasPermission('access', 'extension/module/reverb')) {
  39. $data['menus'][] = array(
  40. 'id' => 'menu-reverb',
  41. 'icon' => 'reverb-nav-icon',
  42. 'name' => 'Reverb',
  43. 'href' => $this->url->link('extension/module/reverb', 'user_token=' . $this->session->data['user_token'], true),
  44. 'children' => array()
  45. );
  46. }
  47. ]]></add>
  48. </operation>
  49. </file>
  50. <!--
  51. ========================================================================
  52. FILE: admin/view/template/catalog/product_form.twig
  53. (OC3 uses product_form.twig, NOT product.twig)
  54. Injects a Reverb tab into the product edit page.
  55. Tab content is loaded via AJAX from extension/module/reverb/productTab.
  56. Saving is handled by OC event hooks registered in module install().
  57. ========================================================================
  58. -->
  59. <file path="admin/view/template/catalog/product_form.twig">
  60. <!-- Tab nav item — inserted after the Design tab (last tab in OC3) -->
  61. <operation error="skip">
  62. <search><![CDATA[<li><a href="#tab-design" data-toggle="tab">{{ tab_design }}</a></li>]]></search>
  63. <add position="after"><![CDATA[<li><a href="#tab-reverb" data-toggle="tab">Reverb</a></li>]]></add>
  64. </operation>
  65. <!-- Tab pane + AJAX loader — inserted before the Design pane -->
  66. <operation error="skip">
  67. <search><![CDATA[<div class="tab-pane" id="tab-design">]]></search>
  68. <add position="before"><![CDATA[
  69. <div class="tab-pane" id="tab-reverb">
  70. <div id="reverb-tab-content" style="padding:20px;">
  71. <i class="fa fa-spinner fa-spin"></i> Loading&hellip;
  72. </div>
  73. </div>
  74. <script type="text/javascript">
  75. (function () {
  76. $(document).ready(function () {
  77. var p = new URLSearchParams(window.location.search);
  78. var url = 'index.php?route=extension/module/reverb/productTab'
  79. + '&user_token=' + encodeURIComponent(p.get('user_token') || '')
  80. + '&product_id=' + encodeURIComponent(p.get('product_id') || 0);
  81. $.get(url).done(function (html) {
  82. $('#reverb-tab-content').html(html);
  83. }).fail(function () {
  84. $('#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>');
  85. });
  86. });
  87. }());
  88. </script>
  89. ]]></add>
  90. </operation>
  91. </file>
  92. </modification>