Author Topic: BUG missing images  (Read 502 times)

2dmaster

  • Jr. Member
  • **
  • Posts: 105
BUG missing images
« on: July 10, 2018, 13:23:14 pm »
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

Code: [Select]
<?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"Производство" ["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

  • Global Moderator
  • Full Member
  • *
  • Posts: 1539
    • Kreativ Fotografi
  • VirtueMart Version: 3.2.12
Re: BUG missing images
« Reply #1 on: July 10, 2018, 14:56:53 pm »
This is no BUG !

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

regards

Jörgen @ Kreativ Fotografi
Joomla 3.8.3
Virtuemart 3.2.12
Olympiantheme Hera (customized)

2dmaster

  • Jr. Member
  • **
  • Posts: 105
Re: BUG missing images
« Reply #2 on: July 10, 2018, 15:09:56 pm »
this bug i cant get second image, because echo count($product->images); gets one image... pls helpp

2dmaster

  • Jr. Member
  • **
  • Posts: 105
Re: BUG missing images
« Reply #3 on: July 10, 2018, 15:20:51 pm »
$product->images  this one variable not working any solutions please

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3152
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 &amp; 3.0.x.y
Re: BUG missing images
« Reply #4 on: July 10, 2018, 15:33:54 pm »
In product details view or category view or a modules ...?

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 1539
    • Kreativ Fotografi
  • VirtueMart Version: 3.2.12
Re: BUG missing images
« Reply #5 on: July 10, 2018, 15:42:00 pm »
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.8.3
Virtuemart 3.2.12
Olympiantheme Hera (customized)

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 1539
    • Kreativ Fotografi
  • VirtueMart Version: 3.2.12
Re: BUG missing images
« Reply #6 on: July 10, 2018, 19:11:05 pm »
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.8.3
Virtuemart 3.2.12
Olympiantheme Hera (customized)

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3152
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 &amp; 3.0.x.y
Re: BUG missing images
« Reply #7 on: July 10, 2018, 19:27:28 pm »
@2dmaster
Plaese answer my question, so i can give you advise.

2dmaster

  • Jr. Member
  • **
  • Posts: 105
Re: BUG missing images
« Reply #8 on: July 10, 2018, 20:45:55 pm »
post 3
i cant echo foreach children subcategories in my categories pls help maybe
post 4
$product->customfields   // work in category
$product->customfieldsSorted[normal]  // work in cf filter

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3152
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 &amp; 3.0.x.y
Re: BUG missing images
« Reply #9 on: July 10, 2018, 21:48:56 pm »
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

2dmaster

  • Jr. Member
  • **
  • Posts: 105
Re: BUG missing images
« Reply #10 on: July 10, 2018, 22:04:57 pm »
##Shopfront
prodimg_browse=2

not work, any solutions?

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3152
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 &amp; 3.0.x.y
Re: BUG missing images
« Reply #11 on: July 10, 2018, 22:20:10 pm »
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
Code: [Select]
echo 'image amount '.VmConfig::get('prodimg_browse',1); if your have now 2 and not 1

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3152
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 &amp; 3.0.x.y
Re: BUG missing images
« Reply #12 on: July 10, 2018, 22:59:10 pm »
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.

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3152
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 &amp; 3.0.x.y
Re: BUG missing images
« Reply #13 on: July 11, 2018, 12:12:26 pm »
Sorry, i cannot help you, i don't understand your mixed questions with no details.

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3152
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 &amp; 3.0.x.y
Re: BUG missing images
« Reply #14 on: July 11, 2018, 23:54:50 pm »
you want 3 level category display ?
so category+child category + child of child category ?