GithubHelp home page GithubHelp logo

magmodules / magento2-channable Goto Github PK

View Code? Open in Web Editor NEW
28.0 28.0 40.0 991 KB

Channable Connect for Magento® 2

Home Page: https://marketplace.magento.com/magmodules-magento2-channable.html

License: BSD 2-Clause "Simplified" License

PHP 92.05% HTML 3.37% JavaScript 1.73% Less 2.85%

magento2-channable's People

Contributors

albsa avatar basselalaraaj avatar bogardo avatar evs-xsarus avatar florisschreuder avatar frank-bokdam avatar frank-magmodules avatar hexmage avatar jonathanbbd avatar julian-van-drielen avatar kaplansin avatar markvds avatar marvin-magmodules avatar niels-p avatar pieterscheffers avatar sanderjongsma avatar swahjak avatar tdgroot avatar umizoomi avatar wahidnory avatar wouter-toppy avatar yaroslav-zenin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

magento2-channable's Issues

Orders Imported from Channable have cart rules applied

We have a cart price rule set up in Magento that doesn't have a code and so it auto-applies if the items match with the Actions rules when a customer puts them in their cart.

However, when orders are imported through Channable into our Magento shop, they seem to also be running through that logic and so the order prices in Magento don't match what was actually paid on the marketplace (Amazon, in this case).

Is there a setting or a way to have the imported orders bypass any cart pricing rules so that the prices paid on the marketplace are the ones that are also in the Magento order?

[REQUEST] COUNT-query is executed twice in feed

Channable needs to know the product collection size on two occasions:

  • to validate and count the amount of available pages
  • to pass the total number of products in the feed summary

To do this, the COUNT-query is executed twice. This introduces a performance issue when using a large product set.

issue with async sales order grid update

Hi, when you enable Asynchronous Order Processing(link), the cron that takes care of this, raises an error:

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'channable_id' cannot be null, query was: INSERT INTO sales_order_grid (entity_id,status,store_id,store_name,customer_id,base_grand_total,base_total_paid,grand_total,total_paid,increment_id,base_currency_code,order_currency_code,shipping_name,billing_name,created_at,updated_at,billing_address,shipping_address,shipping_information,customer_email,customer_group,subtotal,shipping_and_handling,customer_name,payment_method,total_refunded,signifyd_guarantee_status,channable_id,channel_id,channel_name,channel_label) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE entity_id = VALUES(entity_id), status = VALUES(status), store_id = VALUES(store_id), store_name = VALUES(store_name), customer_id = VALUES(customer_id), base_grand_total = VALUES(base_grand_total), base_total_paid = VALUES(base_total_paid), grand_total = VALUES(grand_total), total_paid = VALUES(total_paid), increment_id = VALUES(increment_id), base_currency_code = VALUES(base_currency_code), order_currency_code = VALUES(order_currency_code), shipping_name = VALUES(shipping_name), billing_name = VALUES(billing_name), created_at = VALUES(created_at), updated_at = VALUES(updated_at), billing_address = VALUES(billing_address), shipping_address = VALUES(shipping_address), shipping_information = VALUES(shipping_information), customer_email = VALUES(customer_email), customer_group = VALUES(customer_group), subtotal = VALUES(subtotal), shipping_and_handling = VALUES(shipping_and_handling), customer_name = VALUES(customer_name), payment_method = VALUES(payment_method), total_refunded = VALUES(total_refunded), signifyd_guarantee_status = VALUES(signifyd_guarantee_status), channable_id = VALUES(channable_id), channel_id = VALUES(channel_id), channel_name = VALUES(channel_name), channel_label = VALUES(channel_label).

This error is shown in the cron_schedule table for job_code sales_grid_order_async_insert.

At this moment I'm not sure if this is something you can fix or if this is a shortcoming of the async functionality.

GetOrderIdPrefix() returns bool

Version 1.6.0 / Magento version 2.3.7-p2
/vendor/magmodules/magento2-channable/Model/Config/System/OrderRepository.php line 157.

The order id prefix configuration returns a boolean instead of the saved string. This results in a 500 error.

Issue paging after updating 1.4.0 -> 1.4.6

Hi,

