Перейти до вмісту
Пошук в
  • Детальніше...
Шукати результати, які ...
Шукати результати в ...

google base


Briz

Recommended Posts

Подскажите как можно сделать чтобы в файле google_base показывало только 200 шт товаров, а не все ( потому как их ооочень много). Что нужно дописать в коде? осторе 1.5.4.1 . спасибо большое

Надіслати
Поділитися на інших сайтах


  В 21.08.2018 в 15:13, Briz сказав:

Подскажите как можно сделать чтобы в файле google_base показывало только 200 шт товаров, а не все ( потому как их ооочень много). Что нужно дописать в коде? осторе 1.5.4.1 . спасибо большое

Expand  

Можете скинуть код файла контроллера google base?

Надіслати
Поділитися на інших сайтах

  В 21.08.2018 в 15:46, flai0616 сказав:

Можете скинуть код файла контроллера google base?

Expand  
  Показати вміст

 

Надіслати
Поділитися на інших сайтах


  В 21.08.2018 в 15:13, Briz сказав:

Подскажите как можно сделать чтобы в файле google_base показывало только 200 шт товаров, а не все ( потому как их ооочень много). Что нужно дописать в коде? осторе 1.5.4.1 . спасибо большое

Expand  

Попробуйте этот код (сохраните исходник только:-)). Должно помочь

 

 

<?php 
class ControllerFeedGoogleBase extends Controller {
    public function index() {
        if ($this->config->get('google_base_status')) { 
            $output  = '<?xml version="1.0" encoding="UTF-8" ?>';
            $output .= '<rss version="2.0" xmlns:g="http://base.google.com/ns/1.0">';
            $output .= '<channel>';
            $output .= '<title>' . $this->config->get('config_name') . '</title>'; 
            $output .= '<description>' . $this->config->get('config_meta_description') . '</description>';
            $output .= '<link>' . HTTP_SERVER . '</link>';
            
            $this->load->model('catalog/category');
            
            $this->load->model('catalog/product');
            
            $this->load->model('tool/image');
            
            $products = $this->model_catalog_product->getProducts();
            
                foreach ($products as $product) {
                    for ($i = 0; $i <= 199; $i++) {    
                        if ($product['description']) {
                            $output .= '<item>';
                            $output .= '<title>' . html_entity_decode($product['name'], ENT_QUOTES, 'UTF-8') . '</title>';
                            $output .= '<link>' . str_replace('&', '&amp;', str_replace('&amp;', '&', $this->url->link('product/product', 'product_id=' . $product['product_id']))) . '</link>';
                            $output .= '<description><![CDATA[' . strip_tags(html_entity_decode($product['description'], ENT_QUOTES, 'UTF-8')) . ']]></description>';
                            $output .= '<g:brand>' . html_entity_decode($product['manufacturer'], ENT_QUOTES, 'UTF-8') . '</g:brand>';
                            $output .= '<g:condition>new</g:condition>';
                            $output .= '<g:id>' . $product['product_id'] . '</g:id>';
                            
                            if ($product['image']) {
                                $output .= '<g:image_link>' . $this->model_tool_image->resize($product['image'], 500, 500) . '</g:image_link>';
                            } else {
                                $output .= '<g:image_link>' . $this->model_tool_image->resize('no_image.jpg', 500, 500) . '</g:image_link>';
                            }
                            
                            $output .= '<g:mpn>' . $product['model'] . '</g:mpn>';

                            $supported_currencies = array('UAH', 'USD', 'EUR', 'GBP');

                            if (in_array($this->currency->getCode(), $supported_currencies)) {
                                $currency = $this->currency->getCode();
                            } else {
                                $currency = ($this->config->get('google_base_status')) ? $this->config->get('google_base_status') : 'UAH';
                            }
                                            
                            if ((float)$product['special']) {
                                $output .= '<g:price>' .  $this->currency->format($this->tax->calculate($product['special'], $product['tax_class_id']), $currency, false, false) . '</g:price>';
                            } else {
                                $output .= '<g:price>' . $this->currency->format($this->tax->calculate($product['price'], $product['tax_class_id']), $currency, false, false) . '</g:price>';
                            }
                       
                            $categories = $this->model_catalog_product->getCategories($product['product_id']);
                            
                            foreach ($categories as $category) {
                                $path = $this->getPath($category['category_id']);
                                
                                if ($path) {
                                    $string = '';
                                    
                                    foreach (explode('_', $path) as $path_id) {
                                        $category_info = $this->model_catalog_category->getCategory($path_id);
                                        
                                        if ($category_info) {
                                            if (!$string) {
                                                $string = $category_info['name'];
                                            } else {
                                                $string .= ' &gt; ' . $category_info['name'];
                                            }
                                        }
                                    }
                                 
                                    $output .= '<g:product_type>' . $string . '</g:product_type>';
                                }
                            }
                            
                            $output .= '<g:quantity>' . $product['quantity'] . '</g:quantity>';
                            $output .= '<g:upc>' . $product['upc'] . '</g:upc>'; 
                            $output .= '<g:weight>' . $this->weight->format($product['weight'], $product['weight_class_id']) . '</g:weight>'; 
                            $output .= '<g:availability>' . ($product['quantity'] ? 'in stock' : 'out of stock') . '</g:availability>';
                            $output .= '</item>';
                        }
                    }
                }

            $output .= '</channel>'; 
            $output .= '</rss>';    
            
            $this->response->addHeader('Content-Type: application/rss+xml; charset=utf-8');
            $this->response->setOutput($output);
        }
    }
    
