Skip to content

Commit

Permalink
Merge pull request #17 from Ometria/bug/abandoned-cart-dates
Browse files Browse the repository at this point in the history
Bug/abandoned cart dates
  • Loading branch information
chris-pook authored Jun 17, 2020
2 parents bfe99ff + 20cdced commit c6fe62f
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public function execute()
$this->checkoutSession->setQuoteId($quote->getId());
$data = $this->session->getVisitorData();
$data['quote_id'] = $quote->getId();
$data['last_visit_at'] = $data['last_visit_at'] ?? (new \DateTime())->format(\Magento\Framework\Stdlib\DateTime::DATETIME_PHP_FORMAT);
$this->session->setVisitorData($data);
$this->visitor->setData($data)->save();

Expand Down
2 changes: 1 addition & 1 deletion app/code/Ometria/AbandonedCarts/etc/module.xml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"><module name="Ometria_AbandonedCarts" setup_version="2.0.2"/></config>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"><module name="Ometria_AbandonedCarts" setup_version="2.0.3"/></config>
2 changes: 1 addition & 1 deletion app/code/Ometria/Api/etc/module.xml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"><module name="Ometria_Api" setup_version="2.0.2"/></config>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"><module name="Ometria_Api" setup_version="2.0.3"/></config>
6 changes: 6 additions & 0 deletions app/code/Ometria/Core/Model/Observer/Cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ public function updateBasketCookie() {

// $cart = Mage::getModel('checkout/cart')->getQuote();
$cart = $this->cartModel->getQuote();

// For newly created carts, reload the model to get created_at value added by database
if ($cart->getCreatedAt() == null) {
$cart = $cart->load($cart->getId());
}

$cart_token = substr(md5($cart->getCreatedAt().$cart->getId()),0,12);

$command = array(
Expand Down
2 changes: 1 addition & 1 deletion app/code/Ometria/Core/etc/module.xml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"><module name="Ometria_Core" setup_version="2.0.2"/></config>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"><module name="Ometria_Core" setup_version="2.0.3"/></config>
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ometria/magento2",
"type": "magento2-module",
"version": "2.0.2",
"version": "2.0.3",
"description": "Dev composer package for Ometria Extension",
"authors": [
{
Expand Down

0 comments on commit c6fe62f

Please sign in to comment.