Giter Club home page Giter Club logo

clerk-magento's People

Contributors

brunsgaard avatar casperkn avatar daniel-ness avatar drugantibus avatar emilsm avatar fabianaromagnoli avatar hkb avatar kimpansen avatar kingisulgard avatar leonb avatar lgxerxes avatar m-overlund avatar mmenozzi avatar olzen90 avatar rbech avatar rbrown avatar sajbar avatar stubbedev avatar wesso avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

clerk-magento's Issues

Powerpage: Priser og antal forkert ved konfigurerbare produkter

Prisen vises forkert på powersteppet, hvis man tilføjer et konfigurerbart produkt (underprodukt) til indkøbskurven.

Det er prisen fra hovedproduktet, og dermed ikke den korrekte pris der vises.

Antallet er også forkert. Kunden forventer at der står "2 produkter er tilføjet kurven" hvis man tilføjer 2 stk. af et produkt.
Men den tæller produktlinier i kurven, og ikke mængden af produkter.

clerk-fejl

Tilføjer man 2 stk. af varen, står der stadig kun 1 produkter.
clerk-fejl2

Nyeste clerk version og Magento 1.9.3.1 med patches

Change template names to match my.clerk.io standards

The template names generated in the extension, do not match the standard auto-generated ones from my.clerk.io's Setup Guide.

These translations should be made:

search -> search-page
livesearch -> live-search
powerstep -> power-step-others-also-bought

The file generating the template-names is:
app/design/frontend/base/default/layout/config.xml

Clerk v2 Magento 1.9 with Onestep checkout on IOS: Can't checkout

We use Clerk v2 on our dev site, on Magento 1.9.4.2 with Onestepcheckout.

When people on IOS/Safari (Macbook, Iphone etc) wants to checkout, it wont work. The button ' place order' on onestepcheckout is not responding. The button just wont work.

When moving back to v1, everything works fine.

It has to do something with the javascript.

Some 3rd party softwares cause Magento to return an internal error on search page

When using 3rd party softwares like ManaDev, which inserts filters on the search page, a lookup to Magentos internal SQL database is still made even after activating the module.

This causes Magento to return an error page when a misspell is made, and the word cant be found in the database.

A possible fix is this:

Find the file
app/code/core/Mage/CatalogSearch/Model/Fulltext.php

Insert the IF-Statement if ($query->getId() != '') {} around the following line $this->getResource()->prepareResult($this, $queryText, $query);

It should look like this:

if ($query->getId() != '') {
    $this->getResource()->prepareResult($this, $queryText, $query);
}

This will cause Magento to ignore if the SQL lookup returns false, so it doesnt give back an error.

Real Time updates don't detect bulk updates.

Real Time updates only detect product changes when a product is updated directly but not when updates are done in bulk.

A suggested edit is provided in the following picture (file not specified).

Perhaps bulk updates should be handled in a bulk call to the product/add API if possible?

Training data should only be synced once.

The sales data synced with the feed is only needed once.
But right now it is build with the feed at every single feed generation. This is a waste of recources and we have to find a better solution

Include Standard Magento Currency Conversion

Magentos currency conversion can be integrated as a TemplateFormatter, which makes it easy to use multi-currency with Clerk.io.

It can be integrated in this file:
app->design->frontend->base->default->template->clerk->tracking.phtml

The following code has been supplied by a developer I talked to, and it worked on another shop as well. It comprises the entire tracking.phtml file:

<?php
    $publicapikey = Mage::helper('clerk')->getSetting('clerk/general/publicapikey');
    $formkey = Mage::getSingleton('core/session')->getFormKey();
    
    // Convert price to current currency
    $baseCurrencyCode = Mage::app()->getStore()->getBaseCurrencyCode();
    $currentCurrencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();
    $currentCurrencySymbol = Mage::app()->getLocale()->currency($currentCurrencyCode)->getSymbol();
    
    $rates = Mage::getModel('directory/currency')->getCurrencyRates($baseCurrencyCode, $currentCurrencyCode);
?>

