Coder Social home page Coder Social logo

clerk-magento2's People

Contributors

casperkn avatar hkb avatar hostep avatar jmp-1902 avatar jzembala avatar kimpansen avatar lgxerxes avatar paresh6002 avatar rbech avatar ste80pa avatar stubbedev avatar tristanhofman avatar unicoder88 avatar vmalyk avatar wesso avatar xgerhard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

clerk-magento2's Issues

Module compatibility

Hi, is this module fully compatible with magento 2.4.2 and latest versions of PHP 7.4?

Sorry but I cannot find any information on the web and on Clerk docs.
Thanks!

Duplicated content issue on non-url-rewritten category pages

Hi

We have this very weird issue, it requires visiting a category url that has no url rewrite
When we do this, we can see that the ajax call to clerk/powerstep/popup gives us back the entire html dom of the category page and inserts it again underneath the already existing page. Which causes the page's DOM being duplicated entirely and we have two times the header, menu, products, footer, ...

Seen with:

  • Magento OS 2.3.6-p1
  • Clerk module 4.6.1 or 4.6.2

Steps to reproduce:

  • Enable the Powerstep feature with type Popup
  • Have a category with a bunch of products
  • Visit the category url which looks like this: https://domain.example/{storeview_code}/catalog/category/view/s/{category-url-key}/id/{category-entity-id}/ (you can probably quickly simulate this by removing url rewrites for this category from the url_rewrite database table and flushing your cache and then clicking on that category in the menu
  • Seeing that the entire html is being duplicated after the ajax call to the powerstep popup finished

This is not happening when a category has a "nice" url from the url rewrites.
We are currently investigating on this shop why certain categories do not have such an url, and are going to fix this, but this is a weird side effect we noticed and thought it might be a good idea to at least document it publicly in case somebody else runs into this as well.
Not sure if it makes sense to try to fix this, I'll leave that up to you to decide.

Thanks!

Magento 2.2.0

This module does not allow an upgrade to Magento 2.2.0 as the dependency on the Magento Framework is for 100.1* where as Magento 2.2.0 uses the framework 101.0.*

Is there any plans to upgrade this to allow it to be used with Magento 2.2.0 versions?

Error while compiling on Magento 2.1.x

Hi

on some old Magento2 installation you can obtain error like this while running a setup:di:compile

vendor/clerkio/magento2/Controller/Page/Index.php \Magento\Framework\ObjectManagerInterface already exists in context object

Products updated via API will not be sent to Clerk

Currently we have events in adminhtml area only. When products are created and updated via REST API, e.g. POST https://example.com/rest/all/V1/products, Clerk will not receive any update.

Solutions:
a. either move event observers to global di.xml
b. grown up solution is indexer with update on save/update by schedule mode

I am a strong proponent of option b. because it has proven an industry standard with numerous projects we worked with. I made a PR before (#13), however, we should simplify it and update.

But either choice will be a step forward.

Please have a look :)

Faceted Source Model not working for huge product data

Issue is for both Magento1 and Magento2

Issue:
In clerk setting, Faceted Search multiselect is empty

Problem:
Source model is filled using clerk api "product/faceted".
Response is huge because it loads all attributes for all products (even skus)

Here's the sourcemodel
<source_model>clerk/system_config_source_facetAttributes</source_model>

Proposed solution:
We should use Magento's attributes having "Use for layered in search" set to yes. (And we should add such attributes automatically into products feed)

typo in Observer/ProductSaveEntityAfterObserver.php

"Trying to get property on non-object"

In Observer/ProductSaveEntityAfterObserver.php function execute, line 87

$productItem[$field] = $productItem->getData[$field];

should be

$productItem[$field] = $product->getData($field);

Issues withpowerstep popup and powerstep page

We have installed version 3.0.0 in Magento 2.3.2 and are facing the following issues. There is a bug in the Javascript loading from clerk.io.

  1. Powerstep popup does not load correctly on add to cart function. The powerstep popup loads at the buttom of the page in stead of as a popup window

  2. Powerpage can only load one slider. IF you add more than one slider with product recommendations only the first content/design will load as a slider - the rest is loading in a grid.

Incorrect namespaces