    protected function getPath($parent_id, $current_path = '') {
        $category_info = $this->model_catalog_category->getCategory($parent_id);
    
        if ($category_info) {
            if (!$current_path) {
                $new_path = $category_info['category_id'];
            } else {
                $new_path = $category_info['category_id'] . '_' . $current_path;
            }    
        
            $path = $this->getPath($category_info['parent_id'], $new_path);
                    
            if ($path) {
                return $path;
            } else {
                return $new_path;
            }
        }
    }        
}
?>

 

Надіслати
Поділитися на інших сайтах

  В 21.08.2018 в 16:03, flai0616 сказав:

Попробуйте этот код (сохраните исходник только:-)). Должно помочь

 

 

<?php 
class ControllerFeedGoogleBase extends Controller {
    public function index() {
        if ($this->config->get('google_base_status')) { 
            $output  = '<?xml version="1.0" encoding="UTF-8" ?>';
            $output .= '<rss version="2.0" xmlns:g="http://base.google.com/ns/1.0">';
            $output .= '<channel>';
            $output .= '<title>' . $this->config->get('config_name') . '</title>'; 
            $output .= '<description>' . $this->config->get('config_meta_description') . '</description>';
            $output .= '<link>' . HTTP_SERVER . '</link>';
            
            $this->load->model('catalog/category');
            
            $this->load->model('catalog/product');
            
            $this->load->model('tool/image');
            
            $products = $this->model_catalog_product->getProducts();
            
                foreach ($products as $product) {
                    for ($i = 0; $i <= 199; $i++) {    
                        if ($product['description']) {
                            $output .= '<item>';
                            $output .= '<title>' . html_entity_decode($product['name'], ENT_QUOTES, 'UTF-8') . '</title>';
                            $output .= '<link>' . str_replace('&', '&amp;', str_replace('&amp;', '&', $this->url->link('product/product', 'product_id=' . $product['product_id']))) . '</link>';
                            $output .= '<description><![CDATA[' . strip_tags(html_entity_decode($product['description'], ENT_QUOTES, 'UTF-8')) . ']]></description>';
                            $output .= '<g:brand>' . html_entity_decode($product['manufacturer'], ENT_QUOTES, 'UTF-8') . '</g:brand>';
                            $output .= '<g:condition>new</g:condition>';
                            $output .= '<g:id>' . $product['product_id'] . '</g:id>';
                            
                            if ($product['image']) {
                                $output .= '<g:image_link>' . $this->model_tool_image->resize($product['image'], 500, 500) . '</g:image_link>';
                            } else {
                                $output .= '<g:image_link>' . $this->model_tool_image->resize('no_image.jpg', 500, 500) . '</g:image_link>';
                            }
                            
                            $output .= '<g:mpn>' . $product['model'] . '</g:mpn>';

                            $supported_currencies = array('UAH', 'USD', 'EUR', 'GBP');

                            if (in_array($this->currency->getCode(), $supported_currencies)) {
                                $currency = $this->currency->getCode();
                            } else {
                                $currency = ($this->config->get('google_base_status')) ? $this->config->get('google_base_status') : 'UAH';
                            }
                                            
                            if ((float)$product['special']) {
                                $output .= '<g:price>' .  $this->currency->format($this->tax->calculate($product['special'], $product['tax_class_id']), $currency, false, false) . '</g:price>';
                            } else {
                                $output .= '<g:price>' . $this->currency->format($this->tax->calculate($product['price'], $product['tax_class_id']), $currency, false, false) . '</g:price>';
                            }
                       
                            $categories = $this->model_catalog_product->getCategories($product['product_id']);
                            
                            foreach ($categories as $category) {
                                $path = $this->getPath($category['category_id']);
                                
                                if ($path) {
                                    $string = '';
                                    
                                    foreach (explode('_', $path) as $path_id) {
                                        $category_info = $this->model_catalog_category->getCategory($path_id);
                                        
                                        if ($category_info) {
                                            if (!$string) {
                                                $string = $category_info['name'];
                                            } else {
                                                $string .= ' &gt; ' . $category_info['name'];
                                            }
                                        }
                                    }
                                 
                                    $output .= '<g:product_type>' . $string . '</g:product_type>';
                                }
                            }
                            
                            $output .= '<g:quantity>' . $product['quantity'] . '</g:quantity>';
                            $output .= '<g:upc>' . $product['upc'] . '</g:upc>'; 
                            $output .= '<g:weight>' . $this->weight->format($product['weight'], $product['weight_class_id']) . '</g:weight>'; 
                            $output .= '<g:availability>' . ($product['quantity'] ? 'in stock' : 'out of stock') . '</g:availability>';
                            $output .= '</item>';
                        }
                    }
                }

            $output .= '</channel>'; 
            $output .= '</rss>';    
            
            $this->response->addHeader('Content-Type: application/rss+xml; charset=utf-8');
            $this->response->setOutput($output);
        }
    }
    
