Skip to content

Commit

Permalink
6.44.2 (FINAL RELEASE)
Browse files Browse the repository at this point in the history
  • Loading branch information
m2epro committed Aug 17, 2023
1 parent 138c8b9 commit e66fe5c
Show file tree
Hide file tree
Showing 22 changed files with 67 additions and 125 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -550,11 +550,6 @@ public function canDisplayInternationalShippingRateTable()
return $this->getMarketplace()->getChildObject()->isInternationalShippingRateTableEnabled();
}

public function canDisplayCashOnDeliveryCost()
{
return $this->getMarketplace()->getChildObject()->isCashOnDeliveryEnabled();
}

public function canDisplayNorthAmericaCrossBorderTradeOption()
{
$marketplace = $this->getMarketplace();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ public function getData()
$this->getShippingTemplate()->isLocalShippingCalculatedEnabled()) {
$data['dispatch_time'] = $this->getShippingSource()->getDispatchTime();

// there are permissions by marketplace (interface management)
$data['cash_on_delivery_cost'] = $this->getShippingTemplate()->getCashOnDeliveryCost();

// there are permissions by marketplace (interface management)
if ($this->getShippingTemplate()->isCrossBorderTradeNorthAmerica()) {
$data['cross_border_trade'] = self::CROSS_BORDER_TRADE_NORTH_AMERICA;
Expand Down
8 changes: 0 additions & 8 deletions app/code/community/Ess/M2ePro/Model/Ebay/Marketplace.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,6 @@ public function isManagedPaymentsEnabled()
return (bool)(int)$this->getData('is_managed_payments');
}

/**
* @return bool
*/
public function isCashOnDeliveryEnabled()
{
return (bool)(int)$this->getData('is_cash_on_delivery');
}

/**
* @return bool
*/
Expand Down
10 changes: 0 additions & 10 deletions app/code/community/Ess/M2ePro/Model/Ebay/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -326,16 +326,6 @@ public function getShippingDateTo()
return $this->getData('shipping_date_to');
}

/**
* @return float
*/
public function getCashOnDeliveryCost()
{
$shippingDetails = $this->getShippingDetails();
return isset($shippingDetails['cash_on_delivery_cost'])
? (float)$shippingDetails['cash_on_delivery_cost'] : 0.0;
}

/**
* @return Ess_M2ePro_Model_Ebay_Order_ShippingAddress
*/
Expand Down
1 change: 0 additions & 1 deletion app/code/community/Ess/M2ePro/Model/Ebay/Order/Proxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ public function getPaymentData()
'payment_method' => $paymentMethodTitle,
'channel_order_id' => $this->_order->getEbayOrderId(),
'channel_final_fee' => $this->convertPrice($this->_order->getFinalFee()),
'cash_on_delivery_cost' => $this->convertPrice($this->_order->getCashOnDeliveryCost()),
'transactions' => $this->getPaymentTransactions(),
'tax_id' => $this->_order->getBuyerTaxId(),
);
Expand Down
14 changes: 0 additions & 14 deletions app/code/community/Ess/M2ePro/Model/Ebay/Template/Shipping.php
Original file line number Diff line number Diff line change
Expand Up @@ -714,20 +714,6 @@ public function getExcludedLocations()
return is_array($excludedLocations) ? $excludedLocations : array();
}

/**
* @return float|null
*/
public function getCashOnDeliveryCost()
{
$tempData = $this->getData('cash_on_delivery_cost');

if (!empty($tempData)) {
return (float)$tempData;
}

return null;
}

// ---------------------------------------

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,6 @@ protected function prepareData()
$data['excluded_locations'] = $this->_rawData['excluded_locations'];
}

$key = 'cash_on_delivery_cost';
$data[$key] = (isset($this->_rawData[$key]) && $this->_rawData[$key] != '') ? $this->_rawData[$key] : null;