After updating the module to 1.4.6 the paging is not working and only the first page size is send to Channable. We are currently running at Magento 2.2.7. I assume that this is caused by the release that fixes the paging issue (1.4.2) for 2.3.

Thanks
Stefan

price_config not defined in $config when called in processPrice

In \Magmodules\Channable\Helper\Product, when calling processPrice, the $config variable does not contain the ['price_config] key anymore. This did exist in 1.5.2.

As a result, all isset() calls on values inside it return false, so any exchange rates/configuration is ignored.

Security Issues

Model/Item.php - Line 367
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, false);

Helper/General.php - Line 196 and Line 219
$value = @unserialize($value);

Magento 2.2 upgrade - Serialized data

Upgrade to Magento 2.2 gives this error:
1 exception(s):
Exception #0 (InvalidArgumentException): Unable to unserialize value.

Exception #0 (InvalidArgumentException): Unable to unserialize value.
#0 vendor/magento/module-config/Model/Config/Backend/Serialized.php(55): Magento\Framework\Serialize\Serializer\Json->unserialize('a:357:{s:18:"_1...')
#1 vendor/magento/framework/Model/AbstractModel.php(601): Magento\Config\Model\Config\Backend\Serialized->_afterLoad()

The reason is that Magento changed their way serialized is stored in the database.
Before Magento 2.2, this was as serialized but from 2.2 is is like json_encoded.

See also:
http://devdocs.magento.com/guides/v2.2/ext-best-practices/tutorials/serialized-to-json-data-upgrade.html

Compatibility issue with Amasty Shop By module

There seems to be a compatibility issue with the latest version of the Amasty Shop By module (v1.18.4). The issue breaks all the direct links to filter pages; f.e. domain.com/filter/brandname, resulting in a lot of 404 not found pages.

I've reached out to Amasty and they have replied with the following;

To resolve this issue, a following file was changed:
vendor/magmodules/magento2-channable/Plugin/AroundIsAllowedRequest.php
And here's the link to download the changed file: 357024.97.zip

Could you check if can be fixed from your side? If you need more information, please let me know.

Importer not working with Amasty Sorting extension installed on Magento 2.2.0

We have a Magento ver. 2.2.0 and installed the channable extension and connect this Magento on https://app.channable.com/
On this Magento, we have installed Amasty Sorting extension and when we want to download/add products on https://app.channable.com/ we have an error

We could not import the Magento product information

Solution: We recommend an unrecognizable answer from the Magento plugin,
check whether the plugin is installed correctly.
Follow this support article to check your Magento plugin...

error
After checking the backend code, we have found that issue is with this extension (channable extension is trying to find DB unknown table name, probably DB table alias name from Amasty extension ). If this extension is disabled, the importer is working.

Question: what is LVB?

This is not a real issue, but I did not know where else to go.... I'm looking into the release notes and code and I see quite some times LVB. What does it stand for?

"Failed address validation: Email has a wrong format"

Description

We've been debugging an issue since we configured the Channable module to not import customers ("Stores > Configuration > Magmodules > Order Import > Import Customers" => "No").

Since we configured the Channable module not to import customers we kept getting the below response when Channable tried to send orders to Magento (/channable/order/hook).

{"validated":"false","errors":"Failed address validation:\nEmail has a wrong format"}

Cause

Inside Magento\Quote\Model\Quote\Address\ToOrderAddress::convert(Address $address, $data = []) the $data argument is used to pass additional information into the resulting address ($orderAddress).

In Magento\Quote\Model\QuoteManagement:submitQuote(QuoteEntity $quote, $orderData = []) this method is used to convert the quote address into an order address (line 520 and 532).

In both cases the $data argument is passed with two keys. address_type and email, which are meant to additionally add "address_type" and "email" to the resulting order address. It though seems that $quote->getCustomerEmail() (which is used for the email key) is returning null, resulting in the e-mail being passed to be null as well (causing the validation failure).

Why is this? Depending on the checkout method for the quote ($quote->getCheckoutMethod()) the customer information is set (Magento\Quote\Model\QuoteManagement::placeOrder on line 387). But debugging this it seems that the checkout method is not set for the quote ($quote->getCheckoutMethod() returning null). Which is causing the customer e-mail not to be set etc.