    protected function getPath($parent_id, $current_path = '') {
        $category_info = $this->model_catalog_category->getCategory($parent_id);
    
        if ($category_info) {
            if (!$current_path) {
                $new_path = $category_info['category_id'];
            } else {
                $new_path = $category_info['category_id'] . '_' . $current_path;
            }    
        
            $path = $this->getPath($category_info['parent_id'], $new_path);
                    
            if ($path) {
                return $path;
            } else {
                return $new_path;
            }
        }
    }        
}
?>

 

Expand  

что то выдает все ту же ошибку 
Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 1024 bytes)

 

хотя если было 200 товара точно бы загрузилось 

Надіслати
Поділитися на інших сайтах


  В 21.08.2018 в 16:11, Briz сказав:

что то выдает все ту же ошибку 
Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 1024 bytes)

 

хотя если было 200 товара точно бы загрузилось 

Expand  

 

А если так?)

 

<?php 
class ControllerFeedGoogleBase extends Controller {
    public function index() {
        if ($this->config->get('google_base_status')) { 
            $output  = '<?xml version="1.0" encoding="UTF-8" ?>';
            $output .= '<rss version="2.0" xmlns:g="http://base.google.com/ns/1.0">';
            $output .= '<channel>';
            $output .= '<title>' . $this->config->get('config_name') . '</title>'; 
            $output .= '<description>' . $this->config->get('config_meta_description') . '</description>';
            $output .= '<link>' . HTTP_SERVER . '</link>';
            
            $this->load->model('catalog/category');
            
            $this->load->model('catalog/product');
            
            $this->load->model('tool/image');
            
            $products = $this->model_catalog_product->getProducts();
            
                foreach ($products as $product) {
                    if ($product['product_id'] <= 200) {  
                        if ($product['description']) {
                            $output .= '<item>';
                            $output .= '<title>' . html_entity_decode($product['name'], ENT_QUOTES, 'UTF-8') . '</title>';
                            $output .= '<link>' . str_replace('&', '&amp;', str_replace('&amp;', '&', $this->url->link('product/product', 'product_id=' . $product['product_id']))) . '</link>';
                            $output .= '<description><![CDATA[' . strip_tags(html_entity_decode($product['description'], ENT_QUOTES, 'UTF-8')) . ']]></description>';
                            $output .= '<g:brand>' . html_entity_decode($product['manufacturer'], ENT_QUOTES, 'UTF-8') . '</g:brand>';
                            $output .= '<g:condition>new</g:condition>';
                            $output .= '<g:id>' . $product['product_id'] . '</g:id>';
                            
                            if ($product['image']) {
                                $output .= '<g:image_link>' . $this->model_tool_image->resize($product['image'], 500, 500) . '</g:image_link>';
                            } else {
                                $output .= '<g:image_link>' . $this->model_tool_image->resize('no_image.jpg', 500, 500) . '</g:image_link>';
                            }
                            
                            $output .= '<g:mpn>' . $product['model'] . '</g:mpn>';

                            $supported_currencies = array('UAH', 'USD', 'EUR', 'GBP');

                            if (in_array($this->currency->getCode(), $supported_currencies)) {
                                $currency = $this->currency->getCode();
                            } else {
                                $currency = ($this->config->get('google_base_status')) ? $this->config->get('google_base_status') : 'UAH';
                            }
                                            
                            if ((float)$product['special']) {
                                $output .= '<g:price>' .  $this->currency->format($this->tax->calculate($product['special'], $product['tax_class_id']), $currency, false, false) . '</g:price>';
                            } else {
                                $output .= '<g:price>' . $this->currency->format($this->tax->calculate($product['price'], $product['tax_class_id']), $currency, false, false) . '</g:price>';
                            }
                       
                            $categories = $this->model_catalog_product->getCategories($product['product_id']);
                            
                            foreach ($categories as $category) {
                                $path = $this->getPath($category['category_id']);
                                
                                if ($path) {
                                    $string = '';
                                    
                                    foreach (explode('_', $path) as $path_id) {
                                        $category_info = $this->model_catalog_category->getCategory($path_id);
                                        
                                        if ($category_info) {
                                            if (!$string) {
                                                $string = $category_info['name'];
                                            } else {
                                                $string .= ' &gt; ' . $category_info['name'];
                                            }
                                        }
                                    }
                                 
                                    $output .= '<g:product_type>' . $string . '</g:product_type>';
                                }
                            }
                            
                            $output .= '<g:quantity>' . $product['quantity'] . '</g:quantity>';
                            $output .= '<g:upc>' . $product['upc'] . '</g:upc>'; 
                            $output .= '<g:weight>' . $this->weight->format($product['weight'], $product['weight_class_id']) . '</g:weight>'; 
                            $output .= '<g:availability>' . ($product['quantity'] ? 'in stock' : 'out of stock') . '</g:availability>';
                            $output .= '</item>';
                        }
                    }
                }

            $output .= '</channel>'; 
            $output .= '</rss>';    
            
            $this->response->addHeader('Content-Type: application/rss+xml; charset=utf-8');
            $this->response->setOutput($output);
        }
    }
    
