Jump to content

jpmad4it

Members
  • Content count

    73
  • Joined

  • Last visited

Everything posted by jpmad4it

  1. Hi there, I am trying to combine the Additional Images contribution (here) and the Lightbox contribution (here) You can see an example of part of my shop below which is relevant to this post: Bellusci What I want to do is use the lightbox contribution to display the large image when the user clicks on the top image on that page. I will worry about the other images at a later point. Lets just get the top one working for now! Has anyone achieved this or know how to do it? I have modified some code, and I manage to get the lightbox to activate, but the loading graphic just appears and no large image ever loads.....i.e. it looks like my code is not correct as the large image is not being referenced properly. Here is my unmodified code for the additional images contribution on the product.info.php page: // BOF: Additional Images if (ADDIMAGES_MENU_LOCATION == 'product_info') { if (ADDIMAGES_POPUP_TABLE_LOCATION=='above' && ADDIMAGES_POPUP_SHOW_ON_POPUP=='true' && ($imagemenu->addimages_count > 1)) { echo '<table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td valign="middle" align="center" class="pageHeading">' . TEXT_MENU_TITLE . '</td></tr><tr><td valign="middle" align="center">' . $imagemenu->altgroupoutput() . '</td></tr></table>'; } echo '<table border="0" cellspacing="0" cellpadding="0"><tr>'; if (ADDIMAGES_POPUP_TABLE_LOCATION=='sides' && (ADDIMAGES_POPUP_TABLE_ALIGNMENT=='left' || ADDIMAGES_POPUP_TABLE_ALIGNMENT=='center') && ADDIMAGES_POPUP_SHOW_ON_POPUP=='true' && ($imagemenu->addimages_count > 1)) { echo '<td valign="middle" align="center" class="pageHeading">' . TEXT_MENU_TITLE . '<br>' . $imagemenu->groupoutput() . '</td>'; } echo '<td valign="middle" align="center" width="100%">'; if (!empty($_GET['imagesID'])) { echo tep_image(DIR_WS_IMAGES . (!empty($selected_image['popup_images'])?$selected_image['popup_images']:(!empty($selected_image['medium_images'])?$selected_image['medium_images']:(!empty($selected_image['thumb_images'])?$selected_image['thumb_images']:''))), $selected_image['images_description'], (ADDIMAGES_POPUP_RESTRICT_IMAGE_SIZE=='true'?POPUP_IMAGE_WIDTH:''), (ADDIMAGES_POPUP_RESTRICT_IMAGE_SIZE=='true'?POPUP_IMAGE_HEIGHT:''), 'id="mainimage"') . (!empty($selected_image['images_description'])?$selected_image['images_description']:''); } elseif (!empty($_GET['pID'])) { echo tep_image(DIR_WS_IMAGES . (!empty($selected_image['products_image_pop'])?$selected_image['products_image_pop']:(!empty($selected_image['products_image_med'])?$selected_image['products_image_med']:(!empty($selected_image['products_image'])?$selected_image['products_image']:''))), $selected_image['products_image_description'], (ADDIMAGES_POPUP_RESTRICT_IMAGE_SIZE=='true'?POPUP_IMAGE_WIDTH:''), (ADDIMAGES_POPUP_RESTRICT_IMAGE_SIZE=='true'?POPUP_IMAGE_HEIGHT:''), 'id="mainimage"') . (!empty($selected_image['products_image_description'])?$selected_image['products_image_description']:''); } echo '</td>'; if (ADDIMAGES_POPUP_TABLE_LOCATION=='sides' && ADDIMAGES_POPUP_TABLE_ALIGNMENT=='right' && ADDIMAGES_POPUP_SHOW_ON_POPUP=='true' && ($imagemenu->addimages_count > 1)) { echo '<td valign="middle" align="center" class="pageHeading">' . TEXT_MENU_TITLE . '<br>' . $imagemenu->groupoutput() . '</td>'; } if (!empty($imagemenu->maximagewidth) && !empty($imagemenu->maximageheight)) { echo '<td>' . tep_draw_separator('pixel_trans.gif', '4', $imagemenu->maximageheight) . '</td>'; } echo '</tr></table>'; if (ADDIMAGES_POPUP_TABLE_LOCATION=='below' && ADDIMAGES_POPUP_SHOW_ON_POPUP=='true' && ($imagemenu->addimages_count > 1)) { echo '<table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td valign="middle" align="center" class="pageHeading">' . TEXT_MENU_TITLE . '</td></tr><tr><td valign="middle" align="center">' . $imagemenu->altgroupoutput() . '</td></tr></table>'; } } else { ?> <script language="javascript"><!-- document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_ADD_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . (!empty($product_info['products_image_med'])?$product_info['products_image_med']:(!empty($product_info['products_image_pop'])?$product_info['products_image_pop']:(!empty($product_info['products_image'])?$product_info['products_image']:''))), addslashes($product_info['products_name']), (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_WIDTH:''), (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_HEIGHT:''), 'hspace="5" vspace="5"') . '<br>' . (!empty($product_info['products_image_description'])?$product_info['products_image_description']:TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>'); //--></script> <noscript> <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . (!empty($product_info['products_image_pop'])?$product_info['products_image_pop']:$product_info['products_image'])) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . (!empty($product_info['products_image_med'])?$product_info['products_image_med']:(!empty($product_info['products_image_pop'])?$product_info['products_image_pop']:(!empty($product_info['products_image'])?$product_info['products_image']:''))), $product_info['products_name'], (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_WIDTH:''), (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_HEIGHT:''), 'hspace="5" vspace="5"') . '<br>' . (!empty($product_info['products_image_description'])?$product_info['products_image_description']:TEXT_CLICK_TO_ENLARGE) . '</a>'; ?> </noscript> <?php } // EOF: Additional Images ?> Here is the code for product.info that comes with the lightbox contribution: <script language="javascript"><!-- document.write('<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank" rel="lightbox" title="'.$product_info['products_name'].'" >' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>'); //--></script> <noscript> <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank" rel="lightbox" title="'.$product_info['products_name'].'" >' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>'); </noscript> As you can see there are similarities in the <script> and <noscript> parts of both sets of the code, which is what I have been trying to work on. The only difference is that the additional images contribution uses a javascript pop-up window at the moment to display the large images (which is what I want to replace using the lightbox). Has anyone got any ideas? Do you need to see my additional images modified code so far? Any help would be greatly appreciated. kind regards Jonathan
  2. Ok, I managed to get the first image to display, but I am having a nightmare trying to get the additional images to display. The file that controls the building and displaying of the additional images is includes/classes/displayimages.php The full code for this file is here: <?php /* Designed for: osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2006 Todd Holforty - mtholforty@surfalot.com Released under the GNU General Public License This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** *** displayimages class *** *** *** *** *** *** *** */ class displayimages { var $restrictsmimage = ADDIMAGES_RESTRICT_IMAGE_SIZE; // true, false var $tablealignment = ADDIMAGES_TABLE_ALIGNMENT; // right, center, left var $numberofcolumns = 1; var $numberofrows =100; var $groupwithparent = ADDIMAGES_GROUP_WITH_PARENT; var $imagedefault = 'medium'; var $buildmenu = false; var $onpagemenu = false; var $linkurl = FILENAME_POPUP_ADD_IMAGE; var $addimages_count = 0; var $groupout = ''; var $maximagewidth = 0; var $maximageheight = 0; /** ** constructor **/ function displayimages ( $products_id ) { $this->imagedir = DIR_FS_CATALOG . DIR_WS_IMAGES; $product_query = tep_db_query("SELECT products_id, products_image, products_image_med, products_image_pop, products_image_description FROM " . TABLE_PRODUCTS . " WHERE products_id = '".(int)$products_id."'"); $product = tep_db_fetch_array($product_query); tep_db_free_result($product_query); $images = array(); $images_query = tep_db_query("select additional_images_id, images_description, thumb_images, medium_images, popup_images from " . TABLE_ADDITIONAL_IMAGES . " where products_id = '" . (int)$products_id . "'"); while ($tmp_images = tep_db_fetch_array($images_query)) { $images[] = $tmp_images; } tep_db_free_result($images_query); // find the largest image width and height if (!empty($product['products_image_pop']) || !empty($product['products_image'])) { list($this->maximagewidth, $this->maximageheight, $type) = @getimagesize($this->imagedir.(!empty($product['products_image_pop'])?$product['products_image_pop']:$product['products_image'])); } foreach ($images as $key => $image) { if (!empty($image['popup_images']) || !empty($image['thumb_images'])) { list($t_maximagewidth, $t_maximageheight, $type) = @getimagesize($this->imagedir.(!empty($image['popup_images'])?$image['popup_images']:$image['thumb_images'])); } if ($t_maximagewidth > $this->maximagewidth) { $this->maximagewidth = $t_maximagewidth; } if ($t_maximageheight > $this->maximageheight) { $this->maximageheight = $t_maximageheight; } } // determine image width to use $addimages_image_width = ($this->restrictsmimage=='true'?(($this->imagedefault=='medium')?DISPLAY_IMAGE_WIDTH:SMALL_IMAGE_WIDTH):''); $addimages_image_height = ($this->restrictsmimage=='true'?(($this->imagedefault=='medium')?DISPLAY_IMAGE_HEIGHT:SMALL_IMAGE_HEIGHT):''); $row = 1; $col = 1; // build composite array of products. $addimages_images = array(); if (tep_not_null($product['products_image']) && $this->groupwithparent == 'true') { if (tep_not_null($product['products_image_med']) && ($this->imagedefault == 'medium')) { $use_image = $product['products_image_med']; } elseif (tep_not_null($product['products_image']) && ($this->imagedefault == 'medium' || $this->imagedefault == 'small')) { $use_image = $product['products_image']; } $t_imagewidth = 0; $t_imageheight = 0; if (!empty($use_image)) { list($t_imagewidth, $t_imageheight, $type) = @getimagesize($this->imagedir.$use_image); } $t_popimagewidth = 0; $t_popimageheight = 0; if (!empty($product['products_image_pop'])) { list($t_popimagewidth, $t_popimageheight, $type) = @getimagesize($this->imagedir.$product['products_image_pop']); } $addimages_images[] = array('id' => '', 'image' => $use_image, 'image_width' => $t_imagewidth, 'image_height' => $t_imageheight, 'popimage' => $product['products_image_pop'], 'popimage_width' => $t_popimagewidth, 'popimage_height' => $t_popimageheight, 'desc' => $product['products_image_description']); } foreach ( $images as $key => $image ) { if (tep_not_null($image['medium_images']) && ($this->imagedefault == 'medium')) { $use_image = $image['medium_images']; } elseif (tep_not_null($image['thumb_images']) && ($this->imagedefault == 'medium' || $this->imagedefault == 'small')) { $use_image = $image['thumb_images']; } $t_imagewidth = 0; $t_imageheight = 0; if (!empty($use_image)) { list($t_imagewidth, $t_imageheight, $type) = @getimagesize($this->imagedir.$use_image); } $t_popimagewidth = 0; $t_popimageheight = 0; if (!empty($image['popup_images'])) { list($t_popimagewidth, $t_popimageheight, $type) = @getimagesize($this->imagedir.$image['popup_images']); } $addimages_images[] = array('id' => $image['additional_images_id'], 'image' => $use_image, 'image_width' => $t_imagewidth, 'image_height' => $t_imageheight, 'popimage' => $image['popup_images'], 'popimage_width' => $t_popimagewidth, 'popimage_height' => $t_popimageheight, 'desc' => $image['images_description']); } $this->addimages_count = sizeof($addimages_images); // start building output if (tep_not_null($product['products_image'])) { $this->groupout .= '<table border="0" cellspacing="0" cellpadding="4" align="'.$this->tablealignment.'">'."\n"; } for ( $item=0; $item<$this->addimages_count; $item++ ) { if ($row<($this->numberofrows+1)) { if ($col==1) {$this->groupout.='<tr>';} $t_menu_mouseover = (($this->buildmenu==true) ? ' onmouseover="showImage('.(!empty($addimages_images[$item]['popimage']) ? '\\\''.DIR_WS_IMAGES.$addimages_images[$item]['popimage'].'\\\', '.$addimages_images[$item]['popimage_width'].', '.$addimages_images[$item]['popimage_height'] : '\\\''.DIR_WS_IMAGES.$addimages_images[$item]['image'].'\\\', '.$addimages_images[$item]['image_width'].', '.$addimages_images[$item]['image_height']) . ')"' : '' ); $this->groupout .= ' <td align="center" class="pic"><script language="javascript"><!-- document.write(\'<a href="' . (!$this->onpagemenu ? 'java script:popupWindow(\\\'' : '') . tep_href_link( $this->linkurl, ($item==0&&$this->groupwithparent=='true'?'pID='.$products_id:'imagesID='.$addimages_images[$item]['id'])) . (!empty($_GET['products_id']) ? '&products_id='.$_GET['products_id'] : '') . (!empty($_GET['cPath']) ? '&cPath='.$_GET['cPath'] : '') . (!$this->onpagemenu ? '\\\')' : '') . '"' . $t_menu_mouseover . '>' . tep_image(DIR_WS_IMAGES . $addimages_images[$item]['image'], addslashes($addimages_images[$item]['desc']), (ADDIMAGES_RESTRICT_PARENT=='false'&&$item==0&&$this->groupwithparent=='true'?'':$addimages_image_width), (ADDIMAGES_RESTRICT_PARENT=='false'&&$item==0&&$this->groupwithparent=='true'?'':$addimages_image_height), 'hspace="5" vspace="5"') . '<br>' . (!empty($addimages_images[$item]['desc'])?$addimages_images[$item]['desc']:TEXT_CLICK_TO_ENLARGE) . '</a>\'); //--></script> <noscript> <a href="' . tep_href_link(DIR_WS_IMAGES . $addimages_images[$item]['popimage']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $addimages_images[$item]['image'], $addimages_images[$item]['desc'], $addimages_image_width, $addimages_image_height, 'hspace="5" vspace="5"') . '<br>' . (!empty($addimages_images[$item]['desc'])?$addimages_images[$item]['desc']:TEXT_CLICK_TO_ENLARGE) . '</a> </noscript></td>'."\n"; if ($col==$this->numberofcolumns) { $col=1; $row++; $this->groupout.='</tr>'."\n"; } else { $col++; } } } if ($col!=1 && $this->addimages_count > $this->numberofcolumns){ while (($col++)<($this->numberofcolumns+1)) { $this->groupout.='<td> </td>'."\n"; } } if (tep_not_null($product['products_image'])) { $this->groupout .= '</table>'."\n"; } } /** ** member functions **/ function groupoutput () { return $this->groupout; } function altgroupoutput () { $returnvar = ' <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="center" class="smallText">'.$this->groupout.'</td> </tr> </table>'."\n"; return $returnvar; } function boxsize () { // calculate box size $menuimagewidth = (($this->imagedefault=='medium')?DISPLAY_IMAGE_WIDTH:SMALL_IMAGE_WIDTH); $menuimageheight = (($this->imagedefault=='medium')?DISPLAY_IMAGE_HEIGHT:SMALL_IMAGE_HEIGHT); if (empty($menuimageheight)) { $menuimageheight = $menuimagewidth; } // if width was set to zero for proper proportion display. if (empty($menuimagewidth)) { $menuimagewidth = $menuimageheight; } // if height was set to zero for proper proportion display. $real_columns = (($this->addimages_count < $this->numberofcolumns) ? $this->addimages_count : $this->numberofcolumns); $real_rows = ceil($this->addimages_count / $this->numberofcolumns); $menu_width = ($real_columns * ($menuimagewidth + 10)); $menu_height = ($real_rows * ($menuimageheight + 10)); return array($menu_width, $menu_height); } } // end: class displayimages {} /** *** displaypopupimagemenu class *** *** *** *** *** *** *** */ class displaypopupimagemenu extends displayimages { /** ** constructor **/ function displaypopupimagemenu ( $products_id ) { $this->imagedir = DIR_FS_CATALOG . DIR_WS_IMAGES; $this->restrictsmimage = ADDIMAGES_POPUP_RESTRICT_IMAGE_SIZE; $this->tablealignment = ADDIMAGES_POPUP_TABLE_ALIGNMENT; $this->numberofcolumns = ADDIMAGES_POPUP_NUMBER_OF_COLS; $this->numberofrows = ADDIMAGES_POPUP_NUMBER_OF_ROWS; $this->groupwithparent = ADDIMAGES_POPUP_GROUP_WITH_PARENT; $this->imagedefault = 'small'; $this->buildmenu = true; $this->onpagemenu = false; $this->linkurl = FILENAME_POPUP_ADD_IMAGE; $this->displayimages ( $products_id ); } } // end: class displaypopupimagemenu {} /** *** displayonpageimagemenu class *** *** *** *** *** *** *** */ class displayonpageimagemenu extends displayimages { /** ** constructor **/ function displayonpageimagemenu ( $products_id ) { $this->imagedir = DIR_FS_CATALOG . DIR_WS_IMAGES; $this->restrictsmimage = ADDIMAGES_POPUP_RESTRICT_IMAGE_SIZE; $this->tablealignment = ADDIMAGES_POPUP_TABLE_ALIGNMENT; $this->numberofcolumns = ADDIMAGES_POPUP_NUMBER_OF_COLS; $this->numberofrows = ADDIMAGES_POPUP_NUMBER_OF_ROWS; $this->groupwithparent = ADDIMAGES_POPUP_GROUP_WITH_PARENT; $this->imagedefault = 'small'; $this->buildmenu = true; $this->onpagemenu = true; $this->linkurl = FILENAME_PRODUCT_INFO; $this->displayimages ( $products_id ); } } // end: class displayonpageimagemenu {} ?> Sorry for posting the whole code, but I thought that some of you may need to see how the code works. The part I am trying to modify is this code:# <script language="javascript"><!-- document.write(\'<a href="' . (!$this->onpagemenu ? 'java script:popupWindow(\\\'' : '') . tep_href_link( $this->linkurl, ($item==0&&$this->groupwithparent=='true'?'pID='.$products_id:'imagesID='.$addimages_images[$item]['id'])) . (!empty($_GET['products_id']) ? '&products_id='.$_GET['products_id'] : '') . (!empty($_GET['cPath']) ? '&cPath='.$_GET['cPath'] : '') . (!$this->onpagemenu ? '\\\')' : '') . '"' . $t_menu_mouseover . '>' . tep_image(DIR_WS_IMAGES . $addimages_images[$item]['image'], addslashes($addimages_images[$item]['desc']), (ADDIMAGES_RESTRICT_PARENT=='false'&&$item==0&&$this->groupwithparent=='true'?'':$addimages_image_width), (ADDIMAGES_RESTRICT_PARENT=='false'&&$item==0&&$this->groupwithparent=='true'?'':$addimages_image_height), 'hspace="5" vspace="5"') . '<br>' . (!empty($addimages_images[$item]['desc'])?$addimages_images[$item]['desc']:TEXT_CLICK_TO_ENLARGE) . '</a>\'); //--></script> I am trying to modify the code above so that it will behave in the same way as the following code from product_info.php: <script language="javascript"><!-- document.write('<?php echo '<a target="_blank" rel="lightbox" href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image_pop']) . ')">' . tep_image(DIR_WS_IMAGES . (!empty($product_info['products_image_med'])?$product_info['products_image_med']:(!empty($product_info['products_image_pop'])?$product_info['products_image_pop']:(!empty($product_info['products_image'])?$product_info['products_image_pop']:''))), addslashes($product_info['products_name']), (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_WIDTH:''), (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_HEIGHT:''), 'hspace="5" vspace="5"') . '<br>' . (!empty($product_info['products_image_description'])?$product_info['products_image_description']:TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>'); //--></script> As you can see the two blocks of code are similar, apart from the top block having some extra functionality. Can anyone suggest where to start to get the additional images to work using lightbox???
  3. Hi there I am using this mod: http://addons.oscommerce.com/info/2367 It is the latest version World Zones 2.0. I have been trying to experiment with the code in includes/modules/shipping/worldzones.php I wish to say that if the country ISO code equals 'GB' and the cart quantity is greater than or equal to 2, then shipping is free. I have this code so far: // elari - Added to select default country if not in listing if ($dest_zone == 0) { $dest_zone = $this->num_zones; // the zone is the lastest zone avalaible } // elari - Added to select default country if not in listing if ($dest_zone == 0) { $error = true; // this can no more achieve since by default the value is set to the max number of zones } else { $shipping = -1; $zones_cost = constant('MODULE_SHIPPING_WORLDZONES_COST_' . $dest_zone); //THIS IS MY MODIFICATION for ($i=0, $n=sizeof($products); $i<$n; $i++) { global $cart, $order; $products = $cart->get_products(); $Qty = $products[$i]['quantity']; } if ($Qty > 2 && $dest_country == 'GB'){ $zones_cost = 0; } // Alane - Begin percent mod if (MODULE_SHIPPING_WORLDZONES_MODE == 'percent'){ $shipping = $order_total * $zones_cost; $shipping_method = MODULE_SHIPPING_WORLDZONES_TEXT_WAY . ' ' . $order->delivery['country']['title'] . ': ' .MODULE_SHIPPING_WORLDZONES_TEXT_MODE; if ($shipping_num_boxes > 1) { $shipping_method .= $shipping_num_boxes . 'x '; } } else { // Alane - End percent mod I am trying to get the cart quantity here, and set that number to the variable $Qty. The variable $dest_country is set earlier in the file (I think) My code is the part under the comment //THIS IS MY MODIFICATION. I placed the other code here so that you could see where in the file I have placed it. Any ideas anyone? As this isn't working for me :-( kind regards Jp
  4. This did the trick: if (($cart->count_contents() >= 2) && $dest_country == 'GB'){ $zones_cost = 0; } As $dest_country is set to $order->delivery['country']['iso_code_2']; earlier in the code! Thanks very much :lol:
  5. Does anyone at all have an inkling? :blush:
  6. hmmmm, that didnt work either i'm afraid. Any other ideas?
  7. jpmad4it

    [contribution] Send_order_html_email

    Nevermind..........I fixed it ;-) Just changed the table that the query was using and changed the field it was looking in!
  8. jpmad4it

    [contribution] Send_order_html_email

    hi there, Firstly I'd like to say that this is a great contribution, and I would like to thank all the authors involved. I am having trouble getting the product image to display in the email. I just get the empty image holder marked with the "X". I looked at the link for the image, and its just coming up as http://www.mystore.com/images/ The problem is that I am using an additional images contribution too, and the images are placed in separate manufacturer folders. For example if i create a t-shirt product called "black t-shir"t, and its manufacturer is "Armani", the path to the images will be: catalog/images/products/armani/tshirts/black_small.jpg catalog/images/products/armani/tshirts/black_medium.jpg catalog/images/products/armani/tshirts/black_large.jpg Will this affect the image in the email? I'm pretty sure it will, but I don't know how to fix this. Can anyone help? kind regards Jonathan
  9. jpmad4it

    Official PayPal IPN Support Thread

    I see you are making good progress regarding your issues!! Its just this attribute stock level that we both need to fix now! Nightmare!!!! >_<
  10. jpmad4it

    Official PayPal IPN Support Thread

    Ah right i see, I will look into this when I get a chance. Its a work issue, and I'm on holiday now, but it would be good to get it sorted out before I go back. Keep in touch :thumbsup:
  11. jpmad4it

    Official PayPal IPN Support Thread

    Hi there, which file are you referring to when you say: "I think you might want to find the changed code in the paypal module when you installed the attribute mod. then apply the change to this IPN paypal module. (this will require some php coding skill)" I do have some PHP skills, but not advanced skills which are probably needed to solve this problem :blush:
  12. jpmad4it

    Official PayPal IPN Support Thread

    hey there, i'm afraid not. Still looking for a solution. There is a thread here more specific, but no joy as of yet. http://forums.oscommerce.com/index.php?showtopic=283010 I also posted here: http://forums.oscommerce.com/index.php?showtopic=286259 But I have no replies :-(
  13. jpmad4it

    paypal ipn + stock + qtpro

    Damn I got excited then, but my path is correct so it can't be that. It has to be because of the mixture code we are using from the quantity mods. Could it be a small change to this code in this file /ext/modules/payment/paypal_ipn/ipn.php that is required: // let's update the stock ####################################################### for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { // PRODUCT LOOP STARTS HERE // Stock Update - Joao Correia if (STOCK_LIMITED == 'true') { if (DOWNLOAD_ENABLED == 'true') { $stock_query_raw = "SELECT products_quantity, pad.products_attributes_filename FROM " . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " pa ON p.products_id=pa.products_id LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad ON pa.products_attributes_id=pad.products_attributes_id WHERE p.products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"; // Will work with only one option for downloadable products // otherwise, we have to build the query dynamically with a loop $products_attributes = $order->products[$i]['attributes']; if (is_array($products_attributes)) { $stock_query_raw .= " AND pa.options_id = '" . $products_attributes[0]['option_id'] . "' AND pa.options_values_id = '" . $products_attributes[0]['value_id'] . "'"; } $stock_query = tep_db_query($stock_query_raw); } else { $stock_query = tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); } if (tep_db_num_rows($stock_query) > 0) { $stock_values = tep_db_fetch_array($stock_query); // do not decrement quantities if products_attributes_filename exists if ((DOWNLOAD_ENABLED != 'true') || (!$stock_values['products_attributes_filename'])) { $stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty']; } else { $stock_left = $stock_values['products_quantity']; } tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = '" . $stock_left . "' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) { tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); } } } Surely we need to update this to reduce the attribtue quantity too?
  14. jpmad4it

    paypal ipn + stock + qtpro

    Ah right I see, so if we integrate IPN 1.3 with our other product attribute code it should work? For the time being I have just reverted back to the standard Paypal module that comes with osCommerce and I am going to just check my PayPal account everytime I receive an order to check that the money has gone into my account. Until we figure something out thats the only thing I can do, or update my quantities manually - which I don't really want to do! I will have a look at the code today and see if I can figure something out.........even though I am not using QT Pro ( I wish I was because it looks much more flexible than the mod I have installed!!) rgds Jp
  15. jpmad4it

    PayPal IPN v2.3.3 problem

    Hi there, I'm having some problems with the PayPal IPN v2.3.3 gateway and some other mods that I have installed. I wonder if anyone can help me in some way? The other mods I have installed are: 1) ProductOptionsInProducsPage_1.1 - which can be found here http://addons.oscommerce.com/info/1538 2) quantity_mod_1_2 - which can be found here http://addons.oscommerce.com/info/3302 I have the most recent versions of these mods installed. The first mod basically allows me to displays the product attributes on the product edit page.....only the attributes for that product will be displayed on the product edit page. Then the second mod allows me to add a 'product attribute quantity' i.e. if I have a T-shirt and one of the attributes is the SIZE: Large......I can set this attribute to have a quantity i.e. Size: Large / Quantity 2 Now, the problem is that when I was using the standard PayPal gateway that ships with osComemrce, the product attribute quantity would be reduced everytime someone purchased an item. Since I have upgraded to the new osCommerce PayPal IPN v2.3.3 gateway, the product attribute quantity is no-longer being reduced. Can anyone help me? I'm sure this isn't such a large change in code, just to delete the attribute quantity ordered from the attribute quantity stored in the database? I would really appreciate it if someone could help me as I'm not the most proficient PHP coder. Even if someone could tell me which file to look in this would be of great help to me. Its probably not an error with the IPN code, but an error with the code that comes with the attribute quantity mod. Any help of any kind would be really appreciated. If anyone needs to see my code please don't hesitate to ask! Any help would be amazing. Kind regards Jonathan
  16. jpmad4it

    paypal ipn + stock + qtpro

    hi there, Did you get this problem fixed? I am having the same problem but I use "quantity_mod_1_2" - which can be found here http://addons.oscommerce.com/info/3302 I have had to revert back to using the old PayPal payment module which is rubbish!! regards Jonathan
  17. jpmad4it

    Official PayPal IPN Support Thread

    Hi there, I'm having some problems with this mod and some other mods that I have installed. I wonder if anyone can help me in some way? The other mods I have installed are: 1) ProductOptionsInProducsPage_1.1 - which can be found here http://addons.oscommerce.com/info/1538 2) quantity_mod_1_2 - which can be found here http://addons.oscommerce.com/info/3302 I have the most recent versions of these mods installed. The first mod basically allows me to displays the product attributes on the product edit page.....only the attributes for that product will be displayed on the product edit page. Then the second mod allows me to add a 'product attribute quantity' i.e. if I have a T-shirt and one of the attributes is the SIZE: Large......I can set this attribute to have a quantity i.e. Size: Large / Quantity 2 Now, the problem is that when I was using the standard PayPal system the product attribute quantity would be reduced everytime someone purchased an item. Since I have upgraded to the new osCommerce PayPal IPN v2.3.3 mod, the product attribute quantity is no-longer being reduced. Can anyone help me? I'm sure this isn't such a large change in code, just to delete the quantity ordered from the quantity stored in the database? I would really appreciate it if someone could help me as I'm not the most proficient PHP coder :-( If anyone needs to see my code please don't hesitate to ask! Any help would be amazing. Kind regards Jonathan I have this mod installed v2.3.3. I used to have the original Paypal gateway in use a
  18. Hi everyone I have a big problem. Well its probably not big but it needs to be resolved by 5.30pm GMT Friday 2nd Nov. I will even pay to have this error fixed.......if anyone does that? Here is my problem. I have a few contribs installed. Off the top of my head (at home now, they are all work) I think they are: 1) mod to show product attributes on product edit page 2) option to add quantity to product attributes (also integrated with the above) Now on the product edit page, I have been through every single product (about 2000) and added the product attributes with stock levels. BUT afterwards I realised I forgot to set the prices as taxable on each product. Now if I set the price as taxable and update it all seems fine, until i go to the front end. If i click on the product I have set as taxable, you can see the options/attributes displayed......as though that size is in stock. BUT if you click add to cart, the product is displayed as out of stock. This ONLY occurs if I set the product to be taxable. Can anyone help at all. Im really stuck and desperate to get this resloved. Kind regards Jonathan
  19. jpmad4it

    [Contribution] Additional Images Module

    How can I make the additional images on product_info.php into 1 long list of images....1 on top of each other. At present they are displayed in rows of 3 images. I have narrowed it down to the displayimages.php file that controls this action, but I cannot get the desired effect. I have managed to get the images to display in rows of 2, but I cant get it to show images in rows of 1. This is how i mean if you are confused: Image Image Image etc etc Any help would be great. EDIT: Just noticed the variables at the top of the page! var $numberofrows etc!! Its fixed now!!
  20. jpmad4it

    [Contribution] Additional Images Module

    Should the thumbnails on the product list pages be resized automatically................. As mine are not being changed? Hence why I have been trying to set the small image width / height to 0 or no value. I even have the settings "use image size restrictions" set to False too so that the pre-defined sizes are ignored.........everything seems to work apart from the thumbnails.....pleeeeease help! Could it be the fact that my boxes.php file is not set up correctly thats causing this error?
  21. jpmad4it

    [Contribution] Additional Images Module

    hi there, thanks for the repsone........I removed the blank lines from those files, but it didnt seem to work though? I still receive the error?
  22. jpmad4it

    [Contribution] Additional Images Module

    Hello everyone, I have 2 separate problems here: PROBLEM 1) I have a heavily modified version of osCommerce. I have used Beyond Compare to view the changes in my files but I am having trouble with the catalog/includes/classes/boxes.php file. Can anyone explain what this file does......especially the additional images code snippet for this file........it may help me understand a little better. At first I simply added the additional images code to the bottom of the boxes.php file and it seemed ok until I tried to access the URL www.mysite.com/account.php. I then got the following error: Warning: Cannot modify header information - headers already sent by (output started at /htdocs/includes/classes/boxes.php:725) in /htdocs/includes/functions/general.php on line 33 Here is the code I need to add to the boxes.php file: // BOF: Additional Images class imagesBox extends tableBox { function imagesBox($contents) { $info_box_contents = array(); $info_box_contents[] = array('text' => $this->imagesBoxContents($contents)); $this->table_cellpadding = '1'; $this->tableBox($info_box_contents, true); } function imagesBoxContents($contents) { $this->table_cellpadding = '4'; $this->table_parameters = 'class="imagesBoxContents"'; return $this->tableBox($contents); } } // EOF: Additional Images And here is the code from my modified version of boxes.php: <?php /* $Id: boxes.php,v 1.33 2003/06/09 22:22:50 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ class tableBox { var $table_border = '0'; var $table_width = ''; var $table_cellspacing = '0'; var $table_cellpadding = '0'; var $table_parameters = ''; var $table_row_parameters = ''; var $table_data_parameters = ''; // class constructor function tableBox($contents, $direct_output = false) { $tableBox_string = '<table border="' . tep_output_string($this->table_border) . '" width="' . tep_output_string($this->table_width) . '" cellspacing="' . tep_output_string($this->table_cellspacing) . '" cellpadding="' . tep_output_string($this->table_cellpadding) . '"'; if (tep_not_null($this->table_parameters)) $tableBox_string .= ' ' . $this->table_parameters; $tableBox_string .= '>' . "\n"; for ($i=0, $n=sizeof($contents); $i<$n; $i++) { if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= $contents[$i]['form'] . "\n"; $tableBox_string .= ' <tr'; if (tep_not_null($this->table_row_parameters)) $tableBox_string .= ' ' . $this->table_row_parameters; if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) $tableBox_string .= ' ' . $contents[$i]['params']; $tableBox_string .= '>' . "\n"; if (isset($contents[$i][0]) && is_array($contents[$i][0])) { for ($x=0, $n2=sizeof($contents[$i]); $x<$n2; $x++) { if (isset($contents[$i][$x]['text']) && tep_not_null($contents[$i][$x]['text'])) { $tableBox_string .= ' <td'; if (isset($contents[$i][$x]['align']) && tep_not_null($contents[$i][$x]['align'])) $tableBox_string .= ' align="' . tep_output_string($contents[$i][$x]['align']) . '"'; if (isset($contents[$i][$x]['params']) && tep_not_null($contents[$i][$x]['params'])) { $tableBox_string .= ' ' . $contents[$i][$x]['params']; } elseif (tep_not_null($this->table_data_parameters)) { $tableBox_string .= ' ' . $this->table_data_parameters; } $tableBox_string .= '>'; if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= $contents[$i][$x]['form']; $tableBox_string .= $contents[$i][$x]['text']; if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= '</form>'; $tableBox_string .= '</td>' . "\n"; } } } else { $tableBox_string .= ' <td'; if (isset($contents[$i]['align']) && tep_not_null($contents[$i]['align'])) $tableBox_string .= ' align="' . tep_output_string($contents[$i]['align']) . '"'; if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) { $tableBox_string .= ' ' . $contents[$i]['params']; } elseif (tep_not_null($this->table_data_parameters)) { $tableBox_string .= ' ' . $this->table_data_parameters; } $tableBox_string .= '>' . $contents[$i]['text'] . '</td>' . "\n"; } $tableBox_string .= ' </tr>' . "\n"; if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= '</form>' . "\n"; } $tableBox_string .= '</table>' . "\n"; if ($direct_output == true) echo $tableBox_string; return $tableBox_string; } } // ------------------ infoBoxHeading ---------- class infoBoxHeading extends tableBox { function infoBoxHeading($contents, $left_corner = true, $right_corner = true, $right_arrow = false) { $this->table_cellpadding = '0'; $this->table_parameters = ' class="box_header_txt"'; if ($left_corner == true) { $left_corner = tep_image(DIR_WS_IMAGES . 'infobox/corner_left.gif'); } else { $left_corner = tep_image(DIR_WS_IMAGES . 'infobox/corner_right_left.gif'); } if ($right_arrow == true) { $right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_IMAGES . 'infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>'; } else { $right_arrow = ''; } if ($right_corner == true) { $right_corner = $right_arrow . tep_image(DIR_WS_IMAGES . 'infobox/corner_right.gif'); } else { $right_corner = $right_arrow . tep_draw_separator('pixel_trans.gif', '11', '14'); } $info_box_contents = array(); $info_box_contents[] = array(array('params' => '', 'text' => ''.$contents[0]['text'].'')); $this->tableBox($info_box_contents, true); } } // ------------------ infoBox ---------- class infoBox extends tableBox { function infoBox($contents) { $info_box_contents = array(); $info_box_contents[] = array('text' => $this->infoBoxContents($contents)); $this->table_cellpadding = '0'; $this->table_parameters = ' style="border-bottom:2px solid #000000;"'; $this->tableBox($info_box_contents, true); } function infoBoxContents($contents) { $this->table_cellpadding = '0'; $this->table_parameters = ' class="box_body"'; $info_box_contents = array(); for ($i=0, $n=sizeof($contents); $i<$n; $i++) { $info_box_contents[] = array( array ( 'align' => (isset($contents[$i]['align']) ? $contents[$i]['align'] : ''), 'form' => (isset($contents[$i]['form']) ? $contents[$i]['form'] : ''), 'params' => ' style="border:1px solid #282828; border-width:12px 10px 12px 17px;"', 'text' => ''.(isset($contents[$i]['text']) ? $contents[$i]['text'] : '').'')); } return $this->tableBox($info_box_contents); } } // ------------------ infoBoxHeading1 ---------- class infoBoxHeading1 extends tableBox { function infoBoxHeading1($contents, $left_corner = true, $right_corner = true, $right_arrow = false) { $this->table_cellpadding = '0'; if ($left_corner == true) { $left_corner = tep_image(DIR_WS_IMAGES . 'infobox/corner_left.gif'); } else { $left_corner = tep_image(DIR_WS_IMAGES . 'infobox/corner_right_left.gif'); } if ($right_arrow == true) { $right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_IMAGES . 'infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>'; } else { $right_arrow = ''; } if ($right_corner == true) { $right_corner = $right_arrow . tep_image(DIR_WS_IMAGES . 'infobox/corner_right.gif'); } else { $right_corner = $right_arrow . tep_draw_separator('pixel_trans.gif', '11', '14'); } $info_box_contents = array(); $info_box_contents[] = array(array('params' => ' class="box_header_txt1"', 'text' => ''.$contents[0]['text'].'')); $this->tableBox($info_box_contents, true); } } // ------------------ infoBox1 ---------- class infoBox1 extends tableBox { function infoBox1($contents) { $info_box_contents = array(); $info_box_contents[] = array('text' => $this->infoBoxContents($contents)); $this->table_cellpadding = '0'; $this->table_parameters = ' style="border-bottom:8px solid #ffffff;"'; $this->tableBox($info_box_contents, true); } function infoBoxContents($contents) { $this->table_cellpadding = '0'; $this->table_parameters = ' style="background:#F4F6DE;border:1px solid #F4F6DE; border-width:0px 11px 15px 11px;" class="box_body"'; $info_box_contents = array(); for ($i=0, $n=sizeof($contents); $i<$n; $i++) { $info_box_contents[] = array( array ( 'align' => (isset($contents[$i]['align']) ? $contents[$i]['align'] : ''), 'form' => (isset($contents[$i]['form']) ? $contents[$i]['form'] : ''), 'params' => '', 'text' => ''.(isset($contents[$i]['text']) ? $contents[$i]['text'] : '').'')); } return $this->tableBox($info_box_contents); } } // ------------------ infoBox2 ---------- class infoBox2 extends tableBox { function infoBox2($contents) { $info_box_contents = array(); $info_box_contents[] = array('text' => $this->infoBoxContents($contents)); $this->table_cellpadding = '0'; $this->table_parameters = ' style="border-bottom:2px solid #000000;"'; $this->tableBox($info_box_contents, true); } function infoBoxContents($contents) { $this->table_cellpadding = '0'; $this->table_parameters = ''; $info_box_contents = array(); for ($i=0, $n=sizeof($contents); $i<$n; $i++) { $info_box_contents[] = array( array ( 'align' => (isset($contents[$i]['align']) ? $contents[$i]['align'] : ''), 'form' => (isset($contents[$i]['form']) ? $contents[$i]['form'] : ''), 'params' => '', 'text' => ''.(isset($contents[$i]['text']) ? $contents[$i]['text'] : '').'')); } return $this->tableBox($info_box_contents); } } //----------------------------------------------- tableBox_output ---------------------------------- class tableBox_output { var $table_border = '0'; var $table_width = ''; var $table_cellspacing = '0'; var $table_cellpadding = '0'; var $table_parameters = ' '; var $table_row_parameters = ''; var $table_data_parameters = ''; // class constructor function tableBox_output($contents, $direct_output = false) { $tableBox_string = '<table border="' . tep_output_string($this->table_border) . '" width="' . tep_output_string($this->table_width) . '" cellspacing="' . tep_output_string($this->table_cellspacing) . '" cellpadding="' . tep_output_string($this->table_cellpadding) . '"'; if (tep_not_null($this->table_parameters)) $tableBox_string .= '' . $this->table_parameters; $tableBox_string .= '>' . "\n"; for ($i=0, $n=sizeof($contents); $i<$n; $i++) { if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= $contents[$i]['form'] . "\n"; if ($i != 0) { $tableBox_string .= '';} $tableBox_string .= ' <tr'; if (tep_not_null($this->table_row_parameters)) $tableBox_string .= ' ' . $this->table_row_parameters; if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) $tableBox_string .= ' ' . $contents[$i]['params']; $tableBox_string .= '>' . "\n"; if (isset($contents[$i][0]) && is_array($contents[$i][0])) { for ($x=0, $n2=sizeof($contents[$i]); $x<$n2; $x++) { if (isset($contents[$i][$x]['text']) && tep_not_null($contents[$i][$x]['text'])) { if ($x >= 1){ if($i == 0) {$tableBox_string .= '';} else { $tableBox_string .= '';} } $color=' class="product2"'; if ($i %2) { $color = '';} $tableBox_string .= ' <td'.$color; if (isset($contents[$i][$x]['align']) && tep_not_null($contents[$i][$x]['align'])) $tableBox_string .= ' align="' . tep_output_string($contents[$i][$x]['align']) . '"'; if (isset($contents[$i][$x]['params']) && tep_not_null($contents[$i][$x]['params'])) { $tableBox_string .= ' ' . $contents[$i][$x]['params']; } elseif (tep_not_null($this->table_data_parameters)) { $tableBox_string .=' ' . $this->table_data_parameters; } $tableBox_string .= '>'; if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= $contents[$i][$x]['form']; $tableBox_string .= $contents[$i][$x]['text']; if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= '</form>'; $tableBox_string .= '</td> ' . "\n"; } } } else { $tableBox_string .= ' <td'; if (isset($contents[$i]['align']) && tep_not_null($contents[$i]['align'])) $tableBox_string .= ' align="' . tep_output_string($contents[$i]['align']) . '"'; if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) { $tableBox_string .= ' ' . $contents[$i]['params']; } elseif (tep_not_null($this->table_data_parameters)) { $tableBox_string .= ' ' . $this->table_data_parameters; } $tableBox_string .= '>' . $contents[$i]['text'] . '</td>' . "\n"; } $tableBox_string .= ' </tr> ' . "\n"; if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= '</form>' . "\n"; } $tableBox_string .= '</table>' . "\n"; if ($direct_output == true) echo $tableBox_string; return $tableBox_string; } } //---------------- tableBox_output --------------------- class contentBox extends tableBox_output { function contentBox($contents) { $info_box_contents = array(); $info_box_contents[] = array('text' => $this->contentBoxContents($contents)); $this->table_cellpadding = '0'; $this->table_parameters = ' class="box_width_cont product"'; $this->tableBox_output($info_box_contents, true); } function contentBoxContents($contents) { $this->table_cellpadding = '0'; $this->table_parameters = 'class=""'; return $this->tableBox_output($contents); } } // ------------------ contentBoxHeading --------------------------------------------------------- class contentBoxHeading extends tableBox { function contentBoxHeading($contents) { $this->table_cellpadding = '0'; $this->table_parameters = ''; $info_box_contents = array(); $info_box_contents[] = array( array('params' => ' class="cont_header_txt"', 'text' => ''.$contents[0]['text'].'')); $this->tableBox($info_box_contents, true); } } //---------------- contentBoxHeading_WHATS_NEW --------------------- class contentBoxHeading_WHATS_NEW extends tableBox { function contentBoxHeading_WHATS_NEW($contents) { $this->table_cellpadding = '0'; $this->table_parameters = ''; $info_box_contents = array(); $info_box_contents[] = array(array('params' => ' class="cont_header_txt"', 'text' => ''.BOX_HEADING_WHATS_NEW.'')); $this->tableBox($info_box_contents, true); } } //---------------- contentBoxHeading_ProdNew --------------------- class contentBoxHeading_ProdNew extends tableBox { function contentBoxHeading_ProdNew($contents) { $this->table_cellpadding = '0'; $this->table_parameters = ''; $info_box_contents = array(); $info_box_contents[] = array(array('params' => ' class="cont_header_txt"', 'text' => ''.HEADING_TITLE.'')); $this->tableBox($info_box_contents, true); } } class errorBox extends tableBox { function errorBox($contents) { $this->table_data_parameters = 'class="errorBox"'; $this->tableBox($contents, true); } } //---------------- tableBox_shopping_cart --------------------- class tableBox_shopping_cart { var $table_border = '0'; var $table_width = ''; var $table_cellspacing = '0'; var $table_cellpadding = '0'; var $table_parameters = ''; var $table_row_parameters = ''; var $table_data_parameters = ''; // class constructor function tableBox_shopping_cart($contents, $direct_output = false) { $tableBox_string = '<table border="' . tep_output_string($this->table_border) . '" width="' . tep_output_string($this->table_width) . '" cellspacing="' . tep_output_string($this->table_cellspacing) . '" cellpadding="' . tep_output_string($this->table_cellpadding) . '"'; if (tep_not_null($this->table_parameters)) $tableBox_string .= ' ' . $this->table_parameters; $tableBox_string .= '>' . "\n"; for ($i=0, $n=sizeof($contents); $i<$n; $i++) { if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= $contents[$i]['form'] . "\n"; if ($i >= 2) { $tableBox_string .= ' <tr><td style="background:#000000;height:1px;" colspan="4">'.tep_draw_separator('spacer.gif', '1', '1').'</td></tr> ';} $tableBox_string .= ' <tr'; if (tep_not_null($this->table_row_parameters)) $tableBox_string .= ' ' . $this->table_row_parameters; if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) $tableBox_string .= ' ' . $contents[$i]['params']; $tableBox_string .= '>' . "\n"; if (isset($contents[$i][0]) && is_array($contents[$i][0])) { for ($x=0, $n2=sizeof($contents[$i]); $x<$n2; $x++) { if (isset($contents[$i][$x]['text']) && tep_not_null($contents[$i][$x]['text'])) { if ($x >= 1) $tableBox_string .= ''; $tableBox_string .= ' <td'; if (isset($contents[$i][$x]['align']) && tep_not_null($contents[$i][$x]['align'])) $tableBox_string .= ' align="' . tep_output_string($contents[$i][$x]['align']) . '"'; if (isset($contents[$i][$x]['params']) && tep_not_null($contents[$i][$x]['params'])) { $tableBox_string .= ' ' . $contents[$i][$x]['params']; } elseif (tep_not_null($this->table_data_parameters)) { $tableBox_string .= ' ' . $this->table_data_parameters; } $tableBox_string .= '>'; if ($i == 0) $tableBox_string .= tep_draw_shop_top(); else $tableBox_string .= tep_draw_shop_top(); if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= $contents[$i][$x]['form']; $tableBox_string .= $contents[$i][$x]['text']; if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= '</form>'; if ($i == 0) $tableBox_string .= tep_draw_shop_bottom(); else $tableBox_string .= tep_draw_shop_bottom(); $tableBox_string .= '</td>' . "\n"; } } } else { $tableBox_string .= ' <td'; if (isset($contents[$i]['align']) && tep_not_null($contents[$i]['align'])) $tableBox_string .= ' align="' . tep_output_string($contents[$i]['align']) . '"'; if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) { $tableBox_string .= ' ' . $contents[$i]['params']; } elseif (tep_not_null($this->table_data_parameters)) { $tableBox_string .= ' ' . $this->table_data_parameters; } $tableBox_string .= '>'.tep_draw_shop_top_1() . $contents[$i]['text'] . tep_draw_shop_bottom_1().'</td>' . "\n"; } $tableBox_string .= ' </tr>' . "\n"; /* if ($i >= 2) { */ $tableBox_string .= ' '; /* } */ if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= '</form>' . "\n"; } $tableBox_string .= '</table>' . "\n"; if ($direct_output == true) echo $tableBox_string; return $tableBox_string; } } class productListingBox extends tableBox_shopping_cart { function productListingBox($contents) { $this->table_parameters = ' class="box_width_cont shop_cart"'; $this->tableBox_shopping_cart($contents, true); } } // -------------------------------------- -------------------------- function tep_draw_heading_top() { /* require(DIR_WS_BOXES . 'panel_top.php'); */ echo ' <table cellpadding="0" cellspacing="0" border="0" style="background:#444642;border:4px solid #313130;"> <tr><td> '; } // -------------------------------------- -------------------------- function tep_draw_heading_bottom() { echo ' </td></tr> </table> <table cellpadding="0" cellspacing="0" border="0"><tr><td height="2"></td></tr></table> '; } // -------------------------------------- -------------------------- // -------------------------------------- -------------------------- function tep_draw_heading_top_1() { echo ' <table cellpadding="0" cellspacing="0" border="0"> <tr><td style="border:0px solid #444642;border-width:0px 13px 10px 13px;"> '; } // -------------------------------------- -------------------------- function tep_draw_heading_bottom_1() { echo ' </td></tr> </table> '; } // -------------------------------------- -------------------------- // -------------------------------------- -------------------------- function tep_draw_heading_top_2() { echo ' <table cellpadding="0" cellspacing="0" border="0"> <tr><td>'.tep_draw_separator('spacer.gif', '15', '1').'</td> <td width="100%"> '; } // -------------------------------------- -------------------------- function tep_draw_heading_bottom_2() { echo ' </td><td>'.tep_draw_separator('spacer.gif', '25', '1').'</td></tr> </table> '; } // -------------------------------------- -------------------------- // -------------------------------------- -------------------------- function tep_draw_heading_top_3() { echo ' <table cellpadding="0" cellspacing="0" border="0"> <tr><td style="background:#4E4F4C;border:0px solid #ffffff;border-width:0px 0px 0px 0px;"> '; } // -------------------------------------- -------------------------- function tep_draw_heading_bottom_3() { echo ' </td></tr> </table> '; } // -------------------------------------- -------------------------- // -------------------------------------- -------------------------- function tep_draw_prod_top() { return $table = ''; } // -------------------------------------- -------------------------- function tep_draw_prod_bottom() { return $table = ''; } // -------------------------------------- -------------------------- function tep_draw_shop_top() { return $table = ''; } // -------------------------------------- -------------------------- function tep_draw_shop_bottom() { return $table = ''; } // -------------------------------------- -------------------------- function tep_draw_shop_top_1() { return $table = ''; } // -------------------------------------- -------------------------- function tep_draw_shop_bottom_1() { return $table = ''; } // -------------------------------------- -------------------------- function tep_draw_result_top() { echo ''; } // -------------------------------------- -------------------------- function tep_draw_result_bottom() { echo ''; } // -------------------------------------- -------------------------- function tep_draw_separate() { echo ' <table cellpadding="0" cellspacing="0"><tr><td height="3"></td></tr></table> '; } // -------------------------------------- -------------------------- // ------------------ infoBox_77 ---------- class infoBox_77 extends tableBox { function infoBox_77($contents) { $info_box_contents = array(); $info_box_contents[] = array('text' => $this->infoBoxContents($contents)); $this->table_cellpadding = '0'; $this->table_parameters = 'class=""'; $this->tableBox($info_box_contents, true); } function infoBoxContents($contents) { $this->table_cellpadding = '0'; $this->table_parameters = ' class=""'; $info_box_contents = array(); for ($i=0, $n=sizeof($contents); $i<$n; $i++) { $info_box_contents[] = array( array ( 'align' => (isset($contents[$i]['align']) ? $contents[$i]['align'] : ''), 'form' => (isset($contents[$i]['form']) ? $contents[$i]['form'] : ''), 'params' => '', 'text' => ''.(isset($contents[$i]['text']) ? $contents[$i]['text'] : '').'')); } return $this->tableBox($info_box_contents); } } // ------------------ infoBox_78 ---------- class infoBox_78 extends tableBox { function infoBox_78($contents) { $info_box_contents = array(); $info_box_contents[] = array('text' => $this->infoBoxContents($contents)); $this->table_cellpadding = '0'; $this->table_cellspacing = '1'; $this->table_parameters = 'class="infoBox"'; $this->tableBox($info_box_contents, true); } function infoBoxContents($contents) { $this->table_cellpadding = '0'; $this->table_cellspacing = '15'; $this->table_parameters = 'class="infoBoxContents "'; $info_box_contents = array(); for ($i=0, $n=sizeof($contents); $i<$n; $i++) { $info_box_contents[] = array( array ( 'align' => (isset($contents[$i]['align']) ? $contents[$i]['align'] : ''), 'form' => (isset($contents[$i]['form']) ? $contents[$i]['form'] : ''), 'params' => ' class="main"', 'text' => ''.(isset($contents[$i]['text']) ? $contents[$i]['text'] : '').'')); } return $this->tableBox($info_box_contents); } } //----------------------------------------------- tableBox_output1 ---------------------------------- class tableBox_output1 { var $table_border = '0'; var $table_width = ''; var $table_cellspacing = '0'; var $table_cellpadding = '0'; var $table_parameters = ' '; var $table_row_parameters = ''; var $table_data_parameters = ''; // class constructor function tableBox_output1($contents, $direct_output = false) { $tableBox_string = '<table border="' . tep_output_string($this->table_border) . '" width="' . tep_output_string($this->table_width) . '" cellspacing="' . tep_output_string($this->table_cellspacing) . '" cellpadding="' . tep_output_string($this->table_cellpadding) . '"'; if (tep_not_null($this->table_parameters)) $tableBox_string .= '' . $this->table_parameters; $tableBox_string .= '>' . "\n"; for ($i=0, $n=sizeof($contents); $i<$n; $i++) { if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= $contents[$i]['form'] . "\n"; if ($i != 0) { $tableBox_string .= ' <tr><td colspan="3" class="bg_gg">'.tep_draw_separator('spacer.gif', '1', '1').'</td></tr> ';} $tableBox_string .= ' <tr'; if (tep_not_null($this->table_row_parameters)) $tableBox_string .= ' ' . $this->table_row_parameters; if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) $tableBox_string .= ' ' . $contents[$i]['params']; $tableBox_string .= '>' . "\n"; if (isset($contents[$i][0]) && is_array($contents[$i][0])) { for ($x=0, $n2=sizeof($contents[$i]); $x<$n2; $x++) { if (isset($contents[$i][$x]['text']) && tep_not_null($contents[$i][$x]['text'])) { if ($x >= 1){ if($i == 0) {$tableBox_string .= ' <td class="bg_vv">'.tep_draw_separator('spacer.gif', '1', '1').'</td> ';} else { $tableBox_string .= ' <td class="bg_vv">'.tep_draw_separator('spacer.gif', '1', '1').'</td> ';} } $tableBox_string .= ' <td'; if (isset($contents[$i][$x]['align']) && tep_not_null($contents[$i][$x]['align'])) $tableBox_string .= ' align="' . tep_output_string($contents[$i][$x]['align']) . '"'; if (isset($contents[$i][$x]['params']) && tep_not_null($contents[$i][$x]['params'])) { $tableBox_string .= ' ' . $contents[$i][$x]['params']; } elseif (tep_not_null($this->table_data_parameters)) { $tableBox_string .= ' ' . $this->table_data_parameters; } $tableBox_string .= '>'; if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= $contents[$i][$x]['form']; $tableBox_string .= $contents[$i][$x]['text']; if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= '</form>'; $tableBox_string .= '</td> ' . "\n"; } } } else { $tableBox_string .= ' <td'; if (isset($contents[$i]['align']) && tep_not_null($contents[$i]['align'])) $tableBox_string .= ' align="' . tep_output_string($contents[$i]['align']) . '"'; if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) { $tableBox_string .= ' ' . $contents[$i]['params']; } elseif (tep_not_null($this->table_data_parameters)) { $tableBox_string .= ' ' . $this->table_data_parameters; } $tableBox_string .= '>' . $contents[$i]['text'] . '</td>' . "\n"; } $tableBox_string .= ' </tr> ' . "\n"; if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= '</form>' . "\n"; } $tableBox_string .= '</table>' . "\n"; if ($direct_output == true) echo $tableBox_string; return $tableBox_string; } } //---------------- tableBox_output1 --------------------- class contentBox1 extends tableBox_output1 { function contentBox1($contents) { $info_box_contents = array(); $info_box_contents[] = array('text' => $this->contentBoxContents($contents)); $this->table_cellpadding = '0'; $this->table_parameters = ' class="box_width_cont product"'; $this->tableBox_output1($info_box_contents, true); } function contentBoxContents($contents) { $this->table_cellpadding = '0'; $this->table_parameters = 'class=""'; return $this->tableBox_output1($contents); } } ?> If anyone could help me integrate the code from the 2 files together, I would be very grateful. The code differences are best viewed using beyond compare or a similar file comparison software. PROBLEM 2) I am having trouble with displaying my thumbnails correctly. If I want to get the store to display the thumbnails how they have been resized by Additional Images (i.e. nice and unstretched), I have to go into Admin->Config->Images and set 'small image width' and 'small image height' to both 0 or just a blank field. But doing this has an effect on the Additional Images Thumbnail Utility under Admin->Catalog-Additional Images. When I hit the 'process' button I get these errors: Warning: imagejpeg(): supplied argument is not a valid Image resource in /homepages/11/d158288303/htdocs/admin/includes/classes/alterimage.php on line 383 Warning: chmod() [function.chmod]: No such file or directory in htdocs/admin/includes/classes/alterimage.php on line 392 Warning: Cannot modify header information - headers already sent by (output started at htdocs/admin/includes/classes/alterimage.php:383) in htdocs/admin/includes/functions/general.php on line 22 EDIT: I have just noticed that the same error occurs if i also change the "display image width" also. So I have to set the small image width/height back to normal for the Thumbnail processing to work. Does anyone have any ideas of how to get around this error, as eventually my client will want to use the admin section and rezise thumbnails himself. Thanks in advance. Jp
  23. jpmad4it

    PROTX Form and 3d-secure

    what a pain in the bum this is!!!! Is there any way that you can turn off accepting payments from switch / maestro in the Protx Admin area, just in case there is no free solution/contribution by D-Day in August???
  24. jpmad4it

    Options as images MS2 help required

    Anyone at all? :blink:
  25. Hi peeps, I have just installed the Options as Images MS2 contribtuon which allows me to show my product options/attributes as images. The only thing that is a problem for me is that the options are all shown as radio buttons, and I have a lot of options for each product and its starting to look messy as they are all shown at once. Is there any kind of contribution out there that will allow me to create drop down menu's instead of using the radio button? Then when an item is selected in the drop down menu the relevant picture is displayed for that option? I have searched around and there is the attribute set plus contribution but I am not sure if this is what I am looking for. Any help would be fantastic. regards Jonathan
×