Hi guys

Using:

  • Magento OS 2.3.7
  • Clerk module 4.6.1

It looks like there are 2 incorrect namespaces in your PHP code, these can be found by dumping an optimised autoloader from composer:

$ composer dump-autoload -o
...
Class Clerk\Clerk\Controller\setconfig\Index located in ./vendor/clerk/magento2/Controller/Setconfig/Index.php does not comply with psr-4 autoloading standard. Skipping.
Class Clerk\Clerk\Controller\Subcriber\Index located in ./vendor/clerk/magento2/Controller/Subscriber/Index.php does not comply with psr-4 autoloading standard. Skipping.
  1. Over here, the end of the namespace should be Setconfig instead of setconfig
  2. Over here, the end of the namespace should be Subscriber instead of Subcriber

I haven't checked if you are using these incorrect namespaces in other classes, so please make sure you check that as well 🙂

Also: make sure to dump a non-optimised autoloader (composer dump-autoload) after fixing the problems before you want to test things, because Magento can't deal very well with optimised autoloaders in developer mode.

javascript errors cause by loading wrong version of jquery

In template file:
https://github.com/clerkio/clerk-magento2/blob/master/view/frontend/templates/livesearch.phtml#L22

you have JavaScript issue which is making conflicts with existing magento logic. You are loading wrong version of jquery from url: https://code.jquery.com/jquery-3.4.1.min.js

and you are not using require js for loading scripts.

This is not Magento way:

`<script type="text/javascript">
document.addEventListener('DOMContentLoaded', (event) => {
ClerkSearchPage = function(){
$("getFormSelector(); ?>").each(function (){
$(this).attr('action', '/catalogsearch/result/');
});
};

    if(window.jQuery) $( document ).ready(function() { ClerkSearchPage()  });
    else{
        var script = document.createElement('script');
        document.head.appendChild(script);
        script.type = 'text/javascript';
        script.src = "https://code.jquery.com/jquery-3.4.1.min.js";
        script.integrity = "sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=";
        script.crossorigin = "anonymous";
        script.onload = ClerkSearchPage;
    }
});

</script>`

Products without images throw error in console log

Hi guys,

We noticed an error in the console log that causes issues in the security of the webshop (probably by receiving a 403 response.)

Requirements:

Magento 2.3.4
Clerk module v3.3.2 (also in 3.4.1 and 4.0.0)

Issue

When a product is listed in one of the widgets on for example a widget with template Best Sellers that doesn't have a picture linked to it, we get the following error in the console:

VM1470:691 GET https://baseurl.something/media/catalog/product/ 403 Forbidden

Expected behaviour:

Using the default placeholder for products without predefined images.

Actual behaviour:

base media path used as and console log thrown on the frontend

Not able to change product information from command

Magento : 2.3.2

run Magento command to create / edit product but got issue on non SERVER env

File https://github.com/clerkio/clerk-magento2/blob/master/Controller/Logger/ClerkLogger.php

Should be
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' && isset($_SERVER['HTTP_HOST']) && isset($_SERVER['REQUEST_URI'])) $Metadata['uri'] = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; else if(isset($_SERVER['HTTP_HOST']) && isset($_SERVER['REQUEST_URI'])) { $Metadata['uri'] = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; }

Undefined property on product save

When I save any products I receive this message:

Notice: Undefined property: Magento\Catalog\Model\Product\Interceptor::$getData in /var/www/my_website/public_html/vendor/clerk/magento2/Observer/ProductSaveEntityAfterObserver.php on line 87

Which refers to the fact that $productItem is empty:

if (! isset($productItem[$field])) { $productItem[$field] = $product->getData[$field]; }

I could hide E_NOTICE from php.ini but I think that it would be better to fix it.

Error on Product delete and Use Real-time Updates enabled

Preconditions

Magento 2.1.7

Steps to reproduce