    protected function getPath($parent_id, $current_path = '') {
        $category_info = $this->model_catalog_category->getCategory($parent_id);
    
        if ($category_info) {
            if (!$current_path) {
                $new_path = $category_info['category_id'];
            } else {
                $new_path = $category_info['category_id'] . '_' . $current_path;
            }    
        
            $path = $this->getPath($category_info['parent_id'], $new_path);
                    
            if ($path) {
                return $path;
            } else {
                return $new_path;
            }
        }
    }        
}
?>

Надіслати
Поділитися на інших сайтах

  В 21.08.2018 в 16:14, flai0616 сказав:

 

А если так?)

 

<?php 
class ControllerFeedGoogleBase extends Controller {
    public function index() {
        if ($this->config->get('google_base_status')) { 
            $output  = '<?xml version="1.0" encoding="UTF-8" ?>';
            $output .= '<rss version="2.0" xmlns:g="http://base.google.com/ns/1.0">';
            $output .= '<channel>';
            $output .= '<title>' . $this->config->get('config_name') . '</title>'; 
            $output .= '<description>' . $this->config->get('config_meta_description') . '</description>';
            $output .= '<link>' . HTTP_SERVER . '</link>';
            
            $this->load->model('catalog/category');
            
            $this->load->model('catalog/product');
            
            $this->load->model('tool/image');
            
            $products = $this->model_catalog_product->getProducts();
            
                foreach ($products as $product) {
                    if ($product['product_id'] <= 200) {  
                        if ($product['description']) {
                            $output .= '<item>';
                            $output .= '<title>' . html_entity_decode($product['name'], ENT_QUOTES, 'UTF-8') . '</title>';
                            $output .= '<link>' . str_replace('&', '&amp;', str_replace('&amp;', '&', $this->url->link('product/product', 'product_id=' . $product['product_id']))) . '</link>';
                            $output .= '<description><![CDATA[' . strip_tags(html_entity_decode($product['description'], ENT_QUOTES, 'UTF-8')) . ']]></description>';
                            $output .= '<g:brand>' . html_entity_decode($product['manufacturer'], ENT_QUOTES, 'UTF-8') . '</g:brand>';
                            $output .= '<g:condition>new</g:condition>';
                            $output .= '<g:id>' . $product['product_id'] . '</g:id>';
                            
                            if ($product['image']) {
                                $output .= '<g:image_link>' . $this->model_tool_image->resize($product['image'], 500, 500) . '</g:image_link>';
                            } else {
                                $output .= '<g:image_link>' . $this->model_tool_image->resize('no_image.jpg', 500, 500) . '</g:image_link>';
                            }
                            
                            $output .= '<g:mpn>' . $product['model'] . '</g:mpn>';

                            $supported_currencies = array('UAH', 'USD', 'EUR', 'GBP');

                            if (in_array($this->currency->getCode(), $supported_currencies)) {
                                $currency = $this->currency->getCode();
                            } else {
                                $currency = ($this->config->get('google_base_status')) ? $this->config->get('google_base_status') : 'UAH';
                            }
                                            
                            if ((float)$product['special']) {
                                $output .= '<g:price>' .  $this->currency->format($this->tax->calculate($product['special'], $product['tax_class_id']), $currency, false, false) . '</g:price>';
                            } else {
                                $output .= '<g:price>' . $this->currency->format($this->tax->calculate($product['price'], $product['tax_class_id']), $currency, false, false) . '</g:price>';
                            }
                       
                            $categories = $this->model_catalog_product->getCategories($product['product_id']);
                            
                            foreach ($categories as $category) {
                                $path = $this->getPath($category['category_id']);
                                
                                if ($path) {
                                    $string = '';
                                    
                                    foreach (explode('_', $path) as $path_id) {
                                        $category_info = $this->model_catalog_category->getCategory($path_id);
                                        
                                        if ($category_info) {
                                            if (!$string) {
                                                $string = $category_info['name'];
                                            } else {
                                                $string .= ' &gt; ' . $category_info['name'];
                                            }
                                        }
                                    }
                                 
                                    $output .= '<g:product_type>' . $string . '</g:product_type>';
                                }
                            }
                            
                            $output .= '<g:quantity>' . $product['quantity'] . '</g:quantity>';
                            $output .= '<g:upc>' . $product['upc'] . '</g:upc>'; 
                            $output .= '<g:weight>' . $this->weight->format($product['weight'], $product['weight_class_id']) . '</g:weight>'; 
                            $output .= '<g:availability>' . ($product['quantity'] ? 'in stock' : 'out of stock') . '</g:availability>';
                            $output .= '</item>';
                        }
                    }
                }

            $output .= '</channel>'; 
            $output .= '</rss>';    
            
            $this->response->addHeader('Content-Type: application/rss+xml; charset=utf-8');
            $this->response->setOutput($output);
        }
    }
    