$modes = array(
'local_shipping_mode',
'local_shipping_discount_promotional_mode',
Expand Down Expand Up @@ -340,7 +337,6 @@ public function getDefaultData()
'dispatch_time_mode' => Shipping::DISPATCH_TIME_MODE_VALUE,
'dispatch_time_value' => 1,
'dispatch_time_attribute' => '',
'cash_on_delivery_cost' => null,
'global_shipping_program' => 0,
'cross_border_trade' => Shipping::CROSS_BORDER_TRADE_NONE,
'excluded_locations' => Mage::helper('M2ePro')->jsonEncode(array()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public function isShippingDifferent()
'international_shipping_discount_promotional_mode',
'international_shipping_discount_combined_profile_id',
'excluded_locations',
'cash_on_delivery_cost',
'cross_border_trade',
'local_shipping_rate_table_mode',
'local_shipping_rate_table',
Expand Down
2 changes: 1 addition & 1 deletion app/code/community/Ess/M2ePro/Model/Magento/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function assignData($data)
'payment_method' => $data['payment_method'],
'channel_order_id' => $data['channel_order_id'],
'channel_final_fee' => $data['channel_final_fee'],
'cash_on_delivery_cost' => $data['cash_on_delivery_cost'],
'cash_on_delivery_cost' => isset($data['cash_on_delivery_cost']) ? $data['cash_on_delivery_cost'] : null,
'transactions' => $data['transactions'],
'tax_id' => isset($data['tax_id']) ? $data['tax_id'] : null,
);
Expand Down
7 changes: 6 additions & 1 deletion app/code/community/Ess/M2ePro/Model/Magento/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,12 @@ public function getBundleDefaultQty($productId)

foreach ($items as $item) {
if ((int)$item->getId() === (int)$productId) {
return $item->getSelectionQty();
$qty = (int)$item->getSelectionQty();
if ($qty > 0) {
return $qty;
}

return 1;
}
}

Expand Down
2 changes: 1 addition & 1 deletion app/code/community/Ess/M2ePro/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "m2epro/magento1-extension",
"description": "M2E Pro is a Magento trusted (TM), award-winning extension, which allows merchants of all sizes to fully integrate Magento based system(s) into eBay/Amazon/Walmart platforms.",
"type": "magento-module",
"version": "6.44.1",
"version": "6.44.2",
"license": "proprietary",
"keywords": ["ebay", "amazon", "walmart", "magento"],
"homepage": "https://www.m2epro.com/",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ public function getCategoriesJsonAction()
);
$treeBlock->setSelectedIds($selectedProductsIds);

