0

私は Magento ストア (1.4.1) で追跡を設定する必要があります。

基本的に、注文したアイテムを含む注文確認ページから文字列変数を作成する必要があり、文字列内の各アイテムをパイプ記号 (|) で区切り、各アイテムの各プロパティを 2 つのコロンで区切る必要があります ( ::)。

また、同じ注文で同じアイテムが複数回購入された場合、文字列の受信者が qty 変数をサポートしていないため、複数の個別のアイテムとして扱う必要があります。

必要な文字列形式の例は次のとおりです。

$purchased_items="1234::9.99::CD Album::CD002345|1255::12.99::James Bond DVD::DVD001234::ABCD123|1255::12.99::James Bond DVD::DVD001234::ABCD123";

誰かが以前に同様のソリューションを実装したことを願っています-提供されたヘルプに感謝します!

4

1 に答える 1

0

ここにいくつかのメタコードがあります (テストされていません) 正しい注文オブジェクトを渡します

//we need a buffer
$stringArray = array();

//and we need to iterate over all objects (note that they are objects)
foreach ($_order->getAllItems() as $item){
    //add your formatted strings to buffer array by imploding the product information array
    $stringArray[]= implode('::',$item->getProduct()->getData());
}

//$string will contain the stuff you need to echo
$string = implode('|', $stringArray); 

$stringArray = null; 
于 2012-08-06T10:55:40.553 に答える