Skip to content

Commit

Permalink
Merge remote-tracking branch 'mainline/develop' into BUGS
Browse files Browse the repository at this point in the history
# Conflicts:
#	composer.lock
  • Loading branch information
slavvka committed Jun 29, 2017
2 parents b96f060 + 3993417 commit ae5f35e
Show file tree
Hide file tree
Showing 13 changed files with 299 additions and 193 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,15 @@ define([
var productSku = this.variationsComponent().getProductValue('sku'),
productPrice = this.variationsComponent().getProductPrice(),
productWeight = this.variationsComponent().getProductValue('weight'),
productName = this.variationsComponent().getProductValue('name'),
variationsKeys = [],
gridExisting = [],
gridNew = [],
gridDeleted = [];

this.variations = [];
_.each(variations, function (options) {
var product, images, sku, quantity, price, variation,
var product, images, sku, name, quantity, price, variation,
productId = this.variationsComponent().getProductIdByOptions(options);

if (productId) {
Expand All @@ -110,6 +111,9 @@ define([
sku = productSku + _.reduce(options, function (memo, option) {
return memo + '-' + option.label;
}, '');
name = productName + _.reduce(options, function (memo, option) {
return memo + '-' + option.label;
}, '');
quantity = getSectionValue('quantity', options);

if (!quantity && productId) {
Expand All @@ -128,7 +132,7 @@ define([
options: options,
images: images,
sku: sku,
name: sku,
name: name,
quantity: quantity,
price: price,
productId: productId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

?>
<div class="block newsletter">
<div class="title"><strong><?php /* @escapeNotVerified */ echo __('Newsletter') ?></strong></div>
<div class="title"><strong><?php echo $block->escapeHtml(__('Newsletter')) ?></strong></div>
<div class="content">
<form class="form subscribe"
novalidate
Expand Down
3 changes: 2 additions & 1 deletion app/code/Magento/Quote/Model/Quote.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Magento\Framework\Model\AbstractExtensibleModel;
use Magento\Quote\Api\Data\PaymentInterface;
use Magento\Quote\Model\Quote\Address;
use Magento\Quote\Model\Quote\Address\Total as AddressTotal;
use Magento\Sales\Model\Status;

/**
Expand Down Expand Up @@ -1944,7 +1945,7 @@ public function collectTotals()
/**
* Get all quote totals (sorted by priority)
*
* @return array
* @return AddressTotal[]
*/
public function getTotals()
{
Expand Down
6 changes: 4 additions & 2 deletions app/code/Magento/Quote/Model/Quote/Address/Total.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,21 @@
namespace Magento\Quote\Model\Quote\Address;

/**
* @method string getCode()
*
* @api
*/
class Total extends \Magento\Framework\DataObject
{
/**
* @var array
*/
protected $totalAmounts;
protected $totalAmounts = [];

/**
* @var array
*/
protected $baseTotalAmounts;
protected $baseTotalAmounts = [];

/**
* Serializer interface instance.
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/Quote/Model/Quote/Address/TotalFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ public function __construct(\Magento\Framework\ObjectManagerInterface $objManage
*
* @param string $instanceName
* @param array $data
* @return \Magento\Quote\Model\Quote\Address\Total\AbstractTotal
* @return Total\AbstractTotal|Total
*/
public function create($instanceName, array $data = [])
public function create($instanceName = Total::class, array $data = [])
{
return $this->_objectManager->create($instanceName, $data);
}
Expand Down
18 changes: 8 additions & 10 deletions app/code/Magento/Quote/Model/Quote/TotalsReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ public function __construct(
/**
* @param \Magento\Quote\Model\Quote $quote
* @param array $total
* @return array
* @return Total[]
*/
public function fetch(\Magento\Quote\Model\Quote $quote, array $total)
{
$output = [];
$total = $this->totalFactory->create(\Magento\Quote\Model\Quote\Address\Total::class)->setData($total);
$total = $this->totalFactory->create()->setData($total);
/** @var ReaderInterface $reader */
foreach ($this->collectorList->getCollectors($quote->getStoreId()) as $reader) {
$data = $reader->fetch($quote, $total);
Expand All @@ -62,7 +62,7 @@ public function fetch(\Magento\Quote\Model\Quote $quote, array $total)

/**
* @param array $total
* @return Total|array
* @return Total|Total[]
*/
protected function convert($total)
{
Expand All @@ -73,22 +73,20 @@ protected function convert($total)
if (count(array_column($total, 'code')) > 0) {
$totals = [];
foreach ($total as $item) {
$totals[] = $this->totalFactory->create(
\Magento\Quote\Model\Quote\Address\Total::class
)->setData($item);
$totals[] = $this->totalFactory->create()->setData($item);
}
return $totals;
}

return $this->totalFactory->create(\Magento\Quote\Model\Quote\Address\Total::class)->setData($total);
return $this->totalFactory->create()->setData($total);
}

/**
* @param Total $totalInstance
* @param array $output
* @return array
* @param Total[] $output
* @return Total[]
*/
protected function merge($totalInstance, $output)
protected function merge(Total $totalInstance, $output)
{
if (array_key_exists($totalInstance->getCode(), $output)) {
$output[$totalInstance->getCode()] = $output[$totalInstance->getCode()]->addData(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,11 +297,16 @@ define([
ko.utils.arrayForEach(options, function (option) {
var value = applyToObject(option, optionsValue, option),
label = applyToObject(option, optionsText, value) || '',
disabled = applyToObject(option, 'disabled', false) || false,
obj = {},
space = '\u2007\u2007\u2007';

obj[optionTitle] = applyToObject(option, optionsText + 'title', value);

if (disabled) {
obj.disabled = disabled;
}

label = label.replace(nbspRe, '').trim();

if (Array.isArray(value)) {
Expand Down
8 changes: 2 additions & 6 deletions app/code/Magento/Usps/Model/Carrier.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile

namespace Magento\Usps\Model;

use Magento\Framework\App\ObjectManager;
Expand Down Expand Up @@ -413,7 +411,6 @@ protected function _getXmlQuotes()

if ($this->_isUSCountry($r->getDestCountryId())) {
$xml = $this->_xmlElFactory->create(

['data' => '<?xml version="1.0" encoding="UTF-8"?><RateV4Request/>']
);
$xml->addAttribute('USERID', $r->getUserId());
Expand Down Expand Up @@ -461,7 +458,6 @@ protected function _getXmlQuotes()
$api = 'RateV4';
} else {
$xml = $this->_xmlElFactory->create(

['data' => '<?xml version = "1.0" encoding = "UTF-8"?><IntlRateV2Request/>']
);
$xml->addAttribute('USERID', $r->getUserId());
Expand Down Expand Up @@ -1946,7 +1942,7 @@ protected function _doShipmentRequest(\Magento\Framework\DataObject $request)
*/
public function getContainerTypes(\Magento\Framework\DataObject $params = null)
{
if (is_null($params)) {
if ($params === null) {
return $this->_getAllowedContainers();
}

Expand Down Expand Up @@ -2068,7 +2064,7 @@ protected function _parseZip($zipString, $returnFull = false)
private function isServiceAvailable(\SimpleXMLElement $service)
{
// Allow services which which don't provide any ExtraServices
if(empty($service->ExtraServices->children()->count())) {
if (empty($service->ExtraServices->children()->count())) {
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ body._in-resize {
.action-menu {
left: auto;
min-width: 10rem;
right: 0;
right: auto;
text-align: left;
top: auto;
z-index: 1;
Expand Down
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,5 @@
"Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/"
}
},
"minimum-stability": "alpha",
"prefer-stable": true
}
Loading

0 comments on commit ae5f35e

Please sign in to comment.