Skip to content

Commit

Permalink
Merge pull request #32 from wuunder/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
TimD90 authored Mar 9, 2020
2 parents c21affe + 7852950 commit 2e6993d
Show file tree
Hide file tree
Showing 9 changed files with 86 additions and 59 deletions.
3 changes: 3 additions & 0 deletions wuunderconnector/composer.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"config": {
"prepend-autoloader": false
},
"require": {
"wuunder/connector-php": ">=1.0.0"
}
Expand Down
2 changes: 1 addition & 1 deletion wuunderconnector/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<module>
<name>wuunderconnector</name>
<displayName><![CDATA[Wuunder shipping module]]></displayName>
<version><![CDATA[1.3.3]]></version>
<version><![CDATA[1.3.4]]></version>
<description><![CDATA[Send and receive your shipments easily, personally and efficiently. You can ship via more then 23 carriers. Wuunder takes care of all your transport and warehouse solutions you need.]]></description>
<author><![CDATA[Wuunder]]></author>
<tab><![CDATA[shipping_logistics]]></tab>
Expand Down
14 changes: 9 additions & 5 deletions wuunderconnector/controllers/admin/AdminWuunderConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,12 @@ private function buildWuunderData($order_info)

// Load product image for first ordered item
$image = null;
if (file_exists('../img/p/' . $order_info['id_product'] . '/' . $order_info['id_product'] . '-home_default.jpg')) {
$image = base64_encode(Tools::file_get_contents('../img/p/' . $order_info['id_product'] . '/' . $order_info['id_product'] . '-home_default.jpg'));
$image= Image::getCover($order_info['id_product']);
$product = new Product(($order_info['id_product']));
$protocol = array_key_exists('HTTPS', $_SERVER) && $_SERVER['HTTPS'] == "on"? 'https://' : 'http://';
$imagePath = $protocol . Link::getImageLink($product->link_rewrite[Context::getContext()->language->id], $image['id_image'], 'home_default');
if ($imagePath) {
$image = base64_encode(Tools::file_get_contents($imagePath));
}
$product_data = $this->getOrderProductDetails($order_info['id_product']);
$length = round($product_data['depth']);
Expand Down Expand Up @@ -368,9 +372,9 @@ public function initContent()
Context::getContext()->smarty->registerPlugin("function", "order_state", array($this, 'getOrderState'));
Context::getContext()->smarty->assign(
array(
'version' => (float)_PS_VERSION_,
'order_info' => $order_info,
'admin_url' => ((_PS_VERSION_ < '1.7') ? _PS_BASE_URL_ . __PS_BASE_URI__ . end($path) . "/" : "") . $link->getAdminLink('AdminWuunderConnector', true),)
'version' => (float)_PS_VERSION_,
'order_info' => $order_info,
'admin_url' => ((_PS_VERSION_ < '1.7') ? _PS_BASE_URL_ . __PS_BASE_URI__ . end($path) . "/" : "") . $link->getAdminLink('AdminWuunderConnector', true),)
);
$this->setTemplate('AdminWuunderConnector.tpl');
parent::initContent();
Expand Down
2 changes: 1 addition & 1 deletion wuunderconnector/views/css/admin/datatable.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion wuunderconnector/views/js/admin/datatable.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* needs please refer to http://www.prestashop.com for more information.
*
* @author Wuunder Nederland BV
* @copyright 2015-2019 Wuunder Holding B.V.
* @copyright 2015-2020 Wuunder Holding B.V.
* @license LICENSE.txt
*}

Expand Down
24 changes: 24 additions & 0 deletions wuunderconnector/views/templates/admin/WuunderCarrierContent.tpl
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
{**
* 2007-2016 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author Wuunder Nederland BV
* @copyright 2015-2020 Wuunder Holding B.V.
* @license LICENSE.txt
*}

<h2>{$title}</h2>
{foreach from=$errors item=error}
<div class="alert error"><img src="{$psimg}admin/forbbiden.gif" alt="nok"/>&nbsp;{$error}</div>
Expand Down
4 changes: 2 additions & 2 deletions wuunderconnector/views/templates/hook/javascript_ini.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
* needs please refer to http://www.prestashop.com for more information.
*
* @author Wuunder Nederland BV
* @copyright 2015-2019 Wuunder Holding B.V.
* @copyright 2015-2020 Wuunder Holding B.V.
* @license LICENSE.txt
*}
<script type="text/javascript">
{if $version > 1.6}
{literal}
var shippingCarrierId = "{/literal}{$carrier_id}{literal}";
// Get the modal
var parcelshopAddress = {/literal}{$cookieParcelshopAddress|@json_encode nofilter}{literal};
var parcelshopAddress = {/literal}{$cookieParcelshopAddress|@json_encode}{literal};
if (parcelshopAddress !== "") {
var parcelshopId = "{/literal}{$cookieParcelshopId}{literal}";
}
Expand Down
Loading

0 comments on commit 2e6993d

Please sign in to comment.