Stores > Config > Clerk
Set Use Real-time Updates to "Yes" (By default It`s enabled in config)

Actual result

On product delete Magento down wIth report/warning:
a:4:{i:0;s:124:"Warning: join(): Invalid arguments passed in /var/www/magento2/vendor/clerk/magento2/Model/Api.php on line 67";i:1;s:11462:"#0 [internal function]: Magento\Framework\App\ErrorHandler->handler(2, 'join(): Invalid...', '/var/www/mage...', 67, Array)
#1 /var/www/magento2/vendor/clerk/magento2/Model/Api.php(67): join(',', '1')
#2 /var/www/magento2/vendor/clerk/magento2/Observer/ProductDeleteAfterDoneObserver.php(41): Clerk\Clerk\Model\Api->removeProduct('1')
#3 /var/www/magento2/vendor/magento/framework/Event/Invoker/InvokerDefault.php(73): Clerk\Clerk\Observer\ProductDeleteAfterDoneObserver->execute(Object(Magento\Framework\Event\Observer))

Expected result

Product should be deleted without errors

Notes

The issue is related with join function and removeProduct waits array instead string. Please fix method and remove join() , because We not use it with arrays at all and use only one value per product : https://github.com/clerkio/clerk-magento2/blob/master/Model/Api.php#L62

Powerstep popup fails on sub category

Hey guys

Using:

  • Magento OS 2.3.7
  • Clerk module 4.6.1

If you have a category tree with more than one level of categories, your powerstep popup fails to show on categories which are a subcategory of another category.
That's because the url in the ajax request is not using a urlbuilder to make it absolute, now it remains relative and causes issues.

For example, suppose I'm on the page: https://example.shop/nl/category-one and I trigger the powerstep popup, it will do an ajax call to https://example.shop/nl/clerk/powerstep/popup which is correct!
However, when you are on the page: https://example.shop/nl/category-one/category-two and trigger the powerstep popup, it will do an ajax call to https://example.shop/nl/category-one/clerk/powerstep/popup which won't work!

Suggested fix:

diff --git a/powerstep_script.phtml b/powerstep_script.phtml
index cced4b6..852a2a2 100644
--- a/powerstep_script.phtml
+++ b/powerstep_script.phtml
@@ -3,14 +3,14 @@
 if ($block->shouldShow()) :
 ?>
 <script>
-require(['jquery'], function($) {
+require(['jquery', 'mage/url'], function($, urlBuilder) {
     function getPowerstepPopup(isAjax)
     {
         $("#clerk_powerstep").remove();
         $("#clerk_powerstep .clerk-slider").remove();
         var data = isAjax ? { isAjax: true } : {};
         $.ajax({
-            url: 'clerk/powerstep/popup',
+            url: urlBuilder.build('clerk/powerstep/popup'),
             data: data,
             type: 'get',
             success: function(res) {

Thanks!

Uncaught Error: Call to a member function log() on null

Version: 3.4.1

PHP Fatal error:  Uncaught Error: Call to a member function log() on null in vendor/clerk/magento2/Controller/AbstractAction.php:338
Stack trace:
#0 vendor/magento/framework/App/Action/Action.php(108): Clerk\Clerk\Controller\AbstractAction->execute()
#1 vendor/clerk/magento2/Controller/AbstractAction.php(160): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http))
#2 vendor/magento/framework/Interception/Interceptor.php(58): Clerk\Clerk\Controller\AbstractAction->dispatch(Object(Magento\Framework\App\Request\Http))
#3 vendor/magento/framework/Interception/Interceptor.php(138): Clerk\Clerk\Controller\Customer\Index\Interceptor->___callParent('dispatch', Array)
#4 vendor/magento/framework/Interception/Interceptor.php(153): Clerk\Clerk\Contro in vendor/clerk/magento2/Controller/AbstractAction.php on line 338

i see that you have fixed this issue in the new major version but im not sure that it's a good idea to restrict a fix for a fatel error to going to a now major verison, so maybe we can get a 3.4.2 version which fixes this issue in the same manor as the 4.0.0 version does.

Out of Stock product still visible

As described here, #12
Out of stock products are not skipped and removed from Clerk, it will dispayed in sliders, email, reccom and search page.
As I correctly config Saelable product It will be ignored.

3clerk1

As out of stock is yet a product attribute or quantity I dont' understand why add extra field to my magento as described here

My config:
Magento 2.2.6
PhP 7.1.22
clerk-magento2 v2.6.8
Hope It will solve asap

------EDIT------
Forget to say that hidden Categories are displayed in search page

Javascript error on login, forgot password and registration pages

Description

Login, registration and forgot password pages appear to be duplicated (html of the whole page, header and footer included, is rendered twice), and there is this error in javascript console:
clerk_error

The origin of this error is in file vendor/clerk/magento2/view/frontend/templates/powerstep_script.phtml, line 6.

Context

  • clerk/magento2 v4.4.6
  • Magento EE 2.4.2
  • PHP 7.4
  • Mysql 8

Steps to reproduce

  • Install module clerk/magento2 4.4.6 on Magento 2.4.2
  • Navigate to login page, or registration page, or forgot password page

Expected behaviour

The login page is correctly displayed, and there are no javascript errors in console

### Actual behaviour
The login page displayed twice (the whole page is duplicated, header and footer included) and there is this error in javascript console:

clerk_error

All product attributes are sent to Clerk, also the empty ones

Description

Since these lines has been added to Model/Adapter/AbstractAdapter.php:

Screenshot 2021-05-05 at 09 30 13

attributes with no values in Magento are sent to Clerk as empty string. Maybe it's not even a bug, but if it's the desired behavior, I'd like to know if there is a specific reason for which it has been made. Maybe it solves some other issue?

Context

  • clerk/magento2 v4.4.6
  • Magento EE 2.4.2
  • PHP 7.4
  • Mysql 8

Steps to reproduce

  • Install module clerk/magento2 4.4.6 on Magento 2.4.2
  • Sync all products to Clerk
  • Navigate Data/Products in https://my.clerk.io/

Expected behaviour

I can see product attributes with a value.

Actual behaviour

I can see all product attributes, also empty ones.

Updating product via API will not sync

Hi!

A lot of Magento webshops receive updates via API from Product information management systems. In this case event catalog_product_save_after will not fire call Clerk\Clerk\Observer\ProductSaveAfterObserver , because it is declared in adminhtml area.

Related with #13

Suggestions:

  • easy - move even observer to global area events.xml
  • proper - convert event observer into indexer

Thanks :)

P.S. Looking forward to another 2 years of silence ;)

Error on Powerstep popup when add to cart fails

Preconditions

  • Magento 2.2.11 EE
  • PHP 7.2
  • clerk-magento2 2.6.8

Steps to reproduce

  • Install clerk-magento2 2.6.8 on Magento 2.2.11 EE
  • Enable powerstep popup
  • Set up a product to have stock quantity 5, and backorders not active.
  • Go to the product page, and add to cart 100 pieces.

Expected behavior

  • Powerstep popup does not open (or should it open anyway?), and there are no errors server side

Actual behavior

  • Powerstep popup does not open but you get a fatal error:

PHP Fatal error: Uncaught Error: Call to a member function getImage() on boolean in /my/project/path/vendor/clerk/magento2/Block/PowerstepPopup.php:116

This happens because add to cart fails, event checkout_cart_add_product_complete is not dispatched, so CheckoutCartAddProductCompleteObserver in never executed, and clerkProductId is never set in checkoutSession.

Serve scaled images

I am testing the Perfomance Score of my Magento 2 in development and without Clerk it is 86% in Gtmetrix but with Clerk it is 24% for two reasons, Serve scaled images and Optimize images https://gtmetrix.com/reports/www .vendetucasaenchina.com / gm31GxFJ
In my Magento 1 this does not happen to me.
Could you check if there is a problem with your code in Magento 2?

Weird JS dependency

Hey guys

Using:

  • Magento OS 2.3.7
  • Clerk module 4.6.1

We sometimes had a problem closing the powerstep popup after it was opened, this was not consistent, sometimes it worked, sometimes after a refresh or another page visit, it didn't, and so on and so forth ...

For some reason, when we removed the 'clerk' dependency in this script: https://github.com/clerkio/clerk-magento2/blob/4.6.1/view/frontend/templates/powerstep_popup.phtml#L59, it started working 100% of the time.
I can't really explain it, I think it also has something to do with minifying of JS which is enabled on this particular shop, but I'm mostly guessing here.

I think that dependency can be removed completely, since the Clerk object is not used anywhere in that script block.
It did get used in the past, but that usage was removed with 276f489#diff-4d9bb2c884794ef6c353a9d2a1713725d0ea4668b03b2a7a5e4f1d79d92cce3f, so I'm pretty sure it's no longer needed.

Suggested fix:

diff --git a/view/frontend/templates/powerstep_popup.phtml b/view/frontend/templates/powerstep_popup.phtml
index 53e149f..21f6610 100644
--- a/view/frontend/templates/powerstep_popup.phtml
+++ b/view/frontend/templates/powerstep_popup.phtml
@@ -56,7 +56,7 @@ $categoryIds = $block->getProduct() ? $block->getProduct()->getCategoryIds() : [
     </div>
 </div>
 <script>
-require(['jquery', 'clerk'], function($, Clerk) {
+require(['jquery'], function($) {
     var popup = $("#clerk_powerstep");

     $(".clerk_powerstep_close").on("click", function() {

Live Search Settings - Content is ignored

Hi!

After recent changes with configuration scope (never default), content setting is ignored. I think this is because store view level is not passed when reading configuration.

This results in data-template="@" - incorrect value, no matter what is selected in admin.

https://prnt.sc/rurpa7

report.ERROR: Notice: Undefined index: HTTP_HOST in clerk/magento2/view/frontend/templates/tracking.phtml on line 20

Hi. It seems that in Magento 2.4.3 this line(20) in file clerk/magento2/view/frontend/templates/tracking.phtml throws error:

uenc: '<?php echo base64_encode((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"); ?>',

Error is in logs:
report.ERROR: Notice: Undefined index: HTTP_HOST in clerk/magento2/view/frontend/templates/tracking.phtml on line 20

Any help please?

Extending and customization data before send to Clerk.io issue

Hi!

After module review I found some problem to add custom field based on some logic of another module. On M1 version I found event https://github.com/clerkio/clerk-magento/blob/master/code/Model/Catalog/Product.php#L50 and It`s good point to extending.
On M2 You use the same way as for Prestashop:
https://help.clerk.io/using-clerk-io-on-magento-2/styling-and-design/styling-clerkio-results-to-match-your-design-on-magento-2 (some mistake in article content).

You register fieldHandlers for customize field data. In current version We can't add custom fields and register field handlers without module modification. If You add event in Index controllers to extend that or change visibility to public for using DI plugins - It`ll be easier and re-usable for implementation

Brand attribute issue

Hi. If attribute code in magento has different name than "brand" then in Clerk brand attribute is empty for all products.
For example if brand attribute has code "manufacturer" in magento then in Clerk the brand attribute is empty and you need to add "manufacturer" as additional attribute sent to Clerk.
It should be a function in magento admin or in Clerk admin to map the sent attributes with Clerk attributes

Issues with API keys for multi-store data

In Clerk\Clerk\Controller\AbstractAction there are 2 methods used to get public and private key for the API: getPrivateKey() and getPublicKey()
These methods fetch the API keys from the config value as follows:

return $this->scopeConfig->getValue(
                Config::XML_PATH_PUBLIC_KEY,
                ScopeInterface::SCOPE_STORE
            );

In case of multi-store data, the config fetches the API keys only from the default storeview, resulting in a 403 Invalid keys supplied error when syncing the data.

As a solution, we can use the __store parameter to pass the store code to these methods and fetch the private and public keys for their respected store view.

A solution would look something like below:

Fetching the store code in verifyKeys method

private function verifyKeys(RequestInterface $request)
    {

        try {
            $storeCode = $request->getParam("__store");
            $privateKey = $request->getParam('private_key');
            $publicKey = $request->getParam('key');

            if ($privateKey !== $this->getPrivateKey($storeCode) || $publicKey !== $this->getPublicKey($storeCode)) {
                return false;
            }

            return true;

        } catch (\Exception $e) {

            $this->clerk_logger->error('verifyKeys ERROR', ['error' => $e->getMessage()]);

        }
    }

And then the methods:

private function getPrivateKey($storeCode)
    {
        try {

            return $this->scopeConfig->getValue(
                Config::XML_PATH_PRIVATE_KEY,
                ScopeInterface::SCOPE_STORE,
                $storeCode
            );   //passing store code as extra parameter here

        } catch (\Exception $e) {

            $this->clerk_logger->error('getPrivateKey ERROR', ['error' => $e->getMessage()]);

        }
    }

Directly calling ObjectManager

Hi,

I've noticed that you're directly calling the Object Manager. Magento says that developers should not use the object manager directly to load classes, instead inject the object in the constructors.

See

app/code/Clerk/Clerk/Model/Adapter/Product.php
app/code/Clerk/Clerk/Model/Config/Source/Language.php
app/code/Clerk/Clerk/Controller/Logger/ClerkLogger.php
app/code/Clerk/Clerk/Controller/Product/Index.php
app/code/Clerk/Clerk/Controller/AbstractAction.php
app/code/Clerk/Clerk/Controller/Version/Index.php

Can you look at this and resolve it?

Config page is blank

Magento 2.3.3
module name="Clerk_Clerk" setup_version="3.3.2"

System -> Configuration -> Clerk -> Configuration
this page is blank

Issue after installing extension

Hello.

I have problem with this extension v2.2.* after deploying on my local or to remote environments. Frontend is broken with exception:

1 exception(s):
Exception #0 (InvalidArgumentException): Unable to serialize value.

Exception #0 (InvalidArgumentException): Unable to serialize value.
#0 /var/www/pinoshop.loc/public_html/vendor/magento/framework/App/PageCache/Kernel.php(153): Magento\Framework\Serialize\Serializer\Json->serialize(Array)
#1 /var/www/pinoshop.loc/public_html/vendor/magento/module-page-cache/Model/Controller/Result/BuiltinPlugin.php(96): Magento\Framework\App\PageCache\Kernel->process(Object(Magento\Framework\App\Response\Http\Interceptor))
#2 /var/www/pinoshop.loc/public_html/vendor/magento/framework/Interception/Interceptor.php(146): Magento\PageCache\Model\Controller\Result\BuiltinPlugin->afterRenderResult(Object(Magento\Framework\View\Result\Page\Interceptor), Object(Magento\Framework\View\Result\Page\Interceptor), Object(Magento\Framework\App\Response\Http\Interceptor))
#3 /var/www/pinoshop.loc/public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Response\Http\Interceptor))
#4 /var/www/pinoshop.loc/public_html/generated/code/Magento/Framework/View/Result/Page/Interceptor.php(26): Magento\Framework\View\Result\Page\Interceptor->___callPlugins('renderResult', Array, Array)
#5 /var/www/pinoshop.loc/public_html/vendor/magento/framework/App/Http.php(139): Magento\Framework\View\Result\Page\Interceptor->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#6 /var/www/pinoshop.loc/public_html/vendor/magento/framework/App/Bootstrap.php(256): Magento\Framework\App\Http->launch()
#7 /var/www/pinoshop.loc/public_html/pub/index.php(37): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#8 {main}

This exception is result that in admin section not added public and private keys

All orders are exported to Clerk, regardless of the store scope

Preconditions

  • Magento 2.3.4
  • clerk/magento2 v 4.0.0

Steps to reproduce

  • Magento 2 installation with two website, and one store view each, and some orders made from both it_it and eu_en stores, let's say order 1000001, 1000002 and 1000003 are made from the it_it store view, anche 2000001, 2000002 and 2000003 are made from store view eu_en.
  • Create two stores on Clerk: My Store it_it and MyStore eu_en
  • Set the proper sync settings on clerk:
    • This for My Site it_it:
      Screenshot 2020-05-15 at 11 34 28
    • and this for My Site eu_en:
      Screenshot 2020-05-15 at 11 34 45
  • Launch sync for both My Store it_it and My Store eu_en

Expected behavior

I expect to see on Clerk.io only the orders of the right store scope: 1000001, 1000002 and 1000003 should have been imported only to My Store it_it, and 2000001, 2000002 and 2000003 should have been imported only to My Store eu_en.

Actual behavior

All orders have been exported to both Clerk stores: My Store it_it has six orders (1000001, 1000002 and 1000003, 2000001, 2000002 and 2000003), and the same happens for My Store eu_en

Wrong Prince and Special price issue

Hi. It seems that for simple products you don't get magento price and special price the right way.
You have in Clerk price and initial price. For us these fields in Clerk are the same amount even in discount products. It should be initial price or price different amounts. You only get if a product is on sale which is right. With your function we can't use discount price and price to inform the customer in banners. Check screenshot(This is a product with discount). We tried also to send in Clerk magento special_price attribute and we found that again is the same price as price or initial price. We use magento 2.4.2.
Screenshot 2021-06-10 at 12 57 17 PM

Thank you in advance!

Warning: array_combine(): Both parameters should have an equal number of elements

Hi!

This is using version 3.3.1 of this module on Magento OS 2.3.3

We are getting the following error when going to a search result page, for example: /catalogsearch/result/?q=test:

Exception #0 (Exception): Warning: array_combine(): Both parameters should have an equal number of elements in vendor/clerk/magento2/Block/Result.php on line 72
<pre>#1 array_combine() called at [vendor/clerk/magento2/Block/Result.php:72]
#2 Clerk\Clerk\Block\Result->getSpanAttributes() called at [generated/code/Clerk/Clerk/Block/Result/Interceptor.php:50]
#3 Clerk\Clerk\Block\Result\Interceptor->getSpanAttributes() called at [vendor/clerk/magento2/view/frontend/templates/result.phtml:4]
#4 include() called at [vendor/magento/framework/View/TemplateEngine/Php.php:59]
#5 Magento\Framework\View\TemplateEngine\Php->render() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#6 Magento\Framework\View\TemplateEngine\Php\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
...

If I output the $titles variable, I get:

Array
(
    [1] => Array
        (
            [sort_order] => 0
        )

    [0] => Array
        (
            [label] => 
        )

)

Calling array_keys on that variable results in 2 elements:

Array
(
    [0] => 1
    [1] => 0
)

Calling array_column($titles, 'label') on that variable results in 1 element:

Array
(
    [0] => 
)

So it feels like this code isn't robust enough.
Is this enough info for you guys to figure this out?

Thanks!

Inconsistent prices in Clerk when catalog prices are entered excluding tax, but they are displayed including taxes

Context

  • clerk/magento2 v2.8.3
  • Magento EE 2.2.11
  • PHP 7.2
  • Mysql 5.6

Steps to reproduce

  • go to Stores -> configuration -> Sales ->Taxes
  • set Catalog Prices to Excluding Tax, like this:
    Screenshot 2021-01-26 at 15 51 32
  • in Price display Settings set Display Products Prices in Catalog to Including Taxes, like this:
    Screenshot 2021-01-26 at 15 53 57
  • Sync all products from Clerk, non saving products from Magento, but clicking the Start New Data Sync button from clerk.io

Expected behavior

  • price and list_price in Clerk catalog should be consistent (with or without taxes, but both the same)

Actual behavior

  • price and list_price in Clerk catalog are both without taxes for simple product, list_price is without taxes for configurable products, too. But price for configurable product is with taxes

Breaks compilation

Magento version : 2.4.3-p1
Clerk version : 4.6.0 (Upgraded from 4.5.0)

It seems like one of the later version breaks compilations in Magento.

www-data@4a2de3c9b0a4:~/public_html$ php bin/magento setup:di:compile
Compilation was started.
Interception cache generation... 6/9 [==================>---------]  66% 31 secs 476.0 MiBErrors during compilation:
	Clerk\Clerk\Model\Adapter\Product
		Extra parameters passed to parent construct: $StockStateInterface, $ProductMetadataInterface. File: /var/www/public_html/vendor/clerk/magento2/Model/Adapter/Product.php
Total Errors Count: 1

In Log.php line 92:
                            
  Error during compilation  
                            

setup:di:compile

Let me know if you have problems reproducing it

Error removing product

While removing a product in the backend, I encounter this issue:

Exception #0 (Exception): Warning: join(): Invalid arguments passed in .../public_html/vendor/clerk/magento2/Model/Api.php on line 67

In Model/Api.php the function removeProduct() is written as if it expects an array, while it is only called once in the extension, with a scalar product id. Please change

    /**
     * Remove product
     *
     * @param $productIds
     */
    public function removeProduct($productIds)
    {
        $params = [
            'key'          => $this->_scopeConfig->getValue(Config::XML_PATH_PUBLIC_KEY),
            'private_key'  => $this->_scopeConfig->getValue(Config::XML_PATH_PRIVATE_KEY),
            'products'     => join(',', $productIds),
        ];

        $this->get('remove', $params);
    }

to

    /**
     * Remove product
     *
     * @param int $productId
     */
    public function removeProduct($productId)
    {
        $params = [
            'key'          => $this->_scopeConfig->getValue(Config::XML_PATH_PUBLIC_KEY),
            'private_key'  => $this->_scopeConfig->getValue(Config::XML_PATH_PRIVATE_KEY),
            'products'     => $productId,
        ];

        $this->get('remove', $params);
    }

Prices over 1000 are sent back from the controller as 1

I am not quite sure why this controller exists as it does, it is filled with deprecated methods and is loading each product twice, once from the collection, and once with ObjectManager just to get the CreatedAt attribute ?

https://github.com/clerkio/clerk-magento2/blob/master/Controller/Product/Index.php

Anyways, the results from this controller formats the price attribute as a string, which in turn causes the value if above 1000 to be formatted as 1 if price is between 1.000 and 1.999 and 2 if it is between 2.000 and 2.999 and so on

a temporary patch can be applied to overcome this issue where we force the product price to be returned as a float

Force float values since clerk requires float but formats them as strings
@package clerk/magento2
--- Controller/Product/Index.php
+++ Controller/Product/Index.php
@@ -122,6 +122,9 @@
                     $response[$key]['list_price'] = number_format((float) floatval($price) ? (float) floatval($price) : 0, 2);
                 }