    protected function getPath($parent_id, $current_path = '') {
        $category_info = $this->model_catalog_category->getCategory($parent_id);
    
        if ($category_info) {
            if (!$current_path) {
                $new_path = $category_info['category_id'];
            } else {
                $new_path = $category_info['category_id'] . '_' . $current_path;
            }    
        
            $path = $this->getPath($category_info['parent_id'], $new_path);
                    
            if ($path) {
                return $path;
            } else {
                return $new_path;
            }
        }
    }        
}
?>

Expand  

нет и если я не ошибаюсь то это условие что если товара меньше или ровно 200 то формируется, а уменя товаров 25 000 и мне нужно чтобы только 200 формировалось

Надіслати
Поділитися на інших сайтах


  В 21.08.2018 в 16:19, Briz сказав:

нет и если я не ошибаюсь то это условие что если товара меньше или ровно 200 то формируется, а уменя товаров 25 000 и мне нужно чтобы только 200 формировалось

Expand  

Не совсем)

Это условие если id товара < или = 200 - выполнять условие if ($product['description']) 

Каждому товару в opencart присваивается уникальный идентификатор. возможно, в вашем случае, необходимо изменить цифру 200 на другую, чтобы оказалось именно 200 товаров.

Кеш модификаторов обновляли?

 

  • +1 1
