News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

BUG missing images

Started by 2dmaster, July 10, 2018, 13:23:14 PM

Previous topic - Next topic

2dmaster

Hello, o have 2 images for my product, but i have big problem, please help me
i have this code when var_dump($product); where missing image ? i have two images for this product! at site images work fine, but i have in var-dump only one image, why ??
is robur-6-1800-3.jpg
and robur-6-1800-3-1.jpg

how to automatically pull out the link and data of the second image(image №2)? I only work with the first picture i cant find second image !!! why ??

joomla 3.8.10, vm 3.2.14, php 7.2


<?php
object
(stdClass)#1423 (110) { ["virtuemart_manufacturer_id"]=> array(1) { [0]=> string(2) "14" } ["mf_name"]=> string(5) "Robur" 
..................................................................
 [
"virtuemart_vendor_id"]=> string(1"1" ["custom_jplugin_id"]=> string(1"0" ["custom_element"]=> string(1"0" ["admin_only"]=> string(1"0" 
 
["custom_title"]=> string(41"Глубина внутренняя, мм" ["show_title"]=> string(1"1" ["custom_tip"]=> string(0"" ["custom_value"]=> string(0"" 
 
["custom_desc"]=> string(0"" ["field_type"]=> string(1"S" ["is_list"]=> string(1"0" ["is_hidden"]=> string(1"0" ["is_cart_attribute"]=> string(1"0" 
 
["is_input"]=> string(1"0" ["layout_pos"]=> string(0"" ["custom_params"]=> string(41"addEmpty=0|selectType=0|multiplyPrice=""|" ["shared"]=> string(1"0" 
 
["published"]=> string(1"1" ["ordering"]=> string(5"15000" ["virtuemart_customfield_id"]=> string(5"13190" ["virtuemart_product_id"]=> string(4"1185" 
 
["customfield_value"]=> string(3"540" ["customfield_price"]=> string(8"0.000000" ["customfield_params"]=> string(0"" ["fpublished"]=> string(1"0" 
 
["override"]=> string(1"0" ["disabler"]=> string(1"0" ["_varsToPushParam"]=> array(3) { ["addEmpty"]=> array(2) { [0]=> int(0) [1]=> string(3"int" 
 [
"selectType"]=> array(2) { [0]=> int(0) [1]=> string(3"int" } ["multiplyPrice"]=> array(2) { [0]=> string(0"" [1]=> string(6"string" } } ["addEmpty"]=> int(0
 [
"selectType"]=> int(0) ["multiplyPrice"]=> string(0"" ["_xParams"]=> string(18"customfield_params" } [11]=> object(stdClass)#1440 (34) { 
 
["virtuemart_custom_id"]=> string(2"19" ["custom_parent_id"]=> string(1"0" ["virtuemart_vendor_id"]=> string(1"1" ["custom_jplugin_id"]=> string(1"0" 
 
["custom_element"]=> string(1"0" ["admin_only"]=> string(1"0" ["custom_title"]=> string(24"ПроизвоSPAMство" ["show_title"]=> string(1"1" 
 
["custom_tip"]=> string(0"" ["custom_value"]=> string(0"" ["custom_desc"]=> string(0"" ["field_type"]=> string(1"S" ["is_list"]=> string(1"0" ["is_hidden"]=> string(1"0" 
 
["is_cart_attribute"]=> string(1"0" ["is_input"]=> string(1"0" ["layout_pos"]=> string(0"" ["custom_params"]=> string(41"addEmpty=0|selectType=0|multiplyPrice=""|" ["shared"]=> 
 
string(1"0" ["published"]=> string(1"1" ["ordering"]=> string(5"19000" ["virtuemart_customfield_id"]=> string(5"27462" ["virtuemart_product_id"]=> string(4"1185" 
 
["customfield_value"]=> string(12"Швеция" ["customfield_price"]=> string(8"0.000000" ["customfield_params"]=> NULL ["fpublished"]=> string(1"1" ["override"]=> string(1"0" 
 
["disabler"]=> string(1"0" ["_varsToPushParam"]=> array(3) { ["addEmpty"]=> array(2) { [0]=> int(0) [1]=> string(3"int" } ["selectType"]=> array(2) { [0]=> int(0
 [
1]=> string(3"int" } ["multiplyPrice"]=> array(2) { [0]=> string(0"" [1]=> string(6"string" } } ["addEmpty"]=> int(0) ["selectType"]=> int(0) ["multiplyPrice"]=> string(0"" 
 
["_xParams"]=> string(18"customfield_params" } } ["product_tax_id"]=> string(1"0" ["amount"]=> int(1) ["quantity"]=> int(1) ["prices"]=> array(43) { 
 [
"virtuemart_product_price_id"]=> float(1185) ["virtuemart_product_id"]=> float(1185) ["virtuemart_shoppergroup_id"]=> string(1"0" ["product_price"]=> float(3993000
 [
"override"]=> string(1"0" ["product_override_price"]=> float(0) ["product_tax_id"]=> string(1"0" ["product_discount_id"]=> string(1"0" ["product_currency"]=> float(131
 [
"product_price_publish_up"]=> string(19"0000-00-00 00:00:00" ["product_price_publish_down"]=> string(19"0000-00-00 00:00:00" ["price_quantity_start"]=> string(1"0" 
 
["price_quantity_end"]=> string(1"0" ["created_on"]=> string(19"2018-07-03 08:16:26" ["created_by"]=> float(208) ["modified_on"]=> string(19"2018-07-03 08:17:18" 
 
["modified_by"]=> float(208) ["locked_on"]=> string(19"0000-00-00 00:00:00" ["locked_by"]=> string(1"0" ["costPrice"]=> float(3993000) ["basePrice"]=> float(3993000
 [
"basePriceVariant"]=> float(3993000) ["basePriceWithTax"]=> float(0) ["discountedPriceWithoutTax"]=> float(3993000) ["priceBeforeTax"]=> float(3993000) ["salesPrice"]=> float(3993000
 [
"taxAmount"]=> float(0) ["salesPriceWithDiscount"]=> float(0) ["salesPriceTemp"]=> float(3993000) ["unitPrice"]=> float(0) ["discountAmount"]=> float(-0) ["priceWithoutTax"]=> 
 
float(3993000) ["variantModification"]=> float(0) ["DBTax"]=> array(0) { } ["Tax"]=> array(0) { } ["VatTax"]=> array(0) { } ["DATax"]=> array(0) { } ["Marge"]=> array(0) { } 
 [
"salesPriceTt"]=> float(3993000) ["discountedPriceWithoutTaxTt"]=> float(3993000) ["priceWithoutTaxTt"]=> float(3993000) ["discountAmountTt"]=> float(-0) ["taxAmountTt"]=> float(0) }
 [
"canonical"]=> string(104"index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=1185&virtuemart_category_id=29" ["link"]=> string(104)
 
"index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=1185&virtuemart_category_id=29" ["addToCartButton"]=> bool(false
 
 [
b]["images"]=> array(1) { [0]=>[/bobject(VmImage)#1510 (34) { ["media_attributes"]=> int(0) ["setRole"]=> bool(false) 

["file_name"]=> string(16"robur-6-1800-3-1" ["file_extension"]=> string(3"jpg" ["virtuemart_media_id"]=> string(4"1455" ["_foldersToTest":"VmMediaHandler":private]=> array(2) { 
[
0]=> string(63".../public_html/images/product/" [1]=> string(71".../public_html/images/product/resized/" 
[
"_actions":"VmMediaHandler":private]=> array(0) { } ["_mLocation":"VmMediaHandler":private]=> array(0) { } ["_hidden":"VmMediaHandler":private]=> array(0) { } ["theme_url"]=> string(26
"components/com_virtuemart/" ["virtuemart_vendor_id"]=> string(1"1" 
["file_title"]=> string(20) [b]"robur-6-1800-3-1.jpg"[/b] ["file_description"]=> string(0"" ["file_meta"]=> string(0"" ["file_class"]=> string(0"" ["file_mimetype"]=> string(10
"image/jpeg" ["file_type"]=> string(7"product" 
[b]["file_url"]=> string(35"images/product/robur-6-1800-3-1.jpg"[/b] ["file_url_thumb"]=> string(0"" ["published"]=> string(1"1" ["file_is_downloadable"]=> string(1"0" 
["file_is_forSale"]=> string(1"0" ["file_is_product_image"]=> string(1"0" ["shared"]=> string(1"0" ["file_params"]=> string(0"" ["file_lang"]=> string(0"" 
["created_on"]=> string(19"2018-07-03 08:16:53" ["created_by"]=> string(3"208" ["modified_on"]=> string(19"2018-07-03 08:17:18" ["modified_by"]=> string(3"208" 
["file_url_folder"]=> string(15"images/product/" ["file_path_folder"]=> string(15"images/product/" ["file_url_folder_thumb"]=> string(23"images/product/resized/" 
["media_role"]=> string(19"file_is_displayable" } } ["file_url_thumb"]=> string(0"" 
["file_url"]=> string(35) [b]"images/product/robur-6-1800-3-1.jpg"[/b] } Сейф с высокой защитой от взлома и огня Robur 6-1800/3
Сейф с высокой защитой от взлома и огня Robur 6
-1800/3

Jörgen

This is no BUG !

Check out the productdetails view on how to extract the images.

regards

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

Studio 42

In product details view or category view or a modules ...?
Free XML sitemap generator [url="http://shop.st42.fr/en/catalog/products/virtuemart-2-sitemap.htm"]http://shop.st42.fr/en/catalog/products/virtuemart-2-sitemap.htm[/url]  , Free Unused Image cleaner [url="http://shop.st42.fr/en/products/virtuemart-media-folder-clear.htm"]http://shop.st42.fr/en/products/virtuemart-media-folder-clear.htm[/url]
Language Switch in product & category [url="http://shop.st42.fr/en/categories-tools/multi-language-for-virtuemart.htm"]http://shop.st42.fr/en/categories-tools/multi-language-for-virtuemart.htm[/url]
More extentions [url="http://shop.st42.fr/en/"]http://shop.st42.fr/en/[/url]

Jörgen

There is working code, just look in the vm template files. There you see how to get the images. The code works and is already written. And as Patrick sais, please more info, what view?
Regards
Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

Jörgen

I think it is time to calm down  8)

You send out code that You say don´t work, if it comes from the default VM template it does work I assure You. But it is neccesary to see the whole picture, all code depends on correct syntax and most of the code depend on declarations and functions beeing created and called in the right order. Yo can not expect that cut and paste code will work wherever You place it. Th VM code works in it´s context. If You change the context, You have to know what You are doing. It does not help to cry and say that the code is faultty, when You have broken the code Yourself.

Take a deep breath and explain what You are doing and where, exactly as You would someone explain it to You. Then maybe someone can donate some of his free time and help You. If not then maybe studio42 or someone else can help You, but probably not for free.

regards

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

Studio 42

@2dmaster
Plaese answer my question, so i can give you advise.
Free XML sitemap generator [url="http://shop.st42.fr/en/catalog/products/virtuemart-2-sitemap.htm"]http://shop.st42.fr/en/catalog/products/virtuemart-2-sitemap.htm[/url]  , Free Unused Image cleaner [url="http://shop.st42.fr/en/products/virtuemart-media-folder-clear.htm"]http://shop.st42.fr/en/products/virtuemart-media-folder-clear.htm[/url]
Language Switch in product & category [url="http://shop.st42.fr/en/categories-tools/multi-language-for-virtuemart.htm"]http://shop.st42.fr/en/categories-tools/multi-language-for-virtuemart.htm[/url]
More extentions [url="http://shop.st42.fr/en/"]http://shop.st42.fr/en/[/url]

Studio 42

Check your config file
/administrator/components/com_virtuemart/virtuemart.cfg
and add a line
prodimg_browse=2
You have to edit the config and save it, so this setting is applied
Free XML sitemap generator [url="http://shop.st42.fr/en/catalog/products/virtuemart-2-sitemap.htm"]http://shop.st42.fr/en/catalog/products/virtuemart-2-sitemap.htm[/url]  , Free Unused Image cleaner [url="http://shop.st42.fr/en/products/virtuemart-media-folder-clear.htm"]http://shop.st42.fr/en/products/virtuemart-media-folder-clear.htm[/url]
Language Switch in product & category [url="http://shop.st42.fr/en/categories-tools/multi-language-for-virtuemart.htm"]http://shop.st42.fr/en/categories-tools/multi-language-for-virtuemart.htm[/url]
More extentions [url="http://shop.st42.fr/en/"]http://shop.st42.fr/en/[/url]

Studio 42

I only have checked the file view.html
$imgAmount = VmConfig::get('prodimg_browse',1);

And after i see multiple time
$productModel->addImages($this->products['products'], $imgAmount );
...
$productModel->addImages( $this->products[$o], $imgAmount );

So try
echo 'image amount '.VmConfig::get('prodimg_browse',1); if your have now 2 and not 1
Free XML sitemap generator [url="http://shop.st42.fr/en/catalog/products/virtuemart-2-sitemap.htm"]http://shop.st42.fr/en/catalog/products/virtuemart-2-sitemap.htm[/url]  , Free Unused Image cleaner [url="http://shop.st42.fr/en/products/virtuemart-media-folder-clear.htm"]http://shop.st42.fr/en/products/virtuemart-media-folder-clear.htm[/url]
Language Switch in product & category [url="http://shop.st42.fr/en/categories-tools/multi-language-for-virtuemart.htm"]http://shop.st42.fr/en/categories-tools/multi-language-for-virtuemart.htm[/url]
More extentions [url="http://shop.st42.fr/en/"]http://shop.st42.fr/en/[/url]

Studio 42

Echo what i said, you dont have to modify the file itself.
But you should see the value 2 displayed, if not then your config was not update.
Free XML sitemap generator [url="http://shop.st42.fr/en/catalog/products/virtuemart-2-sitemap.htm"]http://shop.st42.fr/en/catalog/products/virtuemart-2-sitemap.htm[/url]  , Free Unused Image cleaner [url="http://shop.st42.fr/en/products/virtuemart-media-folder-clear.htm"]http://shop.st42.fr/en/products/virtuemart-media-folder-clear.htm[/url]
Language Switch in product & category [url="http://shop.st42.fr/en/categories-tools/multi-language-for-virtuemart.htm"]http://shop.st42.fr/en/categories-tools/multi-language-for-virtuemart.htm[/url]
More extentions [url="http://shop.st42.fr/en/"]http://shop.st42.fr/en/[/url]

Studio 42

Sorry, i cannot help you, i don't understand your mixed questions with no details.
Free XML sitemap generator [url="http://shop.st42.fr/en/catalog/products/virtuemart-2-sitemap.htm"]http://shop.st42.fr/en/catalog/products/virtuemart-2-sitemap.htm[/url]  , Free Unused Image cleaner [url="http://shop.st42.fr/en/products/virtuemart-media-folder-clear.htm"]http://shop.st42.fr/en/products/virtuemart-media-folder-clear.htm[/url]
Language Switch in product & category [url="http://shop.st42.fr/en/categories-tools/multi-language-for-virtuemart.htm"]http://shop.st42.fr/en/categories-tools/multi-language-for-virtuemart.htm[/url]
More extentions [url="http://shop.st42.fr/en/"]http://shop.st42.fr/en/[/url]

Studio 42

you want 3 level category display ?
so category+child category + child of child category ?
Free XML sitemap generator [url="http://shop.st42.fr/en/catalog/products/virtuemart-2-sitemap.htm"]http://shop.st42.fr/en/catalog/products/virtuemart-2-sitemap.htm[/url]  , Free Unused Image cleaner [url="http://shop.st42.fr/en/products/virtuemart-media-folder-clear.htm"]http://shop.st42.fr/en/products/virtuemart-media-folder-clear.htm[/url]
Language Switch in product & category [url="http://shop.st42.fr/en/categories-tools/multi-language-for-virtuemart.htm"]http://shop.st42.fr/en/categories-tools/multi-language-for-virtuemart.htm[/url]
More extentions [url="http://shop.st42.fr/en/"]http://shop.st42.fr/en/[/url]

Studio 42

Please provide a link to your website, so we understand better the problem
Free XML sitemap generator [url="http://shop.st42.fr/en/catalog/products/virtuemart-2-sitemap.htm"]http://shop.st42.fr/en/catalog/products/virtuemart-2-sitemap.htm[/url]  , Free Unused Image cleaner [url="http://shop.st42.fr/en/products/virtuemart-media-folder-clear.htm"]http://shop.st42.fr/en/products/virtuemart-media-folder-clear.htm[/url]
Language Switch in product & category [url="http://shop.st42.fr/en/categories-tools/multi-language-for-virtuemart.htm"]http://shop.st42.fr/en/categories-tools/multi-language-for-virtuemart.htm[/url]
More extentions [url="http://shop.st42.fr/en/"]http://shop.st42.fr/en/[/url]

Studio 42

Your link is broken.
But perhaps you have set in the menu item to not render the subcategories ?
You can hide the subcategories in the parent category too.
So verify your settings, before trying to modify the code.
Free XML sitemap generator [url="http://shop.st42.fr/en/catalog/products/virtuemart-2-sitemap.htm"]http://shop.st42.fr/en/catalog/products/virtuemart-2-sitemap.htm[/url]  , Free Unused Image cleaner [url="http://shop.st42.fr/en/products/virtuemart-media-folder-clear.htm"]http://shop.st42.fr/en/products/virtuemart-media-folder-clear.htm[/url]
Language Switch in product & category [url="http://shop.st42.fr/en/categories-tools/multi-language-for-virtuemart.htm"]http://shop.st42.fr/en/categories-tools/multi-language-for-virtuemart.htm[/url]
More extentions [url="http://shop.st42.fr/en/"]http://shop.st42.fr/en/[/url]