+                $response[$key]['price'] = floatval($product->getPrice());
+                $response[$key]['list_price'] = floatval($product->getPrice());
+
                 $response[$key]['stock'] = $stockItem->getQty();
                 $response[$key]['product_type'] = $productType;
                 $response[$key]['created_at'] = strtotime($product->getCreatedAt());

Unexpected ')' in clerk/magento2/Model/Adapter/Product.php line 251

Hi. It seems that in your latest version you have missed in line 251:

$price = $item->getPriceInfo()->getPrice('regular_price')->getAmount()->getValue());

you have a wrong

)

at the end.

Right syntax is:

$price = $item->getPriceInfo()->getPrice('regular_price')->getAmount()->getValue();

Synching configurable products with multiselect attributes throwing error

Issue is caused by

https://github.com/clerkio/clerk-magento2/blob/master/Model/Adapter/AbstractAdapter.php#L170

PHP Warning:  Array to string conversion in /home/cloudpanel/htdocs/www.example.com/releases/2022_09_07_4_25_31_branch_v2.4.4-3/vendor/clerkio/magento2/Model/Adapter/AbstractAdapter.php on line 170

I looked at the format of data and it looked like this

Array
(
    [0] => Array
        (
            [0] => Ethinylestradiol
            [1] => Progestogen
        )

    [1] => Array
        (
            [0] => Ethinylestradiol
            [1] => Progestogen
        )

    [2] => Array
        (
            [0] => Ethinylestradiol
            [1] => Progestogen
        )

)

So it's throwing an error synching multiselect attributes which return their value as an array. You're going to need to use an array filter to implement uniqueness or implode and then explode the data.

Clerk menu not shown in stores -> configuration

Description

When I go into the stores -> configuration settings I do not see a tab anymore for Clerk.

System environment

  • Magento 2.3.4
  • Was on Clerk 3.X and upgraded to version 4 using composer.
  • Executed a bin/magento setup:upgrade and cleared all cached
  • Configuration tab is not shown
  • I can see the added menu items under the "reports" menu.

image

Clerk powerstep popup creates a jquery error on my account pages

Hello!

Enabling the popup mode of Clerk Powerstep breaks the my account pages (login / create accunt) with a jQuery error:

Screenshot 2022-09-07 at 16 10 36

Screenshot 2022-09-07 at 16 10 51

If I disable the popup option, the account pages are back to normal.
Does this feature insert it's own jquery dependency?

Thanks,
Adam

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.