Welcome, Guest. Please login or register.
Login with username, password and session length


VirtueMart 1.1.8 - [SECURITY RELEASE] is available! Read more....

  Advanced search

247038 Posts in 67506 Topics- by 258314 Members - Latest Member: aniketana
Pages: 1 ... 8 9 [10] 11 12 13   Go Down
Print
Author Topic: 2 Product Thumbnail image sizes Mod [finished]  (Read 134735 times)
Joseph Kwan
Advanced
Hero Member
*****
Posts: 2115


« Reply #135 on: July 29, 2007, 18:28:55 PM »

Put the above link in any place of the template you want the thumbnail appear, eg.

<img src="/components/com_virtuemart/show_image_in_imgtag.php?filename={product_full_image}&newxsize=200&newysize=200" />
Logged

Pay service to make VM work according to your needs. Your Joomla/VM solutions are just a PM away
Joseph Kwan

VM Themes and Templates explained in detail

Projects contributed:
  Excel Product Upload
  Two Product Thumbs
  Bulk Update of Order Status
and many more.
Kasper Gadensgaard
Newbie
*
Posts: 21


« Reply #136 on: August 04, 2007, 02:28:50 AM »

This gives me only a red X, and no photo:

http://maxfashion.dk/shop/index.php?page=shop.product_details&category_id=11&flypage=shop.flypage&product_id=17&option=com_virtuemart&Itemid=26
Logged
Joseph Kwan
Advanced
Hero Member
*****
Posts: 2115


« Reply #137 on: August 04, 2007, 11:08:14 AM »

{product_full_image} applies only in browse template. For flypage template, please use {full_image}.
Logged

Pay service to make VM work according to your needs. Your Joomla/VM solutions are just a PM away
Joseph Kwan

VM Themes and Templates explained in detail

Projects contributed:
  Excel Product Upload
  Two Product Thumbs
  Bulk Update of Order Status
and many more.
Kasper Gadensgaard
Newbie
*
Posts: 21


« Reply #138 on: August 06, 2007, 04:35:41 AM »

still just red X Sad. but now the imagename is correct i think
Logged
Joseph Kwan
Advanced
Hero Member
*****
Posts: 2115


« Reply #139 on: August 06, 2007, 10:13:08 AM »

Since your Joomla root is under a subfolder, the img tag should be like this

<img src="/shop/components/com_virtuemart/show_image_in_imgtag.php?filename={product_full_image}&newxsize=100&newysize=100" />
Logged

Pay service to make VM work according to your needs. Your Joomla/VM solutions are just a PM away
Joseph Kwan

VM Themes and Templates explained in detail

Projects contributed:
  Excel Product Upload
  Two Product Thumbs
  Bulk Update of Order Status
and many more.
Kasper Gadensgaard
Newbie
*
Posts: 21


« Reply #140 on: August 06, 2007, 15:13:44 PM »

Oh ofc Cheesy.. sry for that trouble and thanks for ypur help
Logged
Kasper Gadensgaard
Newbie
*
Posts: 21


« Reply #141 on: August 11, 2007, 04:42:47 AM »

Sry for being trouble again, but the second thumbnail i get is the same one as the original one? and it has no link to the larger image. i have added one extra image to the product, is there no way to display this one as a thumbnail just like the original one?

Gadensgaard
Logged
Joseph Kwan
Advanced
Hero Member
*****
Posts: 2115


« Reply #142 on: August 11, 2007, 19:06:54 PM »

If you want 2 different sizes, you have to change the newxsize and newysize. Also to open the large image, you have to provide a similar link as your first image. Refer to the flypage for a sample.
Logged

Pay service to make VM work according to your needs. Your Joomla/VM solutions are just a PM away
Joseph Kwan

VM Themes and Templates explained in detail

Projects contributed:
  Excel Product Upload
  Two Product Thumbs
  Bulk Update of Order Status
and many more.
merete
Newbie
*
Posts: 17


« Reply #143 on: August 20, 2007, 14:15:53 PM »

Hi Joseph,

Thanks for all your work, it works great on the site I'm doing.

I do have a couple of questions: I want to use this second thumbnail in 'related products' and in the basket. For the basket I'm using xfactor shopping cart mod. How and where do I call the second thumbnail?