$this->getResponse()->setHeader('Content-Type', 'application/json');
$this->getResponse()->setBody(
$treeBlock->getCategoryChildrenJson($this->getRequest()->getParam('category'))
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ public function getCategoriesJsonAction()
$treeBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_ebay_listing_product_sourceCategories_tree');
$treeBlock->setSelectedIds($selectedProductsIds);

$this->getResponse()->setHeader('Content-Type', 'application/json');
$this->getResponse()->setBody(
$treeBlock->getCategoryChildrenJson($this->getRequest()->getParam('category'))
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,7 @@ public function getCategoriesJsonAction()
);
$treeBlock->setSelectedIds($selectedProductsIds);

$this->getResponse()->setHeader('Content-Type', 'application/json');
$this->getResponse()->setBody(
$treeBlock->getCategoryChildrenJson($this->getRequest()->getParam('category'))
);
Expand Down
2 changes: 1 addition & 1 deletion app/code/community/Ess/M2ePro/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<config>
<modules>
<Ess_M2ePro>
<version>6.44.1</version>
<version>6.44.2</version>
</Ess_M2ePro>
</modules>
<default>
Expand Down
47 changes: 22 additions & 25 deletions app/code/community/Ess/M2ePro/sql/Install/Ebay.php
Original file line number Diff line number Diff line change
Expand Up @@ -466,15 +466,13 @@ public function execute()
`is_english_measurement_system` TINYINT(2) UNSIGNED NOT NULL DEFAULT 0,
`is_metric_measurement_system` TINYINT(2) UNSIGNED NOT NULL DEFAULT 0,
`is_managed_payments` TINYINT(2) UNSIGNED NOT NULL DEFAULT 0,
`is_cash_on_delivery` TINYINT(2) UNSIGNED NOT NULL DEFAULT 0,
`is_global_shipping_program` TINYINT(2) UNSIGNED NOT NULL DEFAULT 0,
`is_charity` TINYINT(2) UNSIGNED NOT NULL DEFAULT 0,
`is_return_description` TINYINT(2) UNSIGNED NOT NULL DEFAULT 0,
`is_epid` TINYINT(2) UNSIGNED NOT NULL DEFAULT 0,
`is_ktype` TINYINT(2) UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`marketplace_id`),
INDEX `is_calculated_shipping` (`is_calculated_shipping`),
INDEX `is_cash_on_delivery` (`is_cash_on_delivery`),
INDEX `is_managed_payments` (`is_managed_payments`),
INDEX `is_charity` (`is_charity`),
INDEX `is_english_measurement_system` (`is_english_measurement_system`),
Expand Down Expand Up @@ -926,7 +924,6 @@ public function execute()
`local_shipping_mode` TINYINT(2) UNSIGNED NOT NULL DEFAULT 0,
`local_shipping_discount_promotional_mode` TINYINT(2) UNSIGNED NOT NULL DEFAULT 0,
`local_shipping_discount_combined_profile_id` TEXT DEFAULT NULL,
`cash_on_delivery_cost` VARCHAR(255) DEFAULT NULL,
`international_shipping_mode` TINYINT(2) UNSIGNED NOT NULL DEFAULT 0,
`international_shipping_discount_promotional_mode` TINYINT(2) UNSIGNED NOT NULL DEFAULT 0,
`international_shipping_discount_combined_profile_id` TEXT DEFAULT NULL,
Expand Down Expand Up @@ -1087,28 +1084,28 @@ public function execute()
(22, 216, 'Singapore', 'Singapore', 'ebay.com.sg', 0, 20, 'Asia / Pacific', 'ebay', NOW(), NOW());
INSERT INTO `{$this->_installer->getTable('m2epro_ebay_marketplace')}` VALUES
(1, 'USD', 'us', 'en_US', 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0),
(2, 'CAD', 'ca', 'en_CA', 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0),
(3, 'GBP', 'gb', 'en_GB', 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1),
(4, 'AUD', 'au', 'en_AU', 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1),
(5, 'EUR', 'at', 'de_AT', 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0),
(6, 'EUR', 'be', 'nl_BE', 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0),
(7, 'EUR', 'fr', 'fr_FR', 1,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 0, 0, 1, 0, 0, 0),
(12, 'EUR', 'nl', 'nl_NL', 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0),
(13, 'EUR', 'es', 'es_ES', 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1),
(14, 'CHF', 'ch', 'fr_CH', 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0),
(15, 'HKD', 'hk', 'zh_HK', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0),
(16, 'INR', 'in', 'hi_IN', 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0),
(17, 'EUR', 'ie', 'en_IE', 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0),
(18, 'MYR', 'my', 'ms_MY', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0),
(19, 'CAD', 'ca', 'fr_CA', 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0),
(20, 'PHP', 'ph', 'fil_PH', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0),
(21, 'PLN', 'pl', 'pl_PL', 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0),
(22, 'SGD', 'sg', 'zh_SG', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0);
SQL
);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

// @codingStandardsIgnoreFile