<script type="text/javascript">
    window.clerkAsyncInit = function() {
        Clerk.config({
            key: '<?php echo $publicapikey; ?>',
            templateFormatters: {
                form_key: function () {
                    return '<?php echo $formkey; ?>';
                },
                // CUSTOM !! > In the Clerk design you can now use {{ price_in_currency }}
                // This converts the price from EUR to the requested currency
                price_in_currency: function(price) {
                    price =  Math.round(price * 100) / 100;
                    var price_converted = Math.round((price * <?php echo (float)$rates[$currentCurrencyCode] ?>) * 100) / 100;
                    var retVal = <?php echo json_encode($currentCurrencySymbol) ?> + ' ' + price_converted.toFixed(2).toString();
                    
                    return retVal;
                }
            }
        });
    };
    (function(){
        var e = document.createElement('script'); e.type='text/javascript'; e.async = true;
        e.src = document.location.protocol + '//api.clerk.io/static/clerk.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(e, s);
    })();
</script>

Add CSS to make powerstep responsive

Powerstep sometimes has some CSS issues that causes it to look wrong on mobile devices.

The below is an example fix that causes it to align better to different screen sizes.

Insert the following in skins/clerk/style.css

.checkout-cart-clerk .col4, .checkout-cart-clerk .col6, .checkout-cart-clerk .col8, .checkout-cart-clerk .col12 {
box-sizing: border-box;
}

Unhandled notices/warnings

Module is dropping a lot of exceptions/notices/warnings in system.log for unhandled stuff:

Notice: Undefined index: DKK  in /app/design/frontend/base/default/template/clerk/tracking.phtml on line 20
Notice: Undefined property: stdClass::$message  in /app/code/community/Clerk/Clerk/controllers/Adminhtml/Clerk/WidgetController.php on line 20
Notice: Undefined property: stdClass::$contents  in /app/code/community/Clerk/Clerk/Helper/Data.php on line 67
Warning: Invalid argument supplied for foreach()  in /app/code/community/Clerk/Clerk/Helper/Data.php on line 67
Warning: array_intersect(): Argument #2 is not an array  in /app/code/community/Clerk/Clerk/controllers/Adminhtml/Clerk/WidgetController.php on line 68
  • We do not use currencyconversion, so maybe the first one needs a check for this first.

Add observer to remove returned/creditmemo products from orders

Add observer to remove returned/creditmemo products from orders

Clerk is a great relational data linker... but when the incoming data is incorrect and returned items are not removed from the order data .... the results can be

  1. many in-statistical recommendations later on
  2. You could argue that Clerk could "learn" what does NOT work well together

Currently returns and changed items are not removed from the sales product sync to Clerk. Our service dept sometimes updates orders adds/removes products before shipping and also customers return products (often 18-22%) ...... so we could have 22% statistical data that should not be there. And more important: the system is neglecting human feedback: people do not want the product.

I hope you see the statistical importance. Recommendations based on for instance 22% insignificant data would not seem very logical. Also imagine the following case: of all 5 occurences of product A and B being ordered in 1 sale, 100% of product B is returned. Maybe we should then not-suggest it.

Maybe an observer can be installed to monitor order changes and credit memos and update Clerk.

The process would then be

  1. order made, sync data
  2. (full) credit memo created, cancel order, create a new 1: sync data
    3 or (partial) credit memo where 1 or 2 items in the order are returned/credited, removev items from the order: syn new data

I hope this helps

Show correct extension version in Magento Backend

Since the release of extension v2.0.6, the version has been written as 2.0.5 in the Magento backend when viewing the extension.

Version number can be changed in the top of this file:
app/code/community/Clerk/Clerk/etc/config.xml

Module may break 3rd party Add-To-Cart popup

Fjellsport had an issue where installing the module, caused their existing add-to-cart popup to break.

It happens because we overwrite the Mage_Checkout controller, with a "before" event.

It can be easily fixed by changing to "after" in config.xml.

From Emil at TrollWeb:

We have changed this in the file app/code/community/Clerk/Clerk/etc/config.xml, and yes, it should have to do with the powerstep functionality.

[...] It would be preferable if you could actually change this in coming versions of the official module? Since the Clerk CheckoutController only adds functionality as far as we know (extra controller action), and doesn't override anything, it's not really necessary to run it before Mage_Checkout. That is unless you plan to override any Magento core functions later on.

<?xml version="1.0" encoding="UTF-8"?>
<config>
  <!-- ... -->
  <frontend>
    <!-- ... -->
    <routers>
      <!-- ... -->
      <checkout>
        <use>standard</use>
        <args>
          <modules>
            **<!-- Changed from before to after -->
            <Clerk_Clerk _after_="Mage_Checkout">Clerk_Clerk_Checkout</Clerk_Clerk>
          </modules>**
        </args>
      </checkout>
    </routers>
  </frontend>
  <!-- ... -->
</config>

Error parsing body - doesn't seem to be a chunked message

Hi,

I am getting this error after installing clerk (3.3.0) module on my magento(1.7.0).

Error is showing given below.


Error parsing body - doesn't seem to be a chunked message

Trace:
#0 /var/www/html/lib/Zend/Http/Response.php(262): Zend_Http_Response::decodeChunkedBody('??????????E?=??...')
#1 /var/www/html/app/code/community/Clerk/Clerk/Model/System/Config/Source/FacetAttributes.php(37): Zend_Http_Response->getBody()
#2 /var/www/html/app/code/community/Clerk/Clerk/Model/System/Config/Source/FacetAttributes.php(12): Clerk_Clerk_Model_System_Config_Source_FacetAttributes->getFacetAttributes()
#3 /var/www/html/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php(463): Clerk_Clerk_Model_System_Config_Source_FacetAttributes->toOptionArray(true)
#4 /var/www/html/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php(229): Mage_Adminhtml_Block_System_Config_Form->initFields(Object(Varien_Data_Form_Element_Fieldset), Object(Mage_Core_Model_Config_Element), Object(Mage_Core_Model_Config_Element))
#5 /var/www/html/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php(164): Mage_Adminhtml_Block_System_Config_Form->_initGroup(Object(Varien_Data_Form), Object(Mage_Core_Model_Config_Element), Object(Mage_Core_Model_Config_Element))
#6 /var/www/html/app/code/core/Mage/Adminhtml/Block/System/Config/Edit.php(92): Mage_Adminhtml_Block_System_Config_Form->initForm()
#7 /var/www/html/app/code/core/Mage/Adminhtml/controllers/System/ConfigController.php(107): Mage_Adminhtml_Block_System_Config_Edit->initForm()
#8 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Adminhtml_System_ConfigController->editAction()
#9 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('edit')
#10 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#11 /var/www/html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#12 /var/www/html/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#13 /var/www/html/index.php(91): Mage::run('', 'store')
#14 {main}
#14 {main}


Please check this and let me know that how can we fixed this issue.

Thanks,
Brijesh

Sync products if image cache is cleared

If the image cache is cleared all products should be synced with clerk.io. This is best done through a full sync.

It can be done by calling the following URL:

https://api.clerk.io/v2/client/account/importer/start?key=API_KEY&private_key=PRIVATE_API_KEY

This will trigger clerk.io to run a full sync.

Multistore Import Error Data Sync

Hello,

in a multistore Magento installation we have this problem while sync a second store view

[2019-02-22 18:09:18] [WARNING] Import stopped: Got a unexpected response from the Magento API: "

With the first store view we didn't have any error, with this secondo one we have this error

I don't have any error log on our web server

Module needs an actual User Agent name

Problem

Magento module uses generic Python User Agent name. Some developers want to block out unnecessary traffic, but its hard to give the module access, without a more defined name.

Reproduce

The following call is being sent by the module:

52.28.255.187 - - [10/Oct/2016:11:14:47 +0200] "GET /clerk/api/product/?limit=200&page=1&store=4 HTTP/1.1" 401 188 "-" "python-requests/2.7.0 CPython/2.7.10 Linux/4.1.13-19.31.amzn1.x86_64"

Expected

Module should use a more clearly defined User Agent Name, like clerk_bot, allowing developers to easily allow access for our module only.

Example:
52.28.255.187 - - [10/Oct/2016:11:14:47 +0200] "GET /clerk/api/product/?limit=200&page=1&store=4 HTTP/1.1" 401 188 "-" "clerk_bot"

Remove Clerk io code from backend adminhtml templates

I dont think we need Clerk in our backend templates

Please only show it on the frontend

0.0004 clerk_livesearch_script (not cached)
Mage_Core_Block_Template
app/design/frontend/base/default/template/clerk/livesearch.phtml
0.0025 clerk_tracking_script (not cached)
Clerk_Clerk_Block_Tracking
app/design/frontend/base/default/template/clerk/tracking.phtml
0.0004 clerk_powerstep (not cached)
Clerk_Clerk_Block_Powerstep
app/design/frontend/base/default/template/clerk/powerpopup.phtml
0.0004 clerk_exit_intent_script (not cached)
Clerk_Clerk_Block_ExitIntent
app/design/frontend/base/default/template/clerk/exitintent.phtml

Make real-time updates bulk per default

The default real-time add/remove sync behavior is singular while the API default is bulk.

This creates overhead for bulk updates.

Fix: Make the default behavior bulk and treat single changes as a bulk operation on a set of one products.

Add clerk/magento to packagist.org

Hi guys,
please can you add your repository to packagist.org like magento2 extension?
I know composer for magento1 is less used but for me is very helpful.

Thank you for your support!

Please add category Title Chooser in config

Please add category Title Chooser in config

Some websites use two attributs for categories

  1. for the TITLE in the menu navigation
  2. for the NAME H1 on the page (page title)

The TITLE can be quite short something like "White"; suppose in a menu like "Shirts->White"; however the page title on the page is "White Shirts" taken from another attribute

Default should stay default 'name' but one should be able to change it in the backend

Quick and SImple win ; also goes for M2

Undefined index:

Hi, i'm having this issue:

2017-10-24T22:46:54+00:00 ERR (3): Notice: Undefined index: BRL in /app/design/frontend/base/default/template/clerk/tracking.phtml on line 20

Can you Help me?

Import URL in module not always correct

When customers are using custom links that differ from Magentos BaseURL, the Import URL will be wrong.

If a webshops actual link is
http://www.mywebsite.com/it
for example, the import URL will only be written as:
http://www.mywebsite.com/clerk/api/store/1

missing the /it part

Maybe the URL needs to be extended in the file that generates it:
app/code/community/Clerk/Clerk/Block/Adminhtml/Url.php

Potential fix from customer who had the issue:

From the frontend you could use the following code snippet to get the complete url:

$store= Mage::app()->getStore();
$url= $store->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK).'clerk/api/store/'.$store->getId();

This code works with “add store code to urls” option; if this option is set to “yes” then I get the following urls on my Magento:
https://www.diegodallapalma.com/it/clerk/api/store/1 (for italian store-view)
https://www.diegodallapalma.com/en/clerk/api/store/2 (for english store-view)

If “add store code to urls” option is set to “no” then I get the following urls:
https://www.diegodallapalma.com/clerk/api/store/1 (for italian store-view)
https://www.diegodallapalma.com/clerk/api/store/2 (for english store-view)

From the backend you could use this snippet instead:

$store_code= Mage::app()->getRequest()->getParam('store');
if (!empty($store_code))
{
   $store = Mage::app()->getStore($store_code);
   $url = $store->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK) . 'clerk/api/store/' . $store->getId();
}

$store_code is empty if I select “default config” from the scope select-menu; but if I select a store-view then I get a non-empty code and I can also get a complete url. It works with “add store code to urls” option and I get the same urls of the frontend code snippet.

Build new feed generator

We should program a new and improved feed generator that builds the feed in a uniform way, regarding of where the the process is called.

Allow Magento to save searches in the Magento backend, and enable category redirects

Right now, the feature to show searches in the Magentos backend, as well as category redirects on specific searches, are disabled when the module is activated.

A possible fix is the following:

Open the file
app -> code -> community -> Clerk -> Clerk -> controllers -> CatalogSearch ->ResultController.php

Find the following lines of code:

