I have this little snippet of code:
$writer->startElement('ShippingMethod');
$writer->text($shipping_method);
$writer->endElement();
I want to make it so that if the Shipping Method is “USPS-FCM” what gets written out is “USPS-FCM-DC”, otherwise if it’s anything else, whatever was passed in as the shipping method should get written out. Basically I’m trying to add an if, then, else statement. I tried the below, but I must have the syntax wrong. Can anyone help? Thanks.
$writer->startElement('ShippingMethod');
if ($shipping_method='USPS-FCM');
{
$writer->text('USPS-FCM-DC');;
}
else
{
$writer->text($shipping_method);
}
$writer->endElement();