Надіслати
Поділитися на інших сайтах

  В 21.08.2018 в 16:24, flai0616 сказав:

Не совсем)

Это условие если id товара < или = 200 - выполнять условие if ($product['description']) 

Каждому товару в opencart присваивается уникальный идентификатор. возможно, в вашем случае, необходимо изменить цифру 200 на другую, чтобы оказалось именно 200 товаров.

Кеш модификаторов обновляли?

 

Expand  

 

Не в обиду скажу, но логика у Вас отсутствует. Т.к. в БД могут отсутствовать товары c id меньше 200 и в итоге мы не получим не одного товара.

 

@Briz попробуйте после  $products = $this->model_catalog_product->getProducts();  написать $products = array_slice($products,0,200); должно вернуть 200 товаров.
 

  • +1 1
Надіслати
Поділитися на інших сайтах

  В 21.08.2018 в 16:24, flai0616 сказав:

Не совсем)

Это условие если id товара < или = 200 - выполнять условие if ($product['description']) 

Каждому товару в opencart присваивается уникальный идентификатор. возможно, в вашем случае, необходимо изменить цифру 200 на другую, чтобы оказалось именно 200 товаров.

Кеш модификаторов обновляли?

 

Expand  

обновляла, хоть убей 
Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 8024 bytes)  и все((((

Надіслати
Поділитися на інших сайтах


  В 21.08.2018 в 17:01, Bn174uk сказав:

 

Не в обиду скажу, но логика у Вас отсутствует. Т.к. в БД могут отсутствовать товары c id меньше 200 и в итоге мы не получим не одного товара.

 

@Briz попробуйте после  $products = $this->model_catalog_product->getProducts();  написать $products = array_slice($products,0,200); должно вернуть 200 товаров.
 

Expand  

выдает Parse error: syntax error, unexpected '' (T_STRING) на эту строчку что вставила

Надіслати
Поділитися на інших сайтах


  В 21.08.2018 в 17:01, Bn174uk сказав:

 

Не в обиду скажу, но логика у Вас отсутствует. Т.к. в БД могут отсутствовать товары c id меньше 200 и в итоге мы не получим не одного товара.

 

@Briz попробуйте после  $products = $this->model_catalog_product->getProducts();  написать $products = array_slice($products,0,200); должно вернуть 200 товаров.
 

Expand  

Без обид, но для этого случая указана следующая фраза:

"Каждому товару в opencart присваивается уникальный идентификатор. возможно, в вашем случае, необходимо изменить цифру 200 на другую, чтобы оказалось именно 200 товаров."

  В 21.08.2018 в 17:09, Briz сказав:

обновляла, хоть убей 
Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 8024 bytes)  и все((((

Expand  

Дайте ссылку на сайт в ЛС) Сейчас посмотрю)

  • +1 1
Надіслати
Поділитися на інших сайтах

  В 21.08.2018 в 17:12, Briz сказав:

выдает Parse error: syntax error, unexpected '' (T_STRING) на эту строчку что вставила

Expand  

Решение товарища @Bn174uk должно быть правильным.

Возможно вы не удалили закрывающую скобку моего цикла.

Попробуйте его рекомендацию написать в своем изначальном файле - должно помочь.

  • +1 1
Надіслати
Поділитися на інших сайтах

  В 21.08.2018 в 17:21, flai0616 сказав:

Решение товарища @Bn174uk должно быть правильным.

Возможно вы не удалили закрывающую скобку моего цикла.

Попробуйте его рекомендацию написать в своем изначальном файле - должно помочь.

Expand  

вставляю даже в оригинал все равно ошибка эта

Надіслати
Поділитися на інших сайтах


Уверены, что правильно вставили? 

Должно быть так http://prntscr.com/klka70

 

Проверил даже на тестовом http://test15.cmsshop.com.ua/index.php?route=feed/google_base вывело 3и товара, вместо 19шт.

  • +1 2
Надіслати
Поділитися на інших сайтах

  В 22.08.2018 в 09:59, Bn174uk сказав:

Уверены, что правильно вставили? 

Должно быть так http://prntscr.com/klka70

 

Проверил даже на тестовом http://test15.cmsshop.com.ua/index.php?route=feed/google_base вывело 3и товара, вместо 19шт.

Expand  

 

324234.png

Надіслати
Поділитися на інших сайтах


  Показати вміст

 

Надіслати
Поділитися на інших сайтах


  В 22.08.2018 в 10:32, Briz сказав:

 

324234.png

Expand  

 

Попробуйте эту строчку " $products = array_slice($products,0,200); " руками написать , т.к. когда вставляю Ваш код к себе, тоже самая ошибка, а когда строку пишу заново, все ок, ошибки нет.

  • +1 2
Надіслати
Поділитися на інших сайтах

  В 22.08.2018 в 10:32, Briz сказав:
  Показати вміст

 

Expand  

Удалите пробел после закрывающейся скобочки

$products = array_slice($products,0,200)"вот тут";

  • +1 2
Надіслати
Поділитися на інших сайтах

  В 22.08.2018 в 11:01, Bn174uk сказав:

 

Попробуйте эту строчку " $products = array_slice($products,0,200); " руками написать , т.к. когда вставляю Ваш код к себе, тоже самая ошибка, а когда строку пишу заново, все ок, ошибки нет.

Expand  

мистика ,но так сработало))) спасибо Вам большое=)))

Надіслати
Поділитися на інших сайтах


Створіть аккаунт або увійдіть для коментування

Ви повинні бути користувачем, щоб залишити коментар

Створити обліковий запис

Зареєструйтеся для отримання облікового запису. Це просто!

Зареєструвати аккаунт

Вхід

Уже зареєстровані? Увійдіть тут.

Вхід зараз
  • Зараз на сторінці   0 користувачів

    • Ні користувачів, які переглядиють цю сторінку
×
×
  • Створити...

Important Information

На нашому сайті використовуються файли cookie і відбувається обробка деяких персональних даних користувачів, щоб поліпшити користувальницький інтерфейс. Щоб дізнатися для чого і які персональні дані ми обробляємо перейдіть за посиланням . Якщо Ви натиснете «Я даю згоду», це означає, що Ви розумієте і приймаєте всі умови, зазначені в цьому Повідомленні про конфіденційність.