if (!Mage::helper('clerk')->getSetting('clerk/search/active')) { return parent::indexAction();

Insert the following code below it:

$query = Mage::helper('catalogsearch')->getQuery();
$query->setStoreId(Mage::app()->getStore()->getId());
if ($query->getQueryText() != '') {
        if (Mage::helper('catalogsearch')->isMinQueryLength()) {
                $query->setId(0)
                ->setIsActive(1)
                ->setIsProcessed(1);
        } else {
                if ($query->getId()) {
                $query->setPopularity($query->getPopularity() + 1);
        } else {
                $query->setPopularity(1);
        }
        if ($query->getRedirect()) {
                $query->save();
                $this->getResponse()->setRedirect($query->getRedirect());
                return;
        } else {
                $query->prepare();
        }
}
        Mage::helper('catalogsearch')->checkNotes();
                if (!Mage::helper('catalogsearch')->isMinQueryLength()) {
                $query->save();
        }
}

An internal scheduler for feed generation

This will enable us to start feedgeneration based on events.

The inital approach will be to use a flag in the config that inducates if a feed should be build.
The feedgeneration will start based on this flag, and cronjob will run every 5 minutes and check if the flag is set, while the feed is building other feed building processes should not be started.

An optimal solution would be to run the the process as a background thread if possible

Currency convertion

At some point we worked on currency convertion, we should finish this code. The status of this task is a but messy.

Magento Price Rules not carried over correctly to module

When Price Rules are used in Magento, the module calculates them wrongly, and ends up subtracting the price-rule twice.

Cannot reproduce in our magento.clerk.io setup, but it happens for many customers.

A possible fix is the following:

Open the file
app -> code -> community -> Clerk -> Clerk -> Model -> Catalog -> productbase.php

Find the following code starting at line 72:

$price = $this->getPrice();
 if ($includeDiscounts) {
     $price = Mage::getModel('catalogrule/rule')
             ->calcProductPriceRule($this, $this->getFinalPrice());
     if (!isset($price)) {
             $price = $this->getFinalPrice();
     }
 }

Replace it with the following code:

$price = $this->getPrice();
if ($includeDiscounts) {
        $price = Mage::getModel('catalogrule/rule')
        ->calcProductPriceRule($this, $this->getPrice());
        if ($price != $this->getFinalPrice()) {$price = $this->getFinalPrice();}
        if (!isset($price)) {
                $price = $this->getFinalPrice();
        }
}

This effectively check if its the right FinalPrice we are using and if not, will set it accordingly.

Wrong image size being used in powerpage/popup

The module uses the wrong product image on Powerpage.
It fetches the main product image and resizes this to a small resolution, instead of fetching the small product image (or thumbnail).

The primary problem with this is experienced when you use the watermark function in Magento. This means that the watermark logo will be way too big and cover the whole product image.
Other than that it will add an unnecessary size of the image and thereby adding load time/file size.

See:
https://github.com/clerkio/clerk-magento/blob/master/design/template/powerpage.phtml#L13

should be 'small_image' instead of image fx.

3rd Party modules cause Order ID's to break, and always track the same ID

Some customers have modules that manipulate Order ID's, turning them intro strings like:
2017/06/05-123.

In these cases, the module always track the Orders as 0, since we Int-Cast all order id's in Orderpage.php, on line 51:

$data['id'] = (int) $order->getIncrementId();

A possible fix could be to first check if the Order ID is actually a number, and if not, make sure to not Int-Cast it.

discount_percent calculated wrongly

The current getDiscountPercent function wrongly calculates the discount to a negative number.

In Productbase.php, replace the getDiscountPercent function with this instead, and it works:

 public function getDiscountPercent()
    {
      if($this->isOnSale()) {
      return round( (($this->getClerkRetailPrice()-$this->getClerkFinalPrice() ) / $this->getClerkRetailPrice())*100 );
      }
      else {
        return 0;
      }
    }

decoding chunked messages too many times

Any specific you are using Varien_Http_Client rather than Zend_Http_Client:

$client = new Varien_Http_Client();

Varien_Http_Client does not take into account that cURL decodes chunked messages, so when Varien_Http_Client decodes it, it messes up the transmission's chunk sizes.

I found this issue while updating Clerk following this: https://help.clerk.io/using-clerk-io-on-magento-1/upgrading-extension/upgrading-the-clerkio-magento-1-extension-from-v1

When using Varien_Http_Client I get this error:

There has been an error processing your request
Error parsing body - doesn't seem to be a chunked message

Trace:
#0 /var/www/magento/lib/Zend/Http/Response.php(262): Zend_Http_Response::decodeChunkedBody('\x1F\x8B\x08\x00\x00\x00\x00\x00\x00\x035\x8E\xB9\x0E\xC2...')
#1 /var/www/magento/app/code/community/Clerk/Clerk/Block/Adminhtml/System/Config/Form/FacetedSearchFieldset.php(56): Zend_Http_Response->getBody()
#2 /var/www/magento/app/code/community/Clerk/Clerk/Block/Adminhtml/System/Config/Form/FacetedSearchFieldset.php(17): Clerk_Clerk_Block_Adminhtml_System_Config_Form_FacetedSearchFieldset->keysValid()
#3 /var/www/magento/lib/Varien/Data/Form/Element/Abstract.php(223): Clerk_Clerk_Block_Adminhtml_System_Config_Form_FacetedSearchFieldset->render(Object(Varien_Data_Form_Element_Fieldset))

My solution is to use Zend_Http_Client rather than Varien_Http_Client. This fixes the issue.

This is tested in Magento 1.7.

Escape all HTML and scripts in product attributes

Customers who send us HTML and Javascript in their product attributes, cause the Importer to fail, since the script type="text/javascript" part is not escaped.

Example data from importer:

<meta charset=\"utf-8\"><script type="text/javascript">window.NREUM||(NREUM={}),__nr_requ

Make sure that all HTML and scripts are escaped.

json streamwriter

A streamwriter that enables us to stream out the feed. Thus we do not need to keep the feed in momery while building.

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.