Post by straightlight » Fri Mar 23, 2018 9:00 pm

Followed will contain two posts with 4 files overall that will allow customers to download from any existing stores, existing languages from the same download lists in their account.

- catalog/controller/account/download.php
- catalog/language/en-gb/account/download.php
- catalog/model/account/download.php
- catalog/view/theme/default/template/account/download.twig

You can either replace those files or use OCMod / VQMod to implement the added codes.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by straightlight » Fri Mar 23, 2018 9:02 pm

The rest of the two files to replace.
Last edited by straightlight on Sun Mar 25, 2018 12:07 am, edited 4 times in total.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by straightlight » Fri Mar 23, 2018 9:03 pm

Since it won't let me upload the file either in .twig or .zip file, here's the content to use for the TWIG file:

Code: Select all

{{ header }}
<div id="account-download" class="container">
  <ul class="breadcrumb">
    {% for breadcrumb in breadcrumbs %}
    <li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
    {% endfor %}
  </ul>
  <div class="row">{{ column_left }}
    {% if column_left and column_right %}
    {% set class = 'col-sm-6' %}
    {% elseif column_left or column_right %}
    {% set class = 'col-sm-9' %}
    {% else %}
    {% set class = 'col-sm-12' %}
    {% endif %}
    <div id="content" class="{{ class }}">{{ content_top }}
      <h2>{{ heading_title }}</h2>
      {% if downloads %}
      <div class="table-responsive">
        <table class="table table-bordered table-hover">
          <thead>
            <tr>
              <td class="text-right">{{ column_order_id }}</td>
              <td class="text-left">{{ column_name }}</td>
              <td class="text-left">{{ column_size }}</td>
			  <td class="text-left">{{ column_store }}</td>
			  <td class="text-left">{{ column_language }}</td>
              <td class="text-left">{{ column_date_added }}</td>
              <td></td>
            </tr>
          </thead>
          <tbody>
          
          {% for download in downloads %}
          <tr>
            <td class="text-right">{{ download.order_id }}</td>
            <td class="text-left">{{ download.name }}</td>
            <td class="text-left">{{ download.size }}</td>
			<td class="text-left">{{ download.store_name }}</td>
			<td class="text-left">{{ download.language_name }}</td>
            <td class="text-left">{{ download.date_added }}</td>
            <td><a href="{{ download.href }}" data-toggle="tooltip" title="{{ button_download }}" class="btn btn-primary"><i class="fa fa-cloud-download"></i></a></td>
          </tr>
          {% endfor %}
          </tbody>
          
        </table>
      </div>
      <div class="row">
        <div class="col-sm-6 text-left">{{ pagination }}</div>
        <div class="col-sm-6 text-right">{{ results }}</div>
      </div>
      {% else %}
      <p>{{ text_empty }}</p>
      {% endif %}
      <div class="buttons clearfix">
        <div class="pull-right"><a href="{{ continue }}" class="btn btn-primary">{{ button_continue }}</a></div>
      </div>
      {{ content_bottom }}</div>
    {{ column_right }}</div>
</div>
{{ footer }}

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by straightlight » Sat Mar 24, 2018 9:10 pm

Post #5 has now been extended from post #2 with the validation of the recurring order products for those downloads. All product IDs matched with a recurring order status will be able to download with or even without a found recurring order status as their respective time period of the recurring order.
Last edited by straightlight on Sun Mar 25, 2018 12:08 am, edited 1 time in total.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by straightlight » Sat Mar 24, 2018 11:39 pm

For those who wants to enforce a store review on the product page before being able to download from the account download's page along with the order recurring products, replace post #5's file with this file attachment.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by straightlight » Mon Mar 26, 2018 9:19 pm

Another side of the story is, since all stores are being displayed along with the languages, it could also break the SLAs which the core also does not restrict.

In order to avoid this issue, a store disclosure option must be added for every store so that the merchant can either allow or disallow the disclose of the current store towards other stores that he owns. To remind of the applied strategy, this is only a conceptual approach as the following modifications below will not be propagated through the entire unfortunately while it should be, however.

Followed is the modified catalog/model/account/download.php file in the attachment.

Although, the following adjustments would also need to be made in the following files:

- admin/controller/setting/setting.php file:

find:

Code: Select all

$data['return_statuses'] = $this->model_localisation_return_status->getReturnStatuses();
add above:

Code: Select all

if (isset($this->request->post['config_store_disclosure'])) {
			$data['config_store_disclosure'] = $this->request->post['config_store_disclosure'];
		} else {
			$data['config_store_disclosure'] = $this->config->get('config_store_disclosure');
		}
In admin/controller/setting/store.php file,

find:

Code: Select all

if (isset($this->request->post['config_secure'])) {
			$data['config_secure'] = $this->request->post['config_secure'];
		} elseif (isset($store_info['config_secure'])) {
			$data['config_secure'] = $store_info['config_secure'];
		} else {
			$data['config_secure'] = '';
		}
add above:

Code: Select all

if (isset($this->request->post['config_store_disclosure'])) {
			$data['config_store_disclosure'] = $this->request->post['config_store_disclosure'];
		} else {
			$data['config_store_disclosure'] = $this->config->get('config_store_disclosure');
		}
In admin/language/en-gb/setting/setting.php file,

find:

Code: Select all

$_['entry_status']
add below:

Code: Select all

$_['entry_store_disclosure'] = 'Disclose the store to other stores that I own?';
In admin/controller/setting/store.php file,

find:

Code: Select all

$_['entry_secure']                 = 'Use SSL';
add below:

Code: Select all

$_['entry_store_disclosure'] = 'Disclose the store to other stores that I own?';
In admin/view/template/setting/setting.twig file,

find:

Code: Select all

</fieldset>
              <fieldset>
                <legend>{{ text_affiliate }}</legend>
add above:

Code: Select all

<div class="form-group">
                <label class="col-sm-2 control-label">{{ entry_store_disclosure }}</label>
                <div class="col-sm-10">
                  <label class="radio-inline"> {% if config_store_disclosure %}
                    <input type="radio" name="config_store_disclosure" value="1" checked="checked" />
                    {{ text_yes }}
                    {% else %}
                    <input type="radio" name="config_store_disclosure" value="1" />
                    {{ text_yes }}
                    {% endif %} </label>
                  <label class="radio-inline"> {% if not config_store_disclosure %}
                    <input type="radio" name="config_store_disclosure" value="0" checked="checked" />
                    {{ text_no }}
                    {% else %}
                    <input type="radio" name="config_store_disclosure" value="0" />
                    {{ text_no }}
                    {% endif %} </label>
                </div>
              </div>
This should resolved the issue.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by straightlight » Tue Mar 27, 2018 12:30 am

Followed is an updated catalog/model/account/download.php file for those who would like to operate with this solution specifically: viewtopic.php?f=201&p=718724#p718724 . This also needs to be used as part of the bug fixes solutions provided on that topic in order to work.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 4 guests