mirror of
https://github.com/retailcrm/opencart-module.git
synced 2024-11-25 14:46:06 +03:00
fix path of export controller, fix empty values
This commit is contained in:
parent
76a4fa6b70
commit
e00b16397c
@ -9,10 +9,12 @@
|
|||||||
<?php if ($error_warning) : ?>
|
<?php if ($error_warning) : ?>
|
||||||
<div class="warning"><?php echo $error_warning; ?></div>
|
<div class="warning"><?php echo $error_warning; ?></div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
<?php if (isset($saved_settings['intarocrm_url'])): ?>
|
||||||
<div class="success">
|
<div class="success">
|
||||||
<?php echo $text_notice; ?>
|
<?php echo $text_notice; ?>
|
||||||
<a href="<?php echo $saved_settings['intarocrm_url']; ?>/admin/settings#t-main"><?php echo $saved_settings['intarocrm_url']; ?>/admin/settings#t-main</a>
|
<a href="<?php echo $saved_settings['intarocrm_url']; ?>/admin/settings#t-main"><?php echo $saved_settings['intarocrm_url']; ?>/admin/settings#t-main</a>
|
||||||
</div>
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="heading">
|
<div class="heading">
|
||||||
@ -26,14 +28,14 @@
|
|||||||
<h3><?php echo $intarocrm_base_settings; ?></h3>
|
<h3><?php echo $intarocrm_base_settings; ?></h3>
|
||||||
<div class="intarocrm_unit">
|
<div class="intarocrm_unit">
|
||||||
<label for="intarocrm_url"><?php echo $intarocrm_url; ?></label><br>
|
<label for="intarocrm_url"><?php echo $intarocrm_url; ?></label><br>
|
||||||
<input id="intarocrm_url" type="text" name="intarocrm_url" value="<?php echo $saved_settings['intarocrm_url']; ?>">
|
<input id="intarocrm_url" type="text" name="intarocrm_url" value="<?php if (isset($saved_settings['intarocrm_url'])): echo $saved_settings['intarocrm_url']; endif; ?>">
|
||||||
</div>
|
</div>
|
||||||
<div class="intarocrm_unit">
|
<div class="intarocrm_unit">
|
||||||
<label for="intarocrm_apikey"><?php echo $intarocrm_apikey; ?></label><br>
|
<label for="intarocrm_apikey"><?php echo $intarocrm_apikey; ?></label><br>
|
||||||
<input id="intarocrm_apikey" type="text" name="intarocrm_apikey" value="<?php echo $saved_settings['intarocrm_apikey']; ?>">
|
<input id="intarocrm_apikey" type="text" name="intarocrm_apikey" value="<?php if (isset($saved_settings['intarocrm_apikey'])): echo $saved_settings['intarocrm_apikey']; endif;?>">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php if ($saved_settings['intarocrm_apikey'] != '' && $saved_settings['intarocrm_url'] != ''): ?>
|
<?php if (isset($saved_settings['intarocrm_apikey']) && $saved_settings['intarocrm_apikey'] != '' && isset($saved_settings['intarocrm_url']) && $saved_settings['intarocrm_url'] != ''): ?>
|
||||||
|
|
||||||
<?php if (!empty($intarocrm_errors)) : ?>
|
<?php if (!empty($intarocrm_errors)) : ?>
|
||||||
<?php foreach($intarocrm_errors as $intarocrm_error): ?>
|
<?php foreach($intarocrm_errors as $intarocrm_error): ?>
|
||||||
@ -47,7 +49,7 @@
|
|||||||
<div class="intarocrm_unit">
|
<div class="intarocrm_unit">
|
||||||
<select id="intarocrm_delivery_<?php echo $key; ?>" name="intarocrm_delivery[<?php echo $key; ?>]" >
|
<select id="intarocrm_delivery_<?php echo $key; ?>" name="intarocrm_delivery[<?php echo $key; ?>]" >
|
||||||
<?php foreach ($delivery['intarocrm'] as $k => $v): ?>
|
<?php foreach ($delivery['intarocrm'] as $k => $v): ?>
|
||||||
<option value="<?php echo $v['code'];?>" <?php if($v['code'] == $saved_settings['intarocrm_delivery'][$key]):?>selected="selected"<?php endif;?>>
|
<option value="<?php echo $v['code'];?>" <?php if(isset($saved_settings['intarocrm_delivery'][$key]) && $v['code'] == $saved_settings['intarocrm_delivery'][$key]):?>selected="selected"<?php endif;?>>
|
||||||
<?php echo $v['name'];?>
|
<?php echo $v['name'];?>
|
||||||
</option>
|
</option>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
@ -62,7 +64,7 @@
|
|||||||
<div class="intarocrm_unit">
|
<div class="intarocrm_unit">
|
||||||
<select id="intarocrm_status_<?php echo $uid; ?>" name="intarocrm_status[<?php echo $uid; ?>]" >
|
<select id="intarocrm_status_<?php echo $uid; ?>" name="intarocrm_status[<?php echo $uid; ?>]" >
|
||||||
<?php foreach ($statuses['intarocrm'] as $k => $v): ?>
|
<?php foreach ($statuses['intarocrm'] as $k => $v): ?>
|
||||||
<option value="<?php echo $v['code'];?>" <?php if($v['code'] == $saved_settings['intarocrm_status'][$uid]):?>selected="selected"<?php endif;?>>
|
<option value="<?php echo $v['code'];?>" <?php if(isset($saved_settings['intarocrm_status'][$uid]) && $v['code'] == $saved_settings['intarocrm_status'][$uid]):?>selected="selected"<?php endif;?>>
|
||||||
<?php echo $v['name'];?>
|
<?php echo $v['name'];?>
|
||||||
</option>
|
</option>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
@ -76,7 +78,7 @@
|
|||||||
<div class="intarocrm_unit">
|
<div class="intarocrm_unit">
|
||||||
<select id="intarocrm_payment_<?php echo $key; ?>" name="intarocrm_payment[<?php echo $key; ?>]" >
|
<select id="intarocrm_payment_<?php echo $key; ?>" name="intarocrm_payment[<?php echo $key; ?>]" >
|
||||||
<?php foreach ($payments['intarocrm'] as $k => $v): ?>
|
<?php foreach ($payments['intarocrm'] as $k => $v): ?>
|
||||||
<option value="<?php echo $v['code'];?>" <?php if($v['code'] == $saved_settings['intarocrm_payment'][$key]):?>selected="selected"<?php endif;?>>
|
<option value="<?php echo $v['code'];?>" <?php if(isset($saved_settings['intarocrm_payment'][$key]) && $v['code'] == $saved_settings['intarocrm_payment'][$key]):?>selected="selected"<?php endif;?>>
|
||||||
<?php echo $v['name'];?>
|
<?php echo $v['name'];?>
|
||||||
</option>
|
</option>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
@ -12,7 +12,8 @@ class ControllerExportIntarocrm extends Controller {
|
|||||||
|
|
||||||
private function xml()
|
private function xml()
|
||||||
{
|
{
|
||||||
$this->dd = DOMDocument::loadXML('<?xml version="1.0" encoding="UTF-8"?>
|
$this->dd = new DOMDocument();
|
||||||
|
$this->dd->loadXML('<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<yml_catalog date="'.date('Y-m-d H:i:s').'">
|
<yml_catalog date="'.date('Y-m-d H:i:s').'">
|
||||||
<shop>
|
<shop>
|
||||||
<name>'.$this->config->get('config_name').'</name>
|
<name>'.$this->config->get('config_name').'</name>
|
||||||
@ -84,22 +85,29 @@ class ControllerExportIntarocrm extends Controller {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if ($offer['sku'] != '') {
|
||||||
$sku = $this->dd->createElement('param');
|
$sku = $this->dd->createElement('param');
|
||||||
$sku->setAttribute('name', 'article');
|
$sku->setAttribute('name', 'article');
|
||||||
$sku->appendChild($this->dd->createTextNode($offer['sku']));
|
$sku->appendChild($this->dd->createTextNode($offer['sku']));
|
||||||
$e->appendChild($sku);
|
$e->appendChild($sku);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($offer['weight'] != '') {
|
||||||
$weight = $this->dd->createElement('param');
|
$weight = $this->dd->createElement('param');
|
||||||
$weight->setAttribute('name', 'weight');
|
$weight->setAttribute('name', 'weight');
|
||||||
$weight->appendChild($this->dd->createTextNode($offer['weight'] . ' ' . $offer['weight_class']));
|
$weightValue = (isset($offer['weight_class'])) ? $offer['weight'] . ' ' . $offer['weight_class'] : $offer['weight'];
|
||||||
|
$weight->appendChild($this->dd->createTextNode($weightValue));
|
||||||
$e->appendChild($weight);
|
$e->appendChild($weight);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($offer['length'] != '' && $offer['width'] != '' && $offer['height'] != '') {
|
||||||
$size = $this->dd->createElement('param');
|
$size = $this->dd->createElement('param');
|
||||||
$size->setAttribute('name', 'size');
|
$size->setAttribute('name', 'size');
|
||||||
$size->appendChild($this->dd->createTextNode($offer['length'] .'x'. $offer['width'] .'x'. $offer['height']));
|
$size->appendChild($this->dd->createTextNode($offer['length'] .'x'. $offer['width'] .'x'. $offer['height']));
|
||||||
$e->appendChild($size);
|
$e->appendChild($size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
Loading…
Reference in New Issue
Block a user