本文整理汇总了PHP中Carrier::getGroups方法的典型用法代码示例。如果您正苦于以下问题:PHP Carrier::getGroups方法的具体用法?PHP Carrier::getGroups怎么用?PHP Carrier::getGroups使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Carrier
的用法示例。
在下文中一共展示了Carrier::getGroups方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateCarrierData
protected function generateCarrierData()
{
$delimiter = ';';
$line = array();
$titles = array();
$id_lang = $this->use_lang;
$new_path = new Sampledatainstall();
$f = fopen($new_path->sendPath() . 'output/carriers.vsc', 'w');
foreach ($this->carriers_fields as $field => $array) {
$titles[] = $array['label'];
}
fputcsv($f, $titles, $delimiter, '"');
$carriers = Carrier::getCarriers($id_lang);
if ($carriers) {
foreach ($carriers as $carrier) {
$c = new Carrier($carrier['id_carrier'], $id_lang);
foreach ($this->carriers_fields as $field => $array) {
$line[$field] = property_exists('Carrier', $field) && !is_array($c->{$field}) && !Tools::isEmpty($c->{$field}) ? $c->{$field} : '';
}
$line['carrier_groups'] = $c->getGroups($carrier['id_carrier']) ? implode(',', $this->oneL($c->getGroups($carrier['id_carrier']))) : '';
$line['zones'] = $this->getCarrierZones($carrier['id_carrier']) ? implode(',', $this->getCarrierZones($carrier['id_carrier'])) : '';
$line['range_price'] = $this->getRengePriceByCarrier('range_price', $carrier['id_carrier']) ? implode(',', $this->getRengePriceByCarrier('range_price', $carrier['id_carrier'])) : '';
$line['range_weight'] = $this->getRengePriceByCarrier('range_weight', $carrier['id_carrier']) ? implode(',', $this->getRengePriceByCarrier('range_weight', $carrier['id_carrier'])) : '';
if (file_exists(_PS_SHIP_IMG_DIR_ . $c->id . '.jpg')) {
$this->copyConverFileName(_PS_SHIP_IMG_DIR_ . $c->id . '.jpg');
}
if (!$line[$field]) {
$line[$field] = '';
}
fputcsv($f, $line, $delimiter, '"');
}
}
fclose($f);
}