class Ess_M2ePro_Sql_Update_y23_m08_RemoveCashOnDelivery extends
Ess_M2ePro_Model_Upgrade_Feature_AbstractFeature
{
public function execute()
{
$this->_installer->getTableModifier('ebay_marketplace')
->dropColumn('is_cash_on_delivery');
$this->_installer->getTableModifier('ebay_template_shipping')
->dropColumn('cash_on_delivery_cost');
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

/**
* @author M2E Pro Developers Team
* @copyright M2E LTD
* @license Commercial use is forbidden
*/

class Ess_M2ePro_Sql_Upgrade_v6_44_1__v6_44_2_Config extends Ess_M2ePro_Model_Upgrade_Feature_AbstractConfig
{
public function getFeaturesList()
{
return array(
'@y23_m08/RemoveCashOnDelivery',
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -357,17 +357,6 @@ echo $this->getChildHtml('item_edit');
</td>
</tr>

<?php if ($this->order->getChildObject()->getCashOnDeliveryCost() > 0): ?>
<tr>
<td class="label"><?php echo Mage::helper('M2ePro')->__('Cash On Delivery Cost');?>:</td>
<td class="value">
<strong>
<?php echo Mage::getSingleton('M2ePro/Currency')->formatPrice($this->order->getChildObject()->getCurrency(), round($this->order->getChildObject()->getCashOnDeliveryCost(), 2)); ?>
</strong>
</td>
</tr>
<?php endif; ?>

</tbody>
</table>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -870,26 +870,6 @@ $missingAttributes = $this->getMissingAttributes();
</td>
</tr>

<?php if ($this->canDisplayCashOnDeliveryCost()): ?>
<tr id="cash_on_delivery_cost_cv_tr" class="cash-on-delivery-tr" style="display: none;">
<td class="label">
<label for="cash_on_delivery_cost"><?php echo Mage::helper('M2ePro')->__('"Cash On Delivery" Cost'); ?>:</label>
</td>
<td class="value" style="width: auto;">
<input
id="cash_on_delivery_cost"
name="shipping[cash_on_delivery_cost]"
type="text"
value="<?php echo $this->escapeHtml($formData['cash_on_delivery_cost']); ?>"
class="input-text M2ePro-validation-float"
/>
<p class="note">
<span><?php echo Mage::helper('M2ePro')->__('Required when using COD Payment Method.'); ?></span>
</p>
</td>
</tr>
<?php endif; ?>

</table>

</div>
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "m2epro/magento1-extension",
"description": "M2E Pro is a Magento trusted (TM), award-winning extension, which allows merchants of all sizes to fully integrate Magento based system(s) into eBay/Amazon/Walmart platforms.",
"type": "magento-module",
"version": "6.44.1",
"version": "6.44.2",
"license": "proprietary",
"keywords": ["ebay", "amazon", "walmart", "magento"],
"homepage": "https://www.m2epro.com/",
Expand Down
18 changes: 0 additions & 18 deletions js/M2ePro/Ebay/Template/Shipping.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ window.EbayTemplateShipping = Class.create(Common, {

// ---------------------------------------
EbayTemplateShippingObj.updateMeasurementVisibility();
EbayTemplateShippingObj.updateCashOnDeliveryCostVisibility();
EbayTemplateShippingObj.updateCrossBorderTradeVisibility();
EbayTemplateShippingObj.updateRateTableVisibility('local');
EbayTemplateShippingObj.updateLocalHandlingCostVisibility();
Expand Down Expand Up @@ -736,23 +735,6 @@ window.EbayTemplateShipping = Class.create(Common, {

// ---------------------------------------

updateCashOnDeliveryCostVisibility: function() {
if (!$('cash_on_delivery_cost_cv_tr')) {
return;
}

if (EbayTemplateShippingObj.isLocalShippingModeFlat()
|| EbayTemplateShippingObj.isLocalShippingModeCalculated()
) {
$('cash_on_delivery_cost_cv_tr').show();
} else {
$('cash_on_delivery_cost_cv_tr').hide();
$('cash_on_delivery_cost').value = '';
}
},

// ---------------------------------------

packageSizeChange: function() {
var self = EbayTemplateShippingObj;

Expand Down

0 comments on commit e66fe5c

Please sign in to comment.