Strona główna forum Wsparcie Problemy z działaniem Wiarygodne Opinie - Okazje.info

Wiarygodne Opinie - Okazje.info

Wszystkie problemy związane z działaniem sklepu...

Post 29 maja 2013, o 10:38

Posty: 4
Gadu-Gadu: 0

Witam
Porównywarka cen Okazje.info.pl posiada program "Wiarygodne Opinie", coś jak Opinieo itp.
Nie posiadają wsparcia dla Magento, więc konieczne jest własnoręczne umieszczenie kodu na stronie, za pomocą którego wysyłana jest ankieta do kupujących.

Umieściłem kod w pliku success.php, jednak mam problem z wywołaniem odpowiednich funkcji.

<?php
$oiKey = '__KLUCZ__SKLEPU__UZYSKANY__OD__OKAZJE.INFO__';
$data = array(
'mail' => 'barcis@gmail.com', /*email klienta który dokonał zakupu*/
'orderId' => 1234, /*numer zamówienia*/
'orderAmount' => 17.43, /*łączna wartość zamówienia*/
'products' => array(
array(105485247 /*shop_produktu_id*/ ,4 /*ilość w koszyku*/),/*produkt 1*/
array(105485248 /*shop_produktu_id*/ ,2 /*ilość w koszyku*/),/*produkt 2*/
)
);
include_once 'oiTracker.php';
$oiTracker = new oiTracker($oiKey);
$r = $oiTracker->eOrder($data);
?>


Jak widać, kod musi pobrać e-mail, numer zamówienia, kwotę oraz ilość i sku.
Czy ktoś wie jak je wywołać?

Z góry dzięki !

Wiarygodne Opinie - Okazje.info

PostTeraz jest 28 kwi 2024, o 00:53
Google

Posty: 427
Lokalizacja: Internet

Post 29 maja 2013, o 12:42

Posty: 14
Gadu-Gadu: 0

w success.phtml:

$order = Mage::getModel('sales/order')->loadByIncrementId($this->getOrderId()); //pobierasz zamowienie
$orderValue = number_format ($order->getGrandTotal(), 2, '.' , $thousands_sep = ''); //pobierasz wartosc zamowienia
$orderItems = $order->getItemsCollection(); //pobierasz liste producktow
$email = $order->getShippingAddress()->getEmail(); //pobierasz email kupujacego

//potem wypisujesz kazdy produkt z listy. domyslam sie ze magiczne "shop_produktu_id" to SKU, wiec

foreach($orderItems as $item){
$product[] = $item->sku();
$product[] = $item->getQtyOrdered();
$products[] = $product;
}

$data['products'] = $products;
$data['mail'] = $email;
$data['orderId'] = $this->getOrderId();
$data['orderAmount'] = $orderValue;

Post 29 maja 2013, o 14:40

Posty: 4
Gadu-Gadu: 0

Dzięki za szybką odpowiedź.

Rozumiem, że nie uzupełniam kodu wklejonego przeze mnie w poprzednim poście, tylko wykorzystuje twój...
Jeżeli tak, to po umieszczeniu w success.phtml i złożeniu testowego zamówienia wyrzuca mi niebieską stronę "There has been an error processing your request".

Czy mogę Cię jeszcze prosić o informacje jak poprawnie go podpiąć pod success.phtml, kod poniżej:
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category design
* @package base_default
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
?>
<div class="page-title-big"><h1><?php echo $this->__('Your order has been received.') ?></h1></div>
<div class="page-title-dashline"></div>
<div class="fieldset">
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
<h2><?php echo $this->__('Thank you for your purchase!') ?></h2>

<?php if ($this->getOrderId()):?>
<?php if ($this->getCanViewOrder()) :?>
<p><?php echo $this->__('Your order # is: %s.', sprintf('<a href="%s">%s</a>', $this->escapeHtml($this->getViewOrderUrl()), $this->escapeHtml($this->getOrderId()))) ?></p>
<?php else :?>
<p><?php echo $this->__('Your order # is: %s.', $this->escapeHtml($this->getOrderId())) ?></p>
<?php endif;?>
<p><?php echo $this->__('You will receive an order confirmation email with details of your order and a link to track its progress.') ?></p>
<?php if ($this->getCanViewOrder() && $this->getCanPrintOrder()) :?>
<p>
<?php echo $this->__('Click <a href="%s" onclick="this.target=\'_blank\'">here to print</a> a copy of your order confirmation.', $this->getPrintUrl()) ?>
<?php echo $this->getChildHtml() ?>
</p>
<?php endif;?>
<?php endif;?>

<?php if ($this->getAgreementRefId()): ?>
<p><?php echo $this->__('Your billing agreement # is: %s.', sprintf('<a href="%s">%s</a>', $this->escapeHtml($this->getAgreementUrl()), $this->escapeHtml($this->getAgreementRefId())))?></p>
<?php endif;?>

<?php if ($profiles = $this->getRecurringProfiles()):?>
<p><?php echo $this->__('Your recurring payment profiles:'); ?></p>
<ul class="disc">
<?php foreach($profiles as $profile):?>
<?php $profileIdHtml = ($this->getCanViewProfiles() ? sprintf('<a href="%s">%s</a>', $this->escapeHtml($this->getProfileUrl($profile)), $this->escapeHtml($this->getObjectData($profile, 'reference_id'))) : $this->escapeHtml($this->getObjectData($profile, 'reference_id')));?>
<li><?php echo $this->__('Payment profile # %s: "%s".', $profileIdHtml, $this->escapeHtml($this->getObjectData($profile, 'schedule_description')))?></li>
<?php endforeach;?>
</ul>
<?php endif;?>
</div>
<div class="buttons-set">
<button type="button" class="opc-button-wide" title="<?php echo $this->__('Continue Shopping') ?>" onclick="window.location='<?php echo $this->getUrl() ?>'"><?php echo $this->__('Continue Shopping') ?></button>
</div>

Post 29 maja 2013, o 15:10

Posty: 14
Gadu-Gadu: 0

moj kod wyciagnie ci potrzebne dane. TY musisz je dodac do swojego skryptu. masz ladnie opisane co gdzie jest.

Wywala error, ale gdybys zajrzal do logow systemu to widzialbys ze popelnilem blad w linijce pobierajacej sku , powinno byc $product[] = $item->getSku(); zamiast $product[] = $item->sku();


Powrót do Problemy z działaniem