| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- <?xml version="1.0" encoding="utf-8"?>
- <modification>
- <name>Reverb Integration</name>
- <code>reverb</code>
- <version>1.0.4</version>
- <author>Reverb OpenCart</author>
- <link>https://reverb.com/au/page/integrations</link>
- <!--
- ========================================================================
- FILE: admin/view/template/common/header.twig
- Loads reverb.css in the <head> so the sidebar icon class is available
- before column_left renders. Searching for </head> is version-agnostic
- across all OC3 minor releases and avoids relying on a specific
- addStyle() call in the PHP controller.
- ========================================================================
- -->
- <file path="admin/view/template/common/header.twig">
- <operation error="skip">
- <search><![CDATA[</head>]]></search>
- <add position="before"><![CDATA[<link href="view/stylesheet/reverb.css" rel="stylesheet" type="text/css">
- ]]></add>
- </operation>
- </file>
- <!--
- ========================================================================
- FILE: admin/controller/common/column_left.php
- Adds the Reverb menu item to the left-hand navigation, positioned
- above the Sale (menu-sale) block. The literal `if ($sale) {` appears
- exactly once in OC3 — just before $data['menus'][] is assigned for
- menu-sale — making it a reliable anchor across all OC3 minor versions.
- ========================================================================
- -->
- <file path="admin/controller/common/column_left.php">
- <operation error="skip">
- <search><![CDATA[if ($sale) {]]></search>
- <add position="before"><![CDATA[
- // Reverb
- if ($this->user->hasPermission('access', 'extension/module/reverb')) {
- $data['menus'][] = array(
- 'id' => 'menu-reverb',
- 'icon' => 'reverb-nav-icon',
- 'name' => 'Reverb',
- 'href' => $this->url->link('extension/module/reverb', 'user_token=' . $this->session->data['user_token'], true),
- 'children' => array()
- );
- }
- ]]></add>
- </operation>
- </file>
- <!--
- ========================================================================
- FILE: admin/view/template/catalog/product_form.twig
- (OC3 uses product_form.twig, NOT product.twig)
- Injects a Reverb tab into the product edit page.
- Tab content is loaded via AJAX from extension/module/reverb/productTab.
- Saving is handled by OC event hooks registered in module install().
- ========================================================================
- -->
- <file path="admin/view/template/catalog/product_form.twig">
- <!-- Tab nav item — inserted after the Design tab (last tab in OC3) -->
- <operation error="skip">
- <search><![CDATA[<li><a href="#tab-design" data-toggle="tab">{{ tab_design }}</a></li>]]></search>
- <add position="after"><![CDATA[<li><a href="#tab-reverb" data-toggle="tab">Reverb</a></li>]]></add>
- </operation>
- <!-- Tab pane + AJAX loader — inserted before the Design pane -->
- <operation error="skip">
- <search><![CDATA[<div class="tab-pane" id="tab-design">]]></search>
- <add position="before"><![CDATA[
- <div class="tab-pane" id="tab-reverb">
- <div id="reverb-tab-content" style="padding:20px;">
- <i class="fa fa-spinner fa-spin"></i> Loading…
- </div>
- </div>
- <script type="text/javascript">
- (function () {
- $(document).ready(function () {
- var p = new URLSearchParams(window.location.search);
- var url = 'index.php?route=extension/module/reverb/productTab'
- + '&user_token=' + encodeURIComponent(p.get('user_token') || '')
- + '&product_id=' + encodeURIComponent(p.get('product_id') || 0);
- $.get(url).done(function (html) {
- $('#reverb-tab-content').html(html);
- }).fail(function () {
- $('#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>');
- });
- });
- }());
- </script>
- ]]></add>
- </operation>
- </file>
- </modification>
|