1
0
mirror of synced 2025-02-22 01:43:14 +03:00

Fix api request (#15)

This commit is contained in:
Akolzin Dmitry 2017-09-07 14:51:44 +03:00 committed by Alex Lushpai
parent 3ce1885da0
commit 88f502a878
2 changed files with 139 additions and 136 deletions

View File

@ -84,7 +84,7 @@ if ( ! class_exists( 'WC_Retailcrm_Base' ) ) :
);
if ($this->get_option( 'api_url' ) != '' && $this->get_option( 'api_key' ) != '') {
if (isset($_GET['page']) && $_GET['page'] == 'wc-settings' && isset($_GET['tab']) && $_GET['tab'] == 'integration') {
$retailcrm = new WC_Retailcrm_Proxy(
$this->get_option( 'api_url' ),
$this->get_option( 'api_key' ),
@ -241,6 +241,7 @@ if ( ! class_exists( 'WC_Retailcrm_Base' ) ) :
}
}
}
}
public function generate_button_html( $key, $data ) {
$field = $this->plugin_id . $this->id . '_' . $key;

View File

@ -368,7 +368,9 @@ if ( ! class_exists( 'WC_Retailcrm_Icml' ) ) :
if (!empty($attributes)) {
foreach ($attributes as $attribute_name => $attribute) {
$attributeValue = end(get_post_meta($product->get_id(), 'attribute_'.$attribute_name));
$id_product = $product->get_id();
$arrAttributeValue = get_post_meta($id_product, 'attribute_'.$attribute_name);
$attributeValue = end($arrAttributeValue);
if ($attribute['is_visible'] == 1 && !empty($attribute['value'])) {
$params[] = array(
'code' => $attribute_name,