$this->model_tool_image->resize($product['image'], $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height'))
(https://www.example.com/image/cache/catalog/product.jpg)
can get main image url above line. i need all product image urls
(https://www.example.com/image/cache/catalog/product.jpg)
(https://www.example.com/image/cache/cat ... oduct1.jpg)
(https://www.example.com/image/cache/cat ... oduct2.jpg)
$results = $this->model_catalog_product->getProductImages($product['product_id']);
foreach ($results as $result) {
$data['images'][] = array(
----i can not connect the logic here-----
$output .= '<image>';
$output .= '</image>';
(https://www.example.com/image/cache/catalog/product.jpg)
can get main image url above line. i need all product image urls
(https://www.example.com/image/cache/catalog/product.jpg)
(https://www.example.com/image/cache/cat ... oduct1.jpg)
(https://www.example.com/image/cache/cat ... oduct2.jpg)
$results = $this->model_catalog_product->getProductImages($product['product_id']);
foreach ($results as $result) {
$data['images'][] = array(
----i can not connect the logic here-----
$output .= '<image>';
$output .= '</image>';
No OC version posted.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
From which controller filename are you posting these codes from?
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
hello again,
created xml file under catalog/controller/feed/. used a free xml feed and modified to my purpose up to images .
loads
$this->load->model('catalog/product');
$this->load->model('catalog/category');
$this->load->model('tool/image');
-------------can get options with their stocks-----------------------------
$options = $this->model_catalog_product->getProductOptions($product['product_id']);
foreach ($options as $option) {
foreach ($option['product_option_value'] as $value) {
$output .= '<Stock>';
$output .= '<Spec name="' . $option['name'] . '" >' . $value['name'] . '</spec>';
$output .= '</Stock>';
-------------can get main image----------------------------
$output .= '<image>' . $this->model_tool_image->resize($product['image'], $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height')) . '</image>';
but the other images
created xml file under catalog/controller/feed/. used a free xml feed and modified to my purpose up to images .
loads
$this->load->model('catalog/product');
$this->load->model('catalog/category');
$this->load->model('tool/image');
-------------can get options with their stocks-----------------------------
$options = $this->model_catalog_product->getProductOptions($product['product_id']);
foreach ($options as $option) {
foreach ($option['product_option_value'] as $value) {
$output .= '<Stock>';
$output .= '<Spec name="' . $option['name'] . '" >' . $value['name'] . '</spec>';
$output .= '</Stock>';
-------------can get main image----------------------------
$output .= '<image>' . $this->model_tool_image->resize($product['image'], $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height')) . '</image>';
but the other images
According to Google's API documentation: https://support.google.com/merchants/an ... 2112?hl=en , assuming you have this portion of code:
Add below:
This should resolve this issue.
Code: Select all
if ($product['image']) {
$output .= ' <g:image_link>' . $this->model_tool_image->resize($product['image'], 500, 500) . '</g:image_link>';
} else {
$output .= ' <g:image_link></g:image_link>';
}
Code: Select all
$additional_images = $this->model_catalog_product->getProductImages($product['product_id']);
foreach ($additional_images as $additional_image) {
$output .= ' <g:additional_image_link>' . $this->model_tool_image->resize($additional_image['image'], $this->config->get($this->config->get('config_theme') . '_image_popup_width'), $this->config->get($this->config->get('config_theme') . '_image_popup_height')) . '</g:additional_image_link>';
}
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
this does not work. do not understand where additional_images [image] is identified, since additional image is not an opencart variable. this isnot fot google. we would like to give our extra images links to customers whose can use our images.
$pictures_data = $this->model_catalog_product->getProductImages($product['product_id']);
$images = array();
foreach ($pictures_data as $picture_data) {
$images[] = array(
'popup1' => $this->model_tool_image->resize($picture_data['image'], $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height'))
);
}
$output .= '<image>' . $product['image'] . '</image>';
$pictures_data = $this->model_catalog_product->getProductImages($product['product_id']);
$images = array();
foreach ($pictures_data as $picture_data) {
$images[] = array(
'popup1' => $this->model_tool_image->resize($picture_data['image'], $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height'))
);
}
$output .= '<image>' . $product['image'] . '</image>';
i have 5 images for this product. with below image 4 url comes to xml (why? ), but the rest is not seen.
$pictures_data = $this->model_catalog_product->getProductImages($product['product_id']);
$images = array();
foreach ($pictures_data as $picture_data) {
$images[] = array(
'popup1' => $this->model_tool_image->resize($picture_data['image'], $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height'))
);
}
$output .= '<image>' . $this->model_tool_image->resize($product['image'], $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height')) . '</image>';
$pictures_data = $this->model_catalog_product->getProductImages($product['product_id']);
$images = array();
foreach ($pictures_data as $picture_data) {
$images[] = array(
'popup1' => $this->model_tool_image->resize($picture_data['image'], $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height'))
);
}
$output .= '<image>' . $this->model_tool_image->resize($product['image'], $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height')) . '</image>';
You are only posting partial codes which hardens supporters to provide an accurate answer to your question. In order to rectify this issue, please post your complete solution as a file attachment.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
thanks for your help. anyhow these codes are very good start point whose get the extra images url. i will share if i can solve.
Who is online
Users browsing this forum: No registered users and 284 guests