質問

私たちの広告会社の1つから追跡ピクセルを受け取りました、そして彼らは私にそのコードを注文確認ページに配置するように頼んだ。

まず最初にいくつかはマゼントの注文確認ファイルがどこにあるのかを教えてください。

と2nd私が "注文ID"の値と注文の「金額」を取得する必要がある場合は、このピクセルで使用するものです。

<img src="https://www.emjcd.com/u?AMOUNT=AMOUNT&CID=7777777&OID=OID&TYPE=5555555&CURRENCY=GBP&METHOD=IMG" height="1" width="20"/> 
.

ここで詳細情報を入手することができます。 http://www.priceRunner.co.uk / about / sales-tracking-ofsing.html

役に立ちましたか?

解決

あなたはあなたの基本テンプレートファイルを

からコピーする必要があります。
app/design/frontend/base/default/template/checkout/success.phtml
.

あなたのUltimoテーマパス

app/design/frontend/ultimo/default/template/checkout
.

Success.phtmlファイル

で下のコードを入れることができます。
<?php    
    $order_id = Mage::getSingleton('checkout/session')->getLastRealOrderId();
    $order = Mage::getModel('sales/order')->loadByIncrementId($order_id);
    $grandTotal = $order->getGrandTotal();
    $orderCurrency = $order->getOrderCurrencyCode();
?>

<img src="https://www.emjcd.com/u?AMOUNT=<?php echo $grandTotal; ?>&CID=7777777&OID='<?php echo $order_id;?>'&TYPE=5555555&CURRENCY=<?php echo $orderCurrency; ?>&METHOD=IMG" height="1" width="20"/>        
.

他のヒント

あなたがRWDテーマを使っているならば、それは /app/design/frontend/rwd/default/template/checkout/success.phtml

注文オブジェクトは確認ページには存在しません - すでにこの段階でアンロードされています。そのため、注文保存機能にフックするモジュールを書くことができますが、クイック修正が必要な場合は、(Success.phtml)のような最後の注文IDをロードすることができます。

$lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
$order = Mage::getSingleton('sales/order'); 
$order->load($lastOrderId);
$_totalData =$order->getData(); 
$_sub = $_totalData['subtotal'];
.

Magento V2.1.x

これはあなたがいくつかの余分な値として必要なものだけ

<?php
$merchantid = "<ID>";

$objectManager  =  \Magento\Framework\App\ObjectManager::getInstance();
$orderId        = $block->getOrderId();
$order          = $objectManager
                    ->create('Magento\Sales\Model\Order')
                    ->loadByIncrementId($orderId);
$subtotal       = $order->getSubtotal();
$discount       = $order->getDiscountAmount(); 
$affiliateTotal = ($subtotal + $discount);

$ordered_items = $order->getAllVisibleItems();
$skulist = '';
$pricelist = '';
$quantitylist = '';

$last_index = array_search(end($ordered_items), $ordered_items, true);
foreach($ordered_items as $index => $item){
    $delimiter    = $index === $last_index ? '' : ',';
    $skulist      .= $item->getSku() . $delimiter;
    $quantitylist .= ceil($item->getQtyOrdered()) . $delimiter;
    $pricelist    .= ($item->getProduct()->getFinalPrice() - ($item->getDiscountAmount() / $item->getQtyOrdered())) . $delimiter;
}
$couponcodes = $order->getCouponCode();

$currency = $order->getOrderCurrencyCode();
//render pixel below
?>
<img src="https://www.emjcd.com/u?tracking=<?php echo $orderId ?>&amp;amount=<?php echo $affiliateTotal ?>&amp;transtype=sale&amp;merchantID=<?php echo $merchantid ?>&amp;couponcode=<?php echo $couponcodes ?>&amp;skulist=<?php echo $skulist ?>&amp;quantitylist=<?php echo $quantitylist ?>&amp;pricelist=<?php echo $pricelist ?>&amp;currency=<?php echo $currency ?>&amp;v=2.0" width="1" height="1">
.

ライセンス: CC-BY-SA帰属
所属していません magento.stackexchange
scroll top