Possible Solution

Inside Magmodules\Channable\Model\Order the customer information of the quote is set depending on the $this->importCustomer ("Stores > Configuration > Magmodules > Order Import > Import Customers").

It might be enough to set the checkout method using ->setCheckoutMethod(CartManagementInterface::METHOD_GUEST) method.

 else {
    $customerId = 0;
    $cart->setCustomerId($customerId)
        ->setCustomerEmail($email)
        ->setCustomerFirstname($data['customer']['first_name'])
        ->setCustomerMiddlename($data['customer']['middle_name'])
        ->setCustomerLastname($data['customer']['last_name'])
        ->setCustomerIsGuest(true)
        ->setCustomerGroupId(GroupInterface::NOT_LOGGED_IN_ID)
        ** ->setCheckoutMethod(CartManagementInterface::METHOD_GUEST); **
}

Extension issue

I installed this extension and i am using magento version : 2.4.2
extension version is 1.4.19.

image
when i click on these both links then my page is showing 404 error

Composer Checksum verification fails

Bildschirmfoto 2019-12-22 um 13 28 03

 - Installing magmodules/magento2-channable (1.4.2): Downloading (100%)         
                                                                                                                                                                              
  [UnexpectedValueException]                                                                                                                                                  
  The checksum verification of the file failed (downloaded from https://api.github.com/repos/magmodules/magento2-channable/zipball/e8610ed524394549e69fa4e1a9d4ee2c1a77a336)  
                                                                                                                                                                              

Missing products from configurables since 1.4.6.

Since we updated the extension to version 1.4.7, no configurable products will be added to the feed when the stock filter is enabled.

I think this is caused by a change in this commit:

464856e#diff-653dbe4738abac6f25c4d1e94b4337cc

Where in Helper/Product.php the line

if ($parent->getIsInStock() == 0) {

Is replace by

if ($parent->getIsSalable() && $parent->getIsInStock()) {

This means that a product where his parent is salable and has stock, the simple product cannot be validated.

Maybe it has to be:

if (!$parent->getIsSalable() || !$parent->getIsInStock()) {

[QUESTION] Webhook test order additional parameters

Hi Magmodules,

I'm working on debugging an issue which involves order information which is handled by another third-party extension. I'm looking for a way to change order data related to the customer address information when using the webhook.

Is there a way to specify a custom invoice and shipment address when generating a test order?

Speed up product feed

In Magmodules\Channable\Helper\Source::getProductFilters all visibility types will be added when: if (!empty($filters['relations'])) { this results in a very complex and slow query when Magmodules\Channable\Model\Generate::generateByStore calls getCollectionCountWithFilters.

When replacing:
array_push($filters['visibility'], Visibility::VISIBILITY_NOT_VISIBLE);
to:
$filters['visibility'] = array();
in Magmodules\Channable\Helper\Source the query gets processed a lot faster.

Each method must have a doc block

During install bin/magento setup:upgrade we see this message (seen first now)

Can it be a doc block is missing; would have been nice if the logging showed us which method

Each method must have a doc block. See Magento\Eav\Api\AttributeSetRepositoryInterface::getList()

Maybe do quick inspect? https://blog.jetbrains.com/phpstorm/2011/05/phpdoc-inspections/

I am not sure this is blocking, but after running install for this module we also see this in our logs

`[2019-04-22 13:08:40] main.ERROR: Please upgrade your database: Run "bin/magento setup:upgrade" from the Magento root directory.
The following modules are outdated:
Magmodules_Channable data: current version - none, required version - 1.4.5 [] []`

"bin/magento setup:upgrade" was of course run (several times now)

Installation was done like

composer require magmodules/magento2-channable
bin/magento module:enable Magmodules_Channable
bin/magento setup:upgrade

executing ` bin/magento module:disable Magmodules_Channable
The following modules have been disabled:

  • Magmodules_Channable
    ` makes the website work again.

So something must be going wrong here

Improve performance of collection query in feed

The query to determine the product collection for a single page is terribly slow. This slowdown is caused by a suboptimal ORDER BY statement which results in the database having to use filesort.

Order import not working with new M2 2.3.2 release

I was working through the 2.3.2 release and testing things out and, overall, there's nothing terribly breaking in there. There are some security fixes around the APIs which may have something to do with this and then there's some changes around orders too.

In any case, when I was making sure that orders from Channable were imported into Magento on 2.3.2 (using version 1.4.9 of the extension), the Channable dashboard reported a 302 error each time and the order failed to be imported. There was no log information either, so I'm not fully sure what the issue really is.

Let me know if there's anything I can test out on my end or any known information on this. Thanks!

Trying to access array offset on value of type bool in Model/Item.php

For one of our clients we run into the following error that prevents the feed to be generated correctly:

Channable.INFO: Generate: Notice: Trying to access array offset on value of type bool in 
.../vendor/magmodules/magento2-channable/Model/Item.php on line 118 [] []

After adding some logging it seems that in this case the $row is false. Adding an extra if statement fixes the problem temporary but it shouldn't be possible to get a false here.

We run version 1.4.20.
The issue has been occured since we're on php 7.4 and mysql 8 with Magento 2.4.1-p1.
I hope you can reproduce the issue.

Shipping and deposit costs

Hi,

We are using Channable together with bol.com and all the products on bol.com have shipping and FPT (Fixed Product Tax) costs already included. Once an order is placed at bol.com and exported to Magento, the shipping and FPT costs are added for those products again. This leads to incorrect values in the orders in Magento and in the invoices that clients receive.

I managed to fix the problem with shipping costs by simply adding $shippingAddress->setData('free_shipping', true); inside importOrder function within Order class.

The FPT costs are a completely different story. I tried removing the Weee (FPT) costs from the quotes that are created, but it solved it only partially. I could see correct prices in the items list within the order, but the Grant Total and Subtotal amounts of the order still contained the FPT costs.

Do you have any suggestion on how could I solve it?

bin/magento setup:upgrade causing an error

Magento version 2.1.9
PHP 7.0

When doing bin/magento setup:upgrade.

Im getting an error PHP Fatal error: Cannot use Magento\Config\Model\ResourceModel\Config as Config because the name is already in use in /vagrant_data/score/httpdocs/vendor/magmodules/magento2-channable/Helper/General.php on line 13

screen shot 2017-11-02 at 14 17 56

SImple product parent relation for groups product on Magento Commerce

We have a Magento Commerce 2.2.7 shop with the Channable 1.4.0 version. We have the configuration setup that for simple products that are part of a grouped product the parent grouped product url needs to be send to channable instead of the simple product url.

The above works for older products but new products since half a year are not having the grouped product url.

We looked into this and it seems its caused by the row_id and entity_id table data for products in the magento database.

The product link table is connected to the product row_id instead of the entity_id table and for newer products the row_id and entity_id table are not the same anymore. The code is linking parent products as entity_id instead of row_id.

The expected result is that all simple products can make correct use of parent attributes.

Please do not update global state in the constructor of cli commands!

Hi guys

This was encountered with version 1.0.8 of your Channable module installed.

When running bin/magento setup:store-config:set --base-url="https://blah.example/"
We get this error:

[Magento\Framework\Exception\LocalizedException]
  Area code is already set

This problem is triggered by the setAreaCode code in:

Explanation: every time you run bin/magento it executes all constructors of all registered cli commands. So this means all the constructors of your channable:*** cli commands get executed even when executing another non-related bin/magento command.
You can very easily test this by echoing something from the constructors and running whatever bin/magento command, and you will always see the output from your commands in every other command.

So you should only use the constructor of these commands to initialize a bunch of variables, but please don't execute logic, and certainly not logic which manipulates a global state (like setting the area code).

The correct way, would be to change the area code in the execute method, but certainly not in the constructor.

This is a really big problem and should be resolved quickly in my opinion.

Thanks! :)

Feed Generation Slowdown from 1.4.6 onward

I'm using Magento Commerce and have tested this on 2.3.1 and 2.3.2. For versions of the extension 1.4.6 and up, our feed always times out. To fix this, I've been able to revert the following files to the 1.4.5 version:

Helper/Product.php
Model/Collection/Products.php
Model/Item.php

After that, the feed generates again after about a 30 second wait.

Our feed is heavily loaded with configurable products and contains about 32,000 in stock items that get passed to Channable.

Let me know if any more environment information would help to see what's causing this issue.

Schedule category is broken

On Magento 2.4.2-p1 commerce with Magento2-channable 1.5.1, it's not possible to schedule category changes.

The following is shown:
image

But this popup is expected:

image

In the logs, we see:

Exception #0 (Magento\Framework\Exception\LocalizedException): The "componentType" configuration parameter is required for the "channable" component.
#1 Magento\Framework\View\Element\UiComponentFactory->mergeMetadataItem() called at [vendor/magento/framework/View/Element/UiComponentFactory.php:334]

Is this a known issue?

Error and no output because of Notice: Array to string conversion

a:4:{i:0;s:124:"Notice: Array to string conversion in /vendor/magmodules/magento2-channable/Helper/Product.php on line 375";i:1;s:10584:"#0 /vendor/magmodules/magento2-channable/Helper/Product.php(375): Magento\Framework\App\ErrorHandler->handler(8, 'Array to string...', '/data/web/magen...', 375, Array)
tice: Array to string conversion in /vendor/magmodules/magento2-channable/Helper/Product.php on line 375

Issue is probably because of selecting 'meta_robots' as field.
This is not logical, but anyway, it should not create an error.

Issue in code:

        if ($attribute['type'] == 'select') {
            if ($attr = $product->getResource()->getAttribute($attribute['source'])) {
                $value = $product->getData($attribute['source']);
                return (string)$attr->getSource()->getOptionText($value);
            }
        }

Proposal to fix:

        if ($attribute['type'] == 'select') {
            if ($attr = $product->getResource()->getAttribute($attribute['source'])) {
                $value = $product->getData($attribute['source']);
                $data = $attr->getSource()->getOptionText($value);
                if(is_array($data)){
                    if(count($data) > 0) return current($data);
                    return '';
                }
                return (string)$data;
            }
        }

Webhook orders doesnt work

Webhook for creating orders doesnt work. results in an 302 redirect.

ik found out it was in de Magento\Framework\App\FrontController:136 the validate fails. because you post without an formkey
=> Magento\Framework\App\Request\CsrfValidator:71

adding ?ajax=true to the url solves the problem.

Sidenote: i found out that payment module Mollie does the same thing with there hooks ;-)

php 7.4 implode(): Passing glue string after array is deprecated

A simple swap of the parameters should fix this error:
Error for https://www.[domain].com/nl/channable/order/hook {"validated":"false","errors":"Deprecated Functionality: implode(): Passing glue string after array is deprecated. Swap the parameters in \/home\/[user]\/[domain]\/releases\/20210525094409\/vendor\/magmodules\/magento2-channable\/Model\/Order.php on line 519"}

Selftest and Feed Generation slowdown with MySQL 8 / MariaDB 10.4

I've been talking with the support email about this but wanted to bring it up here to see if there was any other feedback.

There’s a issue at https://bugs.mysql.com/bug.php?id=97709 and the second to last comment mentions that including a WHERE id > 0 makes SELECT COUNT queries work with execution timing more like SQL 5.7 (or comparable MariaDB versions).

After adding a filter to the product collection in the Model/Collection/Products.php to filter entity_id greater than 0, I was able to get the self-test to run much faster which makes me think that there’s something to the bug but possibly a way to work around this to allow for feed generation to work more efficiently.

Thanks!

Bundles not in feed

Hello,

We found out that bundles are not exported to the channable feed. If we look in the JSON or preview output the bundle id's are missing from the feed. After a peek in the code it looks like it is missing from the filters: Source.php @ Line 351 Is this a know issue?

Channable: Orders & Items -> white page

With the latest Channable 1.0.12 + Magento 2.2.2
When opening the "Channable: Orders & Items", I get on my server a white page.

On my development environment, I get the follow error:

1 exception(s):
Exception #0 (Exception): Notice: Array to string conversion in vendor/magento/module-shipping/Model/Config/Source/Allmethods.php on line 61

Exception #0 (Exception): Notice: Array to string conversion in vendor/magento/module-shipping/Model/Config/Source/Allmethods.php on line 61
#0 vendor/magento/module-shipping/Model/Config/Source/Allmethods.php(61): Magento\Framework\App\ErrorHandler->handler(8, 'Array to string...', '/Users/jw/Proje...', 61, Array)
#1 vendor/magento/module-config/Model/Config/Structure/Element/Field.php(458): Magento\Shipping\Model\Config\Source\Allmethods->toOptionArray(false)
#2 vendor/magento/module-config/Model/Config/Structure/Element/Field.php(376): Magento\Config\Model\Config\Structure\Element\Field->_getOptionsFromSourceModel(Object(Magento\Shipping\Model\Config\Source\Allmethods))


Looking into this Magento code on this line:
'label' => '[' . $carrierCode . '] ' . $methodTitle,

At the $carrierCode = 'usps', I get an array returned.
This results in this error.
This carrier is actually not used.

No such entity with cartId = 958695

Upgraded Channable for customer and now getting errors on certain (complete) orders (not all), not sure why.
Error is:

1 exception(s):

Exception #0 (Magento\Framework\Exception\NoSuchEntityException): No such entity
with cartId = 958695
#1 Magento\Quote\Model\QuoteRepository->loadQuote() called at
[vendor/magento/module-quote/Model/QuoteRepository.php:136]
#2 Magento\Quote\Model\QuoteRepository->get() called at
[vendor/magento/framework/Interception/Interceptor.php:58]
#3 Magento\Quote\Model\QuoteRepository\Interceptor->___callParent() called at
[vendor/magento/framework/Interception/Interceptor.php:138]
#4
Magento\Quote\Model\QuoteRepository\Interceptor->Magento\Framework\Interception\{closure}()
called at [vendor/magento/framework/Interception/Interceptor.php:153]
#5 Magento\Quote\Model\QuoteRepository\Interceptor->___callPlugins() called at
[generated/code/Magento/Quote/Model/QuoteRepository/Interceptor.php:23]
#6 Magento\Quote\Model\QuoteRepository\Interceptor->get() called at
[vendor/magmodules/magento2-channable/Block/Adminhtml/Order/Totals.php:54]
#7 Magmodules\Channable\Block\Adminhtml\Order\Totals->initTotals() called at
[vendor/magento/module-sales/Block/Order/Totals.php:64]
#8 Magento\Sales\Block\Order\Totals->_beforeToHtml() called at
[vendor/magento/framework/View/Element/AbstractBlock.php:1110]

Ends up here:
Magmodules\Channable\Block\Adminhtml\Order\Totals.php

public function initTotals()
    {
        $quoteId = $this->getOrder()->getQuoteId();
        $quote = $this->quote->get($quoteId);

Seems to happen on orders that are already complete and customer ran into this when she tried to credit one of these. The quoteId is available but the next step "$quote = $this->quote->get($quoteId);" fails. Still investigating why but in order for the customer to continue her work I have made the following quick fix:

For now the quick fix is

$quoteId = $this->getOrder()->getQuoteId();
        if(isset($quoteId) && $quoteId > 0) {
            try {
                $quote = $this->quote->get($quoteId);
            } catch (\Exception $exception) {
                // later / custom logging
            }
            if (isset($quote)) { ...

As soon as I have more information I will add it.

Not working with Magento MSI

We are using Magento's MSI and the stock availability and qty are Out of Stock and 0 for every product we have, which is of course not correct. Any idea?

Orders imported from Channable don't have the currency that is set in channable.

When Channable orders are created in Magento the currency that was set in Channable isn't used in Magento, this is especially true if multiple countries are imported on the same storeview in Magento.

Eg. An order is created for a channable order of 1000 Norwegian krone but the order is created in Magento for 1000 euro because the storeviews default currency is euro. Even though the storeview allows NOK in a currency switcher.

Magmodules\Channable\Model\Order line 238:
$cart = $this->cartRepositoryInterface->get($cartId)->setStore($store)->setCurrency()->setIsSuperMode(true);

I believe properly setting the currency on this line will fix this issue.

Invalid return type in shipping price calculation

Orders aren't added to the sales_order table, because of the following error:

Return value of Magmodules\Channable\Service\Order\Shipping\CalculatePrice::execute() must be of the type float, string returned in /vendor/magmodules/magento2-channable/Service/Order/Shipping/CalculatePrice.php:67

Proposed solution:
Change line 67 from return $shippingPriceCal; to return (float) $shippingPriceCal;

Allow multiple address lines / separate house number and extension

As stated in the title we would like to be able to add up to 3 address lines:

  • Street
  • House number
  • Addition / Extension

Currently the logic seems to be almost ready to to this (almost like it was already planned by not / poorly executed). https://github.com/magmodules/magento2-channable/blob/master/Model/Order.php#L542 The logic allows you to separate the house numbers and the if else would allow you to also have the house_number_ext separated, but the else can never be reached (empty(0) would return false, and the only other possible value is 1).

Proposed solution: Add an extra option to seperate_housenumber "No", "Separate number", "Separate number and addition"

Not working together with Commerce B2B (shared catalog)

There is a problem at :
vendor/magmodules/magento2-channable/Model/Collection/Products.php

The following code defines the aliases as array keys (0,1,2.....). When the Shared Catalog module beforeLoad() plugin hits, it wants to use 0 as well.

if (!empty($config['inventory']['attributes'])) { $collection->joinTable( 'cataloginventory_stock_item', 'product_id=entity_id', $config['inventory']['attributes'] ); }

The fix is simple, generate unique aliases like 'channable_qty' or 'channable_is_in_stock'.

QND fix for now so that the exporter works again:
if (!empty($config['inventory']['attributes'])) { foreach($config['inventory']['attributes'] as $key => $value) { $config['inventory']['attributes'][$value] = $config['inventory']['attributes'][$key]; unset($config['inventory']['attributes'][$key]); } $collection->joinTable( 'cataloginventory_stock_item', 'product_id=entity_id', $config['inventory']['attributes'] ); }

Product feed pagination total number of pages bug

Environment:
PHP - 7.0
Magento - upgraded to 2.2.2
Channable extension - 1.0.12 (installed via composer)

This is what the first page of the product feed (channable/feed/json/ request) returns:

"products_total":1,
"products_limit":"50",
"products_output":50,
"products_pages":1,
"current_page":1,
"next_page":"false",

"products_total", "products_pages" and "next_page" are incorrect.
Looking at the extension code, I see that the source of this bug is in the magmodules/magento2-channable/Model/Collection/Products class, getCollectionCountWithFilters() method:

public function getCollectionCountWithFilters($productCollection)
    {
        $selectCountSql = $productCollection->getSelectCountSql();
        $connection = $this->resource->getConnection(ResourceConnection::DEFAULT_CONNECTION);
        $count = $connection->fetchAll($selectCountSql);
        return count($count);
    }

var_dump($count):

array(1) { 
    [0]=> 
        array(1) { 
            ["COUNT(DISTINCT e.entity_id)"]=> string(3) "841" 
	} 
} 

and then count($count) always returns:

int(1) 

If I use this instead:

return array_shift($count[0]);

I get the correct response:

"products_total":"841",
"products_limit":"50",
"products_output":"50",
"products_pages":"17",
"current_page":"1",
"next_page":"true"

I checked the latest stable release of the extension, but the same problem persists, so the upgrade wouldn't suffice.

Could you please take a look at this issue and give me feedback when you expect it to be corrected?

Question about the FeedUrl

Hello,

I was looking into some help with the Channable Feed module.

  • What are possible options for querystring params to pass to the URL? I know you can use page=xx to get the paged results. But are there more options?
  • On website with multiple storeviews, and multiple (allowed) currencies per storeview.. how can we instruct the feedurl to give the result in the correct currency? For example, we want to feed both EUR and GBP for a specific storeview to channable.

Hope this question is a bit clear, if not let me know..!

Issue qty_increments

The qty increments product setting is wrong displayed in our feed..

Debugging the code showed in Helper/Product.php line 642:

     if (!$product->getData('enable_qty_inc')) {
            return false;
        }

I think it should be changed to

     if (!$product->getData('enable_qty_increments')) {
            return false;
        }

since in the cataloginventory_stock_item the field is "enable_qty_increments".

After changing the feed is right.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.