-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple pieces in shipment request #1
Comments
Hello Marko, Thanks for your feedback. I added multivalues handling for entities and datatypes. Therefore, you should be able now to do the following : use DHL\Datatype\GB\Piece; // Test a ShipmentRequestRequest using DHL XML API // Set values of the request $piece = new Piece(); $piece = new Piece(); $sample->ShipmentDetails->Weight = '10.0'; |
Hello, I can not find the code for the function addPiece in source code |
Hello Ominet, The addPiece method is handled by the magic method __call in the base entity and datatype classes. It is based on the definition of the property. If a property has multivalues set to true (that means that it is an array of elements), then the add{Propertyname} method will work. Thanks, |
Hello,
Congratulations on DHL-APi, very nice work.
One question. How can you add multiple shipment pieces in shipment request.
For example:
$sample->ShipmentDetails->NumberOfPieces = '2';
$sample->ShipmentDetails->Pieces->Piece->PieceID = '1';
$sample->ShipmentDetails->Pieces->Piece->PackageType = 'EE';
$sample->ShipmentDetails->Pieces->Piece->Weight = '10.0';
$sample->ShipmentDetails->Pieces->Piece->DimWeight = '1200.0';
$sample->ShipmentDetails->Pieces->Piece->Width = '100';
$sample->ShipmentDetails->Pieces->Piece->Height = '200';
$sample->ShipmentDetails->Pieces->Piece->Depth = '300';
$sample->ShipmentDetails->Pieces->Piece->PieceID = '2';
$sample->ShipmentDetails->Pieces->Piece->PackageType = 'EE';
$sample->ShipmentDetails->Pieces->Piece->Weight = '15.0';
$sample->ShipmentDetails->Pieces->Piece->DimWeight = '1100.0';
$sample->ShipmentDetails->Pieces->Piece->Width = '50';
$sample->ShipmentDetails->Pieces->Piece->Height = '50';
$sample->ShipmentDetails->Pieces->Piece->Depth = '100';
But it accepts only one piece. How can I add another one?
Thank you for your time.
Sincerely,
Marko Jovanovic
The text was updated successfully, but these errors were encountered: