Version Notes
Release for econda Web Controlling functions.
Download this release
Release Info
| Developer | Magento Core Team |
| Extension | Mage_Econda |
| Version | 1.1.6 |
| Comparing to | |
| See all releases | |
Code changes from version 1.1.5 to 1.1.6
app/code/local/Mage/Econda/Block/Econda.php
CHANGED
|
@@ -42,12 +42,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
| 42 |
* ECONDA Tracking into Magento Shop-Systems.
|
| 43 |
*/
|
| 44 |
|
| 45 |
-
//require_once(
|
| 46 |
-
|
| 47 |
-
Mage::app ();
|
| 48 |
|
| 49 |
class Mage_Econda_Block_Econda extends Mage_Core_Block_Template
|
| 50 |
{
|
|
|
|
|
|
|
| 51 |
public function __construct()
|
| 52 |
{
|
| 53 |
parent::__construct();
|
|
@@ -56,8 +57,7 @@ class Mage_Econda_Block_Econda extends Mage_Core_Block_Template
|
|
| 56 |
|
| 57 |
public function getEmos()
|
| 58 |
{
|
| 59 |
-
|
| 60 |
-
|
| 61 |
/*
|
| 62 |
* config get language
|
| 63 |
*/
|
|
@@ -101,7 +101,7 @@ class Mage_Econda_Block_Econda extends Mage_Core_Block_Template
|
|
| 101 |
/*
|
| 102 |
* start of emos string
|
| 103 |
*/
|
| 104 |
-
$emosString = "\n\n<!-- Start Econda-Monitor
|
| 105 |
|
| 106 |
$emos = new EMOS($pathToFile);
|
| 107 |
|
|
@@ -156,7 +156,7 @@ class Mage_Econda_Block_Econda extends Mage_Core_Block_Template
|
|
| 156 |
$contentCheckout = $eLang[5];
|
| 157 |
$stepCheckout = 'PAYMENT';
|
| 158 |
}
|
| 159 |
-
if(stristr($realUrl,'checkout/multishipping/overview/') != false) {
|
| 160 |
$contentCheckout = $eLang[36];
|
| 161 |
$stepCheckout = 'REVIEW';
|
| 162 |
}
|
|
@@ -572,7 +572,7 @@ class Mage_Econda_Block_Econda extends Mage_Core_Block_Template
|
|
| 572 |
$emos->addLogin($customerId,1);
|
| 573 |
}
|
| 574 |
}
|
| 575 |
-
|
| 576 |
/*
|
| 577 |
* emos orderProcess multishipping checkout
|
| 578 |
*/
|
|
@@ -598,126 +598,138 @@ class Mage_Econda_Block_Econda extends Mage_Core_Block_Template
|
|
| 598 |
$session->setData('econda_order_id',$actOrder);
|
| 599 |
break;
|
| 600 |
case 'SUCCESS':
|
| 601 |
-
$emos->addOrderProcess("7_".$eLang[41]);
|
| 602 |
|
| 603 |
/*
|
| 604 |
* addEmosBillingPageArray checkout
|
| 605 |
*/
|
| 606 |
-
|
| 607 |
-
|
| 608 |
-
|
| 609 |
-
|
| 610 |
-
|
| 611 |
-
|
| 612 |
-
|
| 613 |
-
$
|
| 614 |
-
|
| 615 |
-
|
| 616 |
-
|
| 617 |
-
|
| 618 |
-
|
| 619 |
-
|
| 620 |
-
|
| 621 |
-
|
| 622 |
-
|
| 623 |
-
$
|
| 624 |
-
|
| 625 |
-
else {
|
| 626 |
-
$customerId = Mage::getSingleton('customer/session')->getCustomerId();
|
| 627 |
-
$tableSfqos = $tablePrefix.'sales_order';
|
| 628 |
-
$result = $db->query("SELECT increment_id FROM $tableSfqos WHERE customer_id = $customerId");
|
| 629 |
-
while($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
| 630 |
-
$lastOrderId = $row['increment_id'];
|
| 631 |
}
|
| 632 |
-
|
| 633 |
-
|
| 634 |
-
|
| 635 |
-
|
| 636 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 637 |
|
| 638 |
-
|
| 639 |
-
|
| 640 |
-
|
| 641 |
-
|
| 642 |
-
|
| 643 |
-
|
| 644 |
-
|
| 645 |
-
|
| 646 |
-
|
| 647 |
-
|
| 648 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 649 |
}
|
| 650 |
-
else {
|
| 651 |
-
$priceTotal += $row['base_grand_total'];
|
| 652 |
-
}
|
| 653 |
-
}
|
| 654 |
|
| 655 |
-
|
| 656 |
-
|
| 657 |
-
|
| 658 |
|
| 659 |
/*
|
| 660 |
* addEmosBasketPageArray checkout
|
| 661 |
*/
|
| 662 |
-
|
| 663 |
-
|
| 664 |
-
|
| 665 |
-
|
| 666 |
|
| 667 |
-
|
| 668 |
-
|
| 669 |
-
|
| 670 |
-
|
| 671 |
-
|
| 672 |
-
|
| 673 |
-
|
| 674 |
-
|
| 675 |
-
|
| 676 |
-
|
| 677 |
-
|
| 678 |
-
|
| 679 |
-
|
| 680 |
-
|
| 681 |
-
|
| 682 |
-
|
| 683 |
-
|
| 684 |
-
|
| 685 |
-
|
| 686 |
-
|
| 687 |
-
|
| 688 |
-
|
| 689 |
-
|
| 690 |
-
|
| 691 |
-
|
| 692 |
-
|
| 693 |
-
|
| 694 |
-
|
| 695 |
-
|
| 696 |
-
|
| 697 |
-
|
| 698 |
-
|
| 699 |
-
|
| 700 |
-
|
| 701 |
-
|
| 702 |
-
|
| 703 |
-
|
| 704 |
-
|
| 705 |
-
|
| 706 |
-
|
| 707 |
-
|
| 708 |
-
|
| 709 |
-
|
| 710 |
-
|
| 711 |
-
|
| 712 |
-
|
| 713 |
-
|
| 714 |
-
|
| 715 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 716 |
}
|
| 717 |
|
| 718 |
$emosString .= $emos->toString();
|
| 719 |
$emosString .= "\n<!-- End Econda-Monitor -->\n\n";
|
| 720 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 721 |
}
|
| 722 |
|
| 723 |
/*
|
| 42 |
* ECONDA Tracking into Magento Shop-Systems.
|
| 43 |
*/
|
| 44 |
|
| 45 |
+
//require_once Mage::getBaseDir().DS.'/app/Mage.php';
|
| 46 |
+
//Mage::app ();
|
|
|
|
| 47 |
|
| 48 |
class Mage_Econda_Block_Econda extends Mage_Core_Block_Template
|
| 49 |
{
|
| 50 |
+
var $econdaInt = false;
|
| 51 |
+
|
| 52 |
public function __construct()
|
| 53 |
{
|
| 54 |
parent::__construct();
|
| 57 |
|
| 58 |
public function getEmos()
|
| 59 |
{
|
| 60 |
+
require_once Mage::getModuleDir('', 'Mage_Econda').DS.'Block'.DS.'emos.php';
|
|
|
|
| 61 |
/*
|
| 62 |
* config get language
|
| 63 |
*/
|
| 101 |
/*
|
| 102 |
* start of emos string
|
| 103 |
*/
|
| 104 |
+
$emosString = "\n\n<!-- Start Econda-Monitor M116 -->\n\n";
|
| 105 |
|
| 106 |
$emos = new EMOS($pathToFile);
|
| 107 |
|
| 156 |
$contentCheckout = $eLang[5];
|
| 157 |
$stepCheckout = 'PAYMENT';
|
| 158 |
}
|
| 159 |
+
if(stristr($realUrl,'checkout/multishipping/overview/') != false || stristr($realUrl,'paypal/express/review/') != false) {
|
| 160 |
$contentCheckout = $eLang[36];
|
| 161 |
$stepCheckout = 'REVIEW';
|
| 162 |
}
|
| 572 |
$emos->addLogin($customerId,1);
|
| 573 |
}
|
| 574 |
}
|
| 575 |
+
|
| 576 |
/*
|
| 577 |
* emos orderProcess multishipping checkout
|
| 578 |
*/
|
| 598 |
$session->setData('econda_order_id',$actOrder);
|
| 599 |
break;
|
| 600 |
case 'SUCCESS':
|
| 601 |
+
$emos->addOrderProcess("7_".$eLang[41]);
|
| 602 |
|
| 603 |
/*
|
| 604 |
* addEmosBillingPageArray checkout
|
| 605 |
*/
|
| 606 |
+
|
| 607 |
+
try {
|
| 608 |
+
if(stristr($realUrl,'checkout/onepage/success/') != false || stristr($realUrl,'uospayment/success/') != false) {//onepage
|
| 609 |
+
$lastOrder = Mage::getSingleton('checkout/type_onepage')->getLastOrderId();
|
| 610 |
+
$lastOrderId = $lastOrder;
|
| 611 |
+
$quote = Mage::getSingleton('checkout/type_onepage')->getQuote();
|
| 612 |
+
$entityId = $quote->getData('entity_id');
|
| 613 |
+
if(empty($entityId)) {
|
| 614 |
+
$tableSfq = $tablePrefix.'sales_flat_quote';
|
| 615 |
+
$result = $db->query("SELECT entity_id FROM $tableSfq WHERE reserved_order_id = $lastOrder");
|
| 616 |
+
$row = $result->fetch(PDO::FETCH_ASSOC);
|
| 617 |
+
$entityId = $row['entity_id'];
|
| 618 |
+
}
|
| 619 |
+
}
|
| 620 |
+
else{//multipage
|
| 621 |
+
$entityId = intval($session->getData('econda_order_id'));
|
| 622 |
+
$orderIds = Mage::getSingleton('core/session')->getOrderIds(false);
|
| 623 |
+
if($orderIds && is_array($orderIds)) {
|
| 624 |
+
$lastOrderId = implode(' / ', $orderIds);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 625 |
}
|
| 626 |
+
else {
|
| 627 |
+
$customerId = Mage::getSingleton('customer/session')->getCustomerId();
|
| 628 |
+
$tableSfqos = $tablePrefix.'sales_order';
|
| 629 |
+
$result = $db->query("SELECT increment_id FROM $tableSfqos WHERE customer_id = $customerId");
|
| 630 |
+
while($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
| 631 |
+
$lastOrderId = $row['increment_id'];
|
| 632 |
+
}
|
| 633 |
+
}
|
| 634 |
+
}
|
| 635 |
+
|
| 636 |
+
$tableSfqa = $tablePrefix.'sales_flat_quote_address';
|
| 637 |
+
$result = $db->query("SELECT customer_id,city,postcode,country_id,base_grand_total,base_subtotal,base_tax_amount,base_shipping_tax_amount FROM $tableSfqa WHERE quote_id = $entityId and address_type = 'shipping'");
|
| 638 |
+
$priceTotal = 0;
|
| 639 |
|
| 640 |
+
while($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
| 641 |
+
$custCountry = $row['country_id'];
|
| 642 |
+
$custPostCode = $row['postcode'];
|
| 643 |
+
$custCity = $row['city'];
|
| 644 |
+
$custId = $row['customer_id'];
|
| 645 |
+
$ordId = $lastOrderId;
|
| 646 |
+
if(Mage::getStoreConfig($billingOption, $storeId) == '1') {
|
| 647 |
+
$priceTotal += $row['base_subtotal'];
|
| 648 |
+
}
|
| 649 |
+
else if(Mage::getStoreConfig($billingOption, $storeId) == '2') {
|
| 650 |
+
$priceTotal += $row['base_subtotal'] + $row['base_tax_amount'] - $row['base_shipping_tax_amount'];
|
| 651 |
+
}
|
| 652 |
+
else {
|
| 653 |
+
$priceTotal += $row['base_grand_total'];
|
| 654 |
+
}
|
| 655 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 656 |
|
| 657 |
+
$priceTotal = $this->convertPrice($priceTotal);
|
| 658 |
+
$custAdress = $custCountry.'/'.substr($custPostCode,0,1).'/'.substr($custPostCode,0,2).'/'.$custCity.'/'.$custPostCode;
|
| 659 |
+
$emos->addEmosBillingPageArray($ordId,$custId,$priceTotal,$custCountry,$custPostCode,$custCity);
|
| 660 |
|
| 661 |
/*
|
| 662 |
* addEmosBasketPageArray checkout
|
| 663 |
*/
|
| 664 |
+
$basket = array();
|
| 665 |
+
$bCounter = 0;
|
| 666 |
+
$tableSfqi = $tablePrefix.'sales_flat_quote_item';
|
| 667 |
+
$result = $db->query("SELECT product_id,name,qty,price,parent_item_id FROM $tableSfqi WHERE quote_id = $entityId");
|
| 668 |
|
| 669 |
+
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
| 670 |
+
if($row['parent_item_id'] == '') {
|
| 671 |
+
$getGroup = $this->getProductCategory($row['product_id']);
|
| 672 |
+
if($getGroup) $prodGroup = $getGroup;
|
| 673 |
+
else $prodGroup = $eLang[39];
|
| 674 |
+
$item = Mage::getModel('catalog/product')->load($row['product_id']);
|
| 675 |
+
$eItem = new EMOS_Item();
|
| 676 |
+
$eItem->productName = trim($row['name']);
|
| 677 |
+
$eItem->productID = $row['product_id'];
|
| 678 |
+
$eItem->quantity = number_format($row['qty'],0);
|
| 679 |
+
$discount = $row['product_id'];
|
| 680 |
+
$tablePrpr = $tablePrefix.'catalog_product_entity_tier_price';
|
| 681 |
+
$resultp = $db->query("SELECT qty,value FROM $tablePrpr WHERE entity_id = $discount");
|
| 682 |
+
$rowp = $resultp->fetch(PDO::FETCH_ASSOC);
|
| 683 |
+
$discountcheck = 0;
|
| 684 |
+
if($rowp) {
|
| 685 |
+
if($eItem->quantity >= $rowp['qty']) {
|
| 686 |
+
$discountcheck = $rowp['value'];
|
| 687 |
+
}
|
| 688 |
+
}
|
| 689 |
+
if(Mage::getStoreConfig($billingOption, $storeId) == '1') {
|
| 690 |
+
if($discountcheck > 0) {
|
| 691 |
+
$priceTax = Mage::helper('tax')->getPrice($item, $discountcheck, false, null, null, $item->getTaxClassId(), $storeId, true);
|
| 692 |
+
}
|
| 693 |
+
else if(Mage::helper('tax')->getPrice($item, $item->getFinalPrice(), false, null, null, $item->getTaxClassId(), $storeId, true) != 0) {
|
| 694 |
+
$priceTax = Mage::helper('tax')->getPrice($item, $item->getFinalPrice(), false, null, null, $item->getTaxClassId(), $storeId, true);
|
| 695 |
+
}
|
| 696 |
+
else {
|
| 697 |
+
$priceTax = Mage::helper('tax')->getPrice($item, $item->getPrice(), false, null, null, $item->getTaxClassId(), $storeId, true);
|
| 698 |
+
}
|
| 699 |
+
}
|
| 700 |
+
else {
|
| 701 |
+
if($discountcheck > 0) {
|
| 702 |
+
$priceTax = Mage::helper('tax')->getPrice($item, $discountcheck, false, null, null, $item->getTaxClassId(), $storeId, false);
|
| 703 |
+
}
|
| 704 |
+
else if(Mage::helper('tax')->getPrice($item, $item->getFinalPrice(), false, null, null, $item->getTaxClassId(), $storeId, false) != 0) {
|
| 705 |
+
$priceTax = Mage::helper('tax')->getPrice($item, $item->getFinalPrice(), false, null, null, $item->getTaxClassId(), $storeId, false);
|
| 706 |
+
}
|
| 707 |
+
else {
|
| 708 |
+
$priceTax = Mage::helper('tax')->getPrice($item, $item->getPrice(), false, null, null, $item->getTaxClassId(), $storeId, false);
|
| 709 |
+
}
|
| 710 |
+
}
|
| 711 |
+
$eItem->price = $this->convertPrice($priceTax);
|
| 712 |
+
$eItem->productGroup = $prodGroup.'/'.trim($row['name']);
|
| 713 |
+
$basket[$bCounter] = $eItem;
|
| 714 |
+
$bCounter += 1;
|
| 715 |
+
}
|
| 716 |
+
}
|
| 717 |
+
$emos->addEmosBasketPageArray($basket);
|
| 718 |
+
} catch (Exception $e) {
|
| 719 |
+
Mage::log("Econda on success no billing available");
|
| 720 |
+
}
|
| 721 |
+
break;
|
| 722 |
}
|
| 723 |
|
| 724 |
$emosString .= $emos->toString();
|
| 725 |
$emosString .= "\n<!-- End Econda-Monitor -->\n\n";
|
| 726 |
+
if(!$this->econdaInt) {
|
| 727 |
+
$this->econdaInt = true;
|
| 728 |
+
return $emosString;
|
| 729 |
+
}
|
| 730 |
+
else {
|
| 731 |
+
return "";
|
| 732 |
+
}
|
| 733 |
}
|
| 734 |
|
| 735 |
/*
|
app/code/local/Mage/Econda/Block/emos.php
CHANGED
|
@@ -712,6 +712,8 @@ class EMOS {
|
|
| 712 |
/* EMOS class end */
|
| 713 |
|
| 714 |
/* global Functions */
|
|
|
|
|
|
|
| 715 |
function getEmosECEvent($item, $event) {
|
| 716 |
$item = $this->emos_ItemFormat($item);
|
| 717 |
$out = "";
|
|
@@ -749,6 +751,8 @@ function getEMOSBasketEventArray($basket) {
|
|
| 749 |
return $b->getEmosBasketArray($basket, "emosBasketArray");
|
| 750 |
}
|
| 751 |
|
|
|
|
|
|
|
| 752 |
/* A Class to hold products as well a basket items
|
| 753 |
* If you want to track a product view, set the quantity to 1.
|
| 754 |
* For "real" basket items, the quantity should be given in your
|
| 712 |
/* EMOS class end */
|
| 713 |
|
| 714 |
/* global Functions */
|
| 715 |
+
|
| 716 |
+
/*
|
| 717 |
function getEmosECEvent($item, $event) {
|
| 718 |
$item = $this->emos_ItemFormat($item);
|
| 719 |
$out = "";
|
| 751 |
return $b->getEmosBasketArray($basket, "emosBasketArray");
|
| 752 |
}
|
| 753 |
|
| 754 |
+
*/
|
| 755 |
+
|
| 756 |
/* A Class to hold products as well a basket items
|
| 757 |
* If you want to track a product view, set the quantity to 1.
|
| 758 |
* For "real" basket items, the quantity should be given in your
|
app/code/local/Mage/Econda/etc/config.xml
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<Mage_Econda>
|
| 5 |
-
<version>1.1.
|
| 6 |
</Mage_Econda>
|
| 7 |
</modules>
|
| 8 |
<frontend>
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<Mage_Econda>
|
| 5 |
+
<version>1.1.6</version>
|
| 6 |
</Mage_Econda>
|
| 7 |
</modules>
|
| 8 |
<frontend>
|
app/design/frontend/default/default/template/econda/trackerop.phtml
CHANGED
|
@@ -51,7 +51,7 @@ if(stristr($realUrlOp,'checkout/onepage/') != false) {
|
|
| 51 |
}
|
| 52 |
|
| 53 |
if($emVersion == '2') {
|
| 54 |
-
$emosOut = "\n<!-- Start Econda-Monitor
|
| 55 |
$emosOut .= "\n<script type=\"text/javascript\">\n//<![CDATA[\n";
|
| 56 |
$emosOut .= " window.emosTrackVersion = 2;\n";
|
| 57 |
$emosOut .= "//]]>\n</script>";
|
|
@@ -66,7 +66,7 @@ if(stristr($realUrlOp,'checkout/onepage/') != false) {
|
|
| 66 |
$emosOut .= $emosLogin;
|
| 67 |
}
|
| 68 |
else {
|
| 69 |
-
$emosOut = "\n<!-- Start Econda-Monitor
|
| 70 |
$emosOut .= "\n<a name=\"emos_name\" title=\"content\" rel=\"Start/".$eLang[38]."\" rev=\"\"></a>\n";
|
| 71 |
$emosOut .= "<script type=\"text/javascript\">\n//<![CDATA[\n";
|
| 72 |
$emosOut .= " window.emosPageId = '".$setPageId."'; \n";
|
| 51 |
}
|
| 52 |
|
| 53 |
if($emVersion == '2') {
|
| 54 |
+
$emosOut = "\n<!-- Start Econda-Monitor M116 -->\n";
|
| 55 |
$emosOut .= "\n<script type=\"text/javascript\">\n//<![CDATA[\n";
|
| 56 |
$emosOut .= " window.emosTrackVersion = 2;\n";
|
| 57 |
$emosOut .= "//]]>\n</script>";
|
| 66 |
$emosOut .= $emosLogin;
|
| 67 |
}
|
| 68 |
else {
|
| 69 |
+
$emosOut = "\n<!-- Start Econda-Monitor M116 -->\n";
|
| 70 |
$emosOut .= "\n<a name=\"emos_name\" title=\"content\" rel=\"Start/".$eLang[38]."\" rev=\"\"></a>\n";
|
| 71 |
$emosOut .= "<script type=\"text/javascript\">\n//<