public $totalPrice;public $increment_id; //aka. increment ID in magento.public $storeName;public $storeUrl;public $logoUrl;public $secret; // not really nessesary but still here as a perhaps future implementationpublic $time;public $date;public $desc;public $sendTrashPrice;public $transactionID; function __construct($_totalPrice, $_increment_id, $_storeName, $_storeUrl, $_logoUrl){ $this->totalPrice = $_totalPrice; $this->_increment_id = $_increment_id; $this->storeName = $_storeName; $this->storeUrl = $_storeUrl; $this->logoUrl = $_logoUrl;}
Notice the _increment_id
it creates a seperate field for that variable and the other one will stay null
onsdag den 30. marts 2016
onsdag den 2. marts 2016
a bad translator
/*********************** * Formats the text to danish so this can be send through email. * @param $json * @return string * ***********************/ function format_text($json){ //$json must be decoded else it will not work. $text = ""; $responseIterator = new RecursiveIteratorIterator( new RecursiveArrayIterator($json), RecursiveIteratorIterator::SELF_FIRST); foreach ($responseIterator as $key => $val) { if(is_array($val)) { //order, items, (hver tal i arrayet), addresses, shipping, billing switch($key){ case "order": $text .= "ordre: " . "</br>"; break; case "items": $text .= "vare: " . "</br>"; break; case "addresses": $text .= "addresser: " . "</br>"; break; case "shipping": $text .= "forsendelsinformation: " . "</br>"; break; case "billing": $text .= "faktureringsinformation: " . "</br>"; break; } } else { //increment_id, name, width, height, qty_ordered, entity_id, parent_id, customer_address_id, quote_address_id, region_id, customer_id, // fax, region, postcode, lastname, street, city, email, telephone, country_id, firstname, address_type, prefix, middlename, suffix, company switch($key){ case "increment_id": $text .= "<p class='email-value'>ordrenummer: " . $val . "</p>"; break; case "name": $text .= "<p class='email-value'>varenavn: " . $val . "</p>"; break; case "width": $text .= "<p class='email-value'>bredde: " . $val . "</p>"; break; case "height": $text .= "<p class='email-value'>højde: " . $val . "</p>"; break; case "qty_ordered": $text .= "<p class='email-value'>antal: " . $val . "</p>"; break; case "entity_id": $text .= "<p class='email-value'>forsendelses id: " . $val . "</p>"; break; case "parent_id": $text .= "<p class='email-value'>parent_id: " . $val . "</p>"; break; case "customer_address_id": $text .= "<p class='email-value'>kunde addresse id " . $val . "</p>"; break; case "quote_address_id": $text .= "<p class='email-value'>quote_address_id: " . $val . "</p>"; break; case "region_id": $text .= "<p class='email-value'>region_id: " . $val . "</p>"; break; case "customer_id": $text .= "<p class='email-value'>kunde id: " . $val . "</p>"; break; case "fax": $text .= "<p class='email-value'>fax: " . $val . "</p>"; break; case "region": $text .= "<p class='email-value'>region: " . $val . "</p>"; break; case "postcode": $text .= "<p class='email-value'>postnummer: " . $val . "</p>"; break; case "lastname": $text .= "<p class='email-value'>efternavn: " . $val . "</p>"; break; case "street": $text .= "<p class='email-value'>gade: " . $val . "</p>"; break; case "city, ": $text .= "<p class='email-value'>by: " . $val . "</p>"; break; case "email": $text .= "<p class='email-value'>email: " . $val . "</p>"; break; case "telephone": $text .= "<p class='email-value'>telefon nummer: " . $val . "</p>"; break; case "country_id": $text .= "<p class='email-value'>landsid: " . $val . "</p>"; break; case "firstname": $text .= "<p class='email-value'>fornavn: " . $val . "</p>"; break; case "address_type": $text .= "<p class='email-value'>addresse type " . $val . "</p>"; break; } } } return $text;}
Abonner på:
Opslag (Atom)