Hope you or someone else can help. Thanks!
Merete
« Last Edit: August 21, 2007, 08:48:17 AM by merete » Logged
merete
Newbie
*
Posts: 17


« Reply #144 on: August 21, 2007, 09:34:37 AM »

Ok, so in case anybody wants to know -  I figured out how and where to change the thumbnails in the basket: basket.php (product_thumb_image to product_thumb_image_2)

I'm still searching for where to change the related products, in what file?? Anyone?

Thanks, Merete
Logged
Joseph Kwan
Advanced
Hero Member
*****
Posts: 2115


« Reply #145 on: August 21, 2007, 11:38:20 AM »

You can find the related product codes at around line 100 of shop.product_details.php. It makes use of the function ps_product->product_snapshot() which is shared between several modules. If you want all snapshots to use thumb_image_2, go ahead to change that in product_snapshot(). Otherwise, you can customize the code in shop.product_details.php or add a parameter to the function so that you can change the thumb image size.
Logged

Pay service to make VM work according to your needs. Your Joomla/VM solutions are just a PM away
Joseph Kwan

VM Themes and Templates explained in detail

Projects contributed:
  Excel Product Upload
  Two Product Thumbs
  Bulk Update of Order Status
and many more.
merete
Newbie
*
Posts: 17


« Reply #146 on: August 21, 2007, 12:52:35 PM »

Thank you, I found it, but I get this error:

Fatal error: Call to undefined method ps_product::product_thumb_image_2() in

This is my code:
 $related_product_html = "";
  if( $db->num_rows() > 0 ) {
        $related_product_html .= "<h3>".$VM_LANG->_PHPSHOP_RELATED_PRODUCTS_HEADING.":</h3>\n";
    $related_product_html .= "<table width=\"100%\" align=\"center\"><tr>\n";
    while( $db->next_record() ) {
      $related_product_html .= "<td valign=\"top\">".$ps_product->product_thumb_image_2( $db->f('product_sku') )."</td>\n";
   }
    $related_product_html .= "</tr></table>\n";
  }
Logged
Joseph Kwan
Advanced
Hero Member
*****
Posts: 2115


« Reply #147 on: August 21, 2007, 13:15:01 PM »

You can't call the method $ps_product->product_thumb_image_2 unless it is defined in your class. My suggestion is add an additional parameter to the snapshot function like this:

function product_snapshot( $product_sku, $show_price=true, $show_addtocart=true, $use_thumb_2 = false )

And then change this line

$q = "SELECT product_id, product_name, product_parent_id, product_thumb_image FROM #__{vm}_product WHERE product_sku='$product_sku'";

to

if ($use_thumb_2) {
$q = "SELECT product_id, product_name, product_parent_id, product_thumb_image_2 AS product_thumb_image FROM #__{vm}_product WHERE product_sku='$product_sku'";
} else {
$q = "SELECT product_id, product_name, product_parent_id, product_thumb_image FROM #__{vm}_product WHERE product_sku='$product_sku'";
}
Logged

Pay service to make VM work according to your needs. Your Joomla/VM solutions are just a PM away
Joseph Kwan

VM Themes and Templates explained in detail

Projects contributed:
  Excel Product Upload
  Two Product Thumbs
  Bulk Update of Order Status
and many more.
merete
Newbie
*
Posts: 17


« Reply #148 on: August 21, 2007, 14:04:02 PM »

Thanks for replying so fast.
It works - only with a 'true' instead of a 'false'. The littel I know of programming helped me figure that one. 
Now all I have to do is find a way to loose this frame around the images.

Thanks for your time!
Merete
Logged
anlemoca
Newbie
*
Posts: 1


« Reply #149 on: October 23, 2007, 18:49:49 PM »

Hey Joseph Kwan, is this mod going to be in VM 1.0.13 or 1.0.13a, I have VM 1.0.12 I want to upgrade to 1.0.13a but i want your mod too
What is the best way to upgrade?
Thanks in advance
Andres
« Last Edit: October 23, 2007, 18:52:02 PM by anlemoca » Logged
Pages: 1 ... 8 9 [10] 11 12 13   Go Up
Print
Jump to: