Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Option Types v2


Zappo

Recommended Posts

There's another issue i need to solve.

I need to trick it so it re-orders it + when a product without an attribute is added it adds the main product on top like in this screenshot.

Aaaaah! That's what you where making!

Looks nice that way! Does it also remove seperate attributes?

Maybe this should be an option to turn on/off...

 

And the sorting of the cart should be an option too...

I'm not on my development PC, so I can't test/check anything right now, but you'll have to sort the $products array to get that done.

-Edit-

I think I'd do that in the shopping_cart.php class...

Edited by Zappo

Like Eek said... It never hurts to help!
----------------------------------------

Link to comment
Share on other sites

i dont understand i think.

But there is a issue here , by default of this contribution.

 

When you added a product that contain a textfield ,but not used this field, the link to this product (in shopping_cart.php) is created like this:

product_info.php?products_id=357{txt_1}{txt_4}

I mean, in your Shopping Cart, you have checkboxes next to attributes. Can those attributes be separately removed from the product?

 

Try getting the product id by using tep_get_prid (or maybe uprid...) like this:

$products_id = tep_get_prid($products_id_string);

Like Eek said... It never hurts to help!
----------------------------------------

Link to comment
Share on other sites

yes they can , but dont let you mislead.

The screenshot is how i want it (i edited it).

i also found a topic abouth sort order

http://forums.oscommerce.de/index.php?showtopic=54887&st=0&p=261263entry261263

But it not handles correctly how i want, it keeps products together , but it mix the ones with attributes and non-attributes

Ok, but then what exactly do you want to do, except from removing the product name from the attributes?

Like Eek said... It never hurts to help!
----------------------------------------

Link to comment
Share on other sites

Complicated... no?

Yeah...

 

Correct me if I'm wrong, but I believe to have it look like the first screenshot, you just have to hide the Product's name in the Shopping Cart Option Listing, no?

Like Eek said... It never hurts to help!
----------------------------------------

Link to comment
Share on other sites

What's your code for that?

I have the following:

//BOF - Zappo - Option Types v2 - Rearanged Product(s) cart-listing, and added Options Column
     $products_name = '<table border="0" cellspacing="2" cellpadding="2">' .
                      '  <tr>' .
                      '    <td class="productListing-data" align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '"><b>' . $products[$i]['name'] . '</b>' . $stock_check . '</a></td>' .
                      '  </tr>' .
                      '  <tr>' .
                      '    <td class="productListing-data" align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">' . tep_image(DIR_WS_IMAGES . $products[$i]['image'], $products[$i]['name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>' .
                      '  </tr>' .
                      '</table>';

Like Eek said... It never hurts to help!
----------------------------------------

Link to comment
Share on other sites

Has anyone been able to implement this with order editor? I think the only issue I have left is when I go to "Add Product" None of the fields to add options are correct, they are all dropdowns, where they need to be text areas, checkboxes, etc.

 

Any thoughts?

Link to comment
Share on other sites

I really feel like an idiot.

:-"

 

-edit-

Well, I guess I could have asked first if you knew about that too :blush:

Edited by Zappo

Like Eek said... It never hurts to help!
----------------------------------------

Link to comment
Share on other sites

Hi! Great contrib!

I just have a comment.

If anyone in the future reads this because they're getting a T_CASE unexpected error on /includes/application_top.php cca line 452, I fixed it:

 

Line 446-450

 

//BOF - Zappo - Option Types v2 - ONE LINE - Replace the posted array with the processed one.
$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $real_ids))+1, $real_ids);
}
tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
break;

 

Remove the }, that's it.

Don't know why I had this problem, maybe previous contribs.

The first two lines of the above code are in the instructions, it doesn't say to remove the bracket though.

 

Hope that helps.

Edited by Fyod
Link to comment
Share on other sites

Hi! Great contrib!

I just have a comment.

If anyone in the future reads this because they're getting a T_CASE unexpected error on /includes/application_top.php cca line 452, I fixed it:

 

Line 446-450

 

//BOF - Zappo - Option Types v2 - ONE LINE - Replace the posted array with the processed one.
$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $real_ids))+1, $real_ids);
}
tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
break;

 

Remove the }, that's it.

Don't know why I had this problem, maybe previous contribs.

The first two lines of the above code are in the instructions, it doesn't say to remove the bracket though.

 

Hope that helps.

 

I don't know why you had this error and I also don't know if you really fixed something. I would be just more careful when posting "fixes" like this. Specially when you say "Don't know why I had this problem, maybe previous contribs". You should say what contributions exactly and be sure why you was getting the error so that you can be sure what you are "fixing"

 

There are many reasons why you was getting a T-Case error, this is nothing more that a syntax error appearing in most of the cases because of wrong merging of contributions.

 

- What is for example if you are missing the starting if condition and the starting { ? Should it not be added instead of removing an other one?

- What is if you have one { just above the code you posted that should not be there? Following your advice you exclude the code from the if condition

- What is if you have one more { after the code you posted that should not be there? Following your advice you include more code into the if condition

 

Just some examples, In all this cases you avoid the syntax error but you damage the functionality. Are you sure now that everything works properly in your cart?

 

I do NOT suggest to anyone to follow this advice and to remove exactly this bracket when getting an error. The right way is to count all brackets, to find out the "logic" they have (what should be included in what) and if nothing helps to post the question here.

Edited by multimixer
Link to comment
Share on other sites

Guess you're right. I now have a problem that if a product has options, clicking "add to cart" refreshes the page but does nothing else.

I'm no professional, but this is by far the most complacated addon I've done. Especially since I have a custom site layout and other contribs.

I'll go through the scripts once more.

Link to comment
Share on other sites

Hi Fyod,

 

I suspect you might find that you are missing your case statement, which is why you had one to many curly brackets;

 

In the chunk of code that begins with;

 

//BOF - Zappo - Option Types v2 - File uploading: Purge the Temporary Upload Dir
                               $purgeDir = opendir(TMP_DIR) or die ('Could not open '.TMP_DIR);
                               while ($file = readdir($purgeDir)) {
                                 if ($file != ('.htaccess') && $file != ('.') && $file != ('..') && filemtime(TMP_DIR . $file) < strtotime(OPTIONS_TYPE_PURGETIME)) {

 

If the begining of that chunk looks like the above and not like this;

 

case 'add_product' :  //BOF - Zappo - Option Types v2 - File uploading: Purge the Temporary Upload Dir
                               $purgeDir = opendir(TMP_DIR) or die ('Could not open '.TMP_DIR);
                               while ($file = readdir($purgeDir)) {
                                 if ($file != ('.htaccess') && $file != ('.') && $file != ('..') && filemtime(TMP_DIR . $file) < strtotime(OPTIONS_TYPE_PURGETIME)) {

 

 

Then you are definitely missing the case 'add_product' : beginning to the code.

 

Once you put this back in, you will need to put that curly bracket back in at the bottom of that section of code too.

Link to comment
Share on other sites

Hi!

I've installed this add-on and it's terrific! However, I'm coming across the need to add weight (to the product's total shipping weight) when certain option values are chosen.

Is this an easy fix?? Unfortunately I'm not familiar enough with PHP to make any major changes...

Thanks!!

Link to comment
Share on other sites

Peter, thanks very much for your help. You were right, I think it's a little misleading in the instructions:

 

*** FIND ***


     case 'add_product' :    if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
                               $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);


*** REPLACE WITH ***: 

//BOF - Zappo - Option Types v2 - File uploading: Purge the Temporary Upload Dir
                               $purgeDir = opendir(TMP_DIR) or die ('Could not open '.TMP_DIR);
                               while ($file = readdir($purgeDir)) {
                                 if ($file != ('.htaccess') && $file != ('.') && $file != ('..') && filemtime(TMP_DIR . $file) < strtotime(OPTIONS_TYPE_PURGETIME)) {
....

 

Should be:

 

*** FIND ***


     case 'add_product' :    if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
                               $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);


*** REPLACE WITH ***: 

     case 'add_product' :    if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
                               //BOF - Zappo - Option Types v2 - File uploading: Purge the Temporary Upload Dir
                               $purgeDir = opendir(TMP_DIR) or die ('Could not open '.TMP_DIR);
                               while ($file = readdir($purgeDir)) {
                                 if ($file != ('.htaccess') && $file != ('.') && $file != ('..') && filemtime(TMP_DIR . $file) < strtotime(OPTIONS_TYPE_PURGETIME)) {
....

 

Problem now is that even if I copy the application_top.php directly from the downloaded OTv2 folder (not edited by me), when "Add to cart" is clicked, it opens shopping_cart.php, which says "Currently no products in cart".

Any idea what that could be?

Edited by Fyod
Link to comment
Share on other sites

Peter, thanks very much for your help. You were right, I think it's a little misleading in the instructions:

 

Yes, there is an error in the installation instructions posted by rosemarryann on 13 11 09.

 

The post of Fyod is also wrong, no add to cart anymore, that why he is getting the errors.

 

To make things clear, this part of the instructions about changes in includes/application_top.php should be

 

FIND

     case 'add_product' :    if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
                               $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);
                             }

 

REPLACE WITH

      
          case 'add_product' :    if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
                               //BOF - Zappo - Option Types v2 - File uploading: Purge the Temporary Upload Dir
                               $purgeDir = opendir(TMP_DIR) or die ('Could not open '.TMP_DIR);
                               while ($file = readdir($purgeDir)) {
                                 if ($file != ('.htaccess') && $file != ('.') && $file != ('..') && filemtime(TMP_DIR . $file) < strtotime(OPTIONS_TYPE_PURGETIME)) {
                                   unlink(TMP_DIR . $file);  // Delete file from server...
                                   tep_db_query("delete from " . TABLE_FILES_UPLOADED . " where files_uploaded_name = '" . $file . "'"); // Remove File's database entry....
                                 }
                               }
                               closedir($purgeDir);
                               //EOF - Zappo - Option Types v2 - File uploading: Purge the Temporary Upload Dir

                               //BOF - Zappo - Option Types v2 - ONE LINE - Set real_ids for processing
                               $real_ids = $HTTP_POST_VARS['id'];
                               //BOF - Zappo - Option Types v2 - File uploading: save uploaded files with unique file names, in the proper folder
                               if ($HTTP_POST_VARS['number_of_uploads'] > 0) {
                                 require(DIR_WS_CLASSES . 'upload.php');
                                 for ($i = 1; $i <= $HTTP_POST_VARS['number_of_uploads']; $i++) {
                                   $TEMP_FILE = $_FILES['id']['tmp_name'][TEXT_PREFIX . $HTTP_POST_VARS[uPLOAD_PREFIX . $i]];
                                   if (tep_not_null($TEMP_FILE) && $TEMP_FILE != 'none') {
                                     $products_options_file = new upload('id');
                                     //BOF - Zappo - Option Types v2 - Set Upload directory (Registered customers in Uploads, other in Temporary folder)
                                     if (tep_session_is_registered('customer_id')) {  // IF the customer is registered, use Upload Dir
                                       $products_options_file->set_destination(UPL_DIR);
                                     } else { // If the customer is not registered, use Temporary Dir
                                       $products_options_file->set_destination(TMP_DIR);
                                     }
                                     //EOF - Zappo - Option Types v2 - Set Upload directory (Registered customers in Uploads, other in Temporary folder)
                                     if ($products_options_file->parse(TEXT_PREFIX . $HTTP_POST_VARS[uPLOAD_PREFIX . $i])) {
                                       if (tep_session_is_registered('customer_id')) {
                                         tep_db_query("insert into " . TABLE_FILES_UPLOADED . " (sesskey, customers_id, files_uploaded_name, date) values('" . tep_session_id() . "', '" . $customer_id . "', '" . tep_db_input($products_options_file->filename) . "', '" . date("d-m-y") . "')");
                                       } else {
                                         tep_db_query("insert into " . TABLE_FILES_UPLOADED . " (sesskey, files_uploaded_name, date) values('" . tep_session_id() . "', '" . tep_db_input($products_options_file->filename) . "', '" . date("d-m-y") . "')");
                                       }
                                       //BOF - Zappo - Option Types v2 - Set File Prefix
                                       if (OPTIONS_TYPE_FILEPREFIX == 'Database') {  //  Database ID as File prefix
                                         $insert_id = tep_db_insert_id() . '_';
                                       } else {  //  Date, time or both as File prefix (Change date formatting here)
                                         if (OPTIONS_TYPE_FILEPREFIX == 'Date' || OPTIONS_TYPE_FILEPREFIX == 'DateTime') {
                                           $insert_id = 'D'.date("d-m-y_");
                                         }
                                         $insert_id .= (OPTIONS_TYPE_FILEPREFIX == 'DateTime' || OPTIONS_TYPE_FILEPREFIX == 'Time') ? 'T'.date("H-i_") : '';
                                       }
                                       //EOF - Zappo - Option Types v2 - Set File Prefix
                                       // Update filename in Database with correct prefix (For comparing database names with real files)
                                       tep_db_query("update " . TABLE_FILES_UPLOADED . " set files_uploaded_name = '" . tep_db_input($insert_id . $products_options_file->filename) . "' where sesskey = '" . tep_session_id() . "' and files_uploaded_name = '" . tep_db_input($products_options_file->filename) . "' and date = '" . date("d-m-y") . "'");
                                       $real_ids[TEXT_PREFIX . $HTTP_POST_VARS[uPLOAD_PREFIX . $i]] = $insert_id . $products_options_file->filename;
                                       $products_options_file->set_filename($insert_id . $products_options_file->filename);
                                       if (!($products_options_file->save())) {
                                         break 2;
                                       }
                                     } else {
                                       break 2;
                                     }
                                   } else { // No file uploaded -- use previously uploaded file (From Dropdown)
                                     $real_ids[TEXT_PREFIX . $HTTP_POST_VARS[uPLOAD_PREFIX . $i]] = $HTTP_POST_VARS[TEXT_PREFIX . UPLOAD_PREFIX . $i];
                                   }
                                 }
                               }
                               //EOF - Zappo - Option Types v2 - File uploading: save uploaded files with unique file names, in the proper folder
                               //BOF - Zappo - Option Types v2 - ONE LINE - Replace the posted array with the processed one.
                               $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $real_ids))+1, $real_ids);
                             }

 

The best is to merge the files manually

-------------------------------

To Fyod: Please stop to post "recommendations" to other users. It's just confusing. You are not sure what you are doing, why you are doing and you get errors after you do. It's much better to post a question

Edited by multimixer
Link to comment
Share on other sites

So I've played around with it a lot, it really is great.

Last problem I have now is that I added some Text boxes to the products, which can be filled in, everything works on the customer side, even the shopping cart shows everthing fine, but in admin when I look at the order, instead of the real text that the customer fills in, I get "CUSTOMER-INPUT".

Any way to fix this?

Link to comment
Share on other sites

Hey, hey!

So I'm having an issue with file option types where if the file extension does not match, it won't display the error and it adds the product to the shopping cart without the file option if the file does not match.

 

Where would I find the output for the error. I looked in the classes/upload.php and it's the same as the one included in the contribution.

 

I thought it might be in the application_top where the case "add_product" was but this is identical too.

 

Any suggestions where to look?

Link to comment
Share on other sites

Hey, hey!

So I'm having an issue with file option types where if the file extension does not match, it won't display the error and it adds the product to the shopping cart without the file option if the file does not match.

 

Where would I find the output for the error. I looked in the classes/upload.php and it's the same as the one included in the contribution.

 

I thought it might be in the application_top where the case "add_product" was but this is identical too.

 

Any suggestions where to look?

 

Agh, nevermind. I've done something to where I have no idea what I did and no uploads work at all.

Back to the drawing board. Time to revisit the original code meticulously again!

 

Sorry

Link to comment
Share on other sites

Hi all...great contribution!!!! My question of the day is if there is a way when you have a long listing of checkboxes or radio buttons, is there a way to split that list in half. In other words have 10 on the left and 10 on the right next to them. I hope I made my self clear and not mixing anyone up as to what I am asking. Any help would be greatly appreciated.

 

Thanks in advance.

Link to comment
Share on other sites

Hi,

 

I need to add this great contribution but I am having a little problem that I hope someone can help me with:

 

I am struggling to merge the changes into Product_info.php as there seems to be a clash with Header Tags Seo contribution.

 

When I merge as I think it should be and click on a product I get "product not found" when I use the original unchanged file I can see the new options boxes but obviously cant add to them as the Options V2 changes are not in this file.

 

My Product_info.php file looks like this:

 

<?php
/*
 $Id: product_info.php 1739 2007-12-20 00:52:16Z hpdl $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);

// Simple multi image addon	
$image_group = TINY_IMAGE_GROUP_SIZE; //Number of images to show per row/column
$vertical_format = (ADDITIONAL_IMAGE_FORMAT == 'vertical');  
$max_title_length = 40; //Set the maximm length of popup titles before they are broken into multiple lines.
$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, p.products_image_array, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
   $product_info = tep_db_fetch_array($product_info_query);
	$products_image_array = unserialize($product_info['products_image_array']);
   if (!is_array($products_image_array)) $products_image_array = array();
// EOF Simple multi image addon
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<html <?php echo HTML_PARAMS; ?>>
<head>
<?php
/*** Begin Header Tags SEO ***/
if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {
 require(DIR_WS_INCLUDES . 'header_tags.php');
} else {
?>
 <title><?php echo TITLE; ?></title>
<?php
}
/*** End Header Tags SEO ***/
?>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<script language="javascript"><!--
function popupWindow(url) {
 window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
}
//--></script>
<!-- Simple multi image addon -->
<script type="text/javascript" src="<?php echo DIR_WS_IMAGES ?>js/jquery.js"></script>
<script type="text/javascript" src="<?php echo DIR_WS_IMAGES ?>js/jquery.fancybox.js"></script>
<script type="text/javascript" src="<?php echo DIR_WS_IMAGES ?>js/jquery.easing.js"></script>
<script type="text/javascript" src="<?php echo DIR_WS_IMAGES ?>js/jquery.easydrag.handler.beta2.js"></script>
<link rel="stylesheet" href="<?php echo DIR_WS_IMAGES ?>js/fancybox.css" type="text/css" media="screen">
<script type="text/javascript">
	$(document).ready(function() {
		$("div#fancy a").fancybox({
	'zoomSpeedIn':	800, 
	'zoomSpeedOut':	700, 
	'imageScale' : true,
	'centerOnScroll': 	true,
	'hideOnContentClick' : false,
	'overlayShow':	<?php echo (DIM_BACKGROUND == 'true' ? 'true' : 'false'); ?>,
	'overlayOpacity': <?php echo (BKG_LUMA/10); ?>,
	'zoomOpacity': 	true,
	<?php if (SWING_POPUP == 'true') echo "'easingIn' : 'easeOutBack',"; ?>
	'hideOnContentClick': false

});
<?php if (DRAG_POPUP == 'true') echo '$("#fancy_outer").easydrag();'; ?>
});

</script>
<style type="text/css">
<?php if (SHOW_NAV == 'true') echo 'span#fancy_left_ico {left: 20px;}  span#fancy_right_ico {right: 20px;}';
				switch (POS_NAV) {
								case 'top':
								echo 'span.fancy_ico { top: 38px; }';
								break;
							case 'bottom':
								echo 'span.fancy_ico { bottom: 20px; }';
								break;
							default:
								echo 'span.fancy_ico { top: 50%; }';
								break;
								}		
								?>

</style>
<!-- EOF Simple multi image addon -->
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<?php /*** Begin Header Tags SEO ***/ ?>
<a name="<?php echo $header_tags_array['title']; ?>"></a>
<?php /*** End Header Tags SEO ***/ ?>

<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
   </table></td>
<!-- body_text //-->
   <td width="100%" valign="top"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
<?php
// Simple multi image addon	
 if (!tep_db_num_rows($product_info_query)) {
// EOF Simple multi image addon
?>
     <tr>
       <td><?php new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
<?php
 } else {
// Simple multi image addon	section moved

   tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");

   if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
     $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
   } else {
     $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
   }

   if (tep_not_null($product_info['products_model'])) {
     $products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>';
   } else {
     $products_name = $product_info['products_name'];
   }
?>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <?php /*** Begin Header Tags SEO ***/ ?>
           <td valign="top"><h1><?php echo $products_name; ?></h1></td>
           <td align="right" valign="top"><h1><?php echo $products_price; ?></h1></td>
           <?php /*** End Header Tags SEO ***/ ?>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td class="main">
<?php
   if (tep_not_null($product_info['products_image'])) {
?>
       <!-- Simple multi image addon -->
			 <div id="fancy">
			  <table border="0" cellspacing="0" cellpadding="2" align="right">
           <tr>
             <td align="center" class="smallText">

<?php if (strlen($product_info['products_name']) > $max_title_length) {  $title = wordwrap(htmlspecialchars($product_info['products_name']), $max_title_length, '<br>');
        } else { $title = htmlspecialchars($product_info['products_name']); } 
$m_source = ''; $thumb = (class_exists('oscthumb') && CFG_MASTER_SWITCH == 'On'); if ($thumb) { preg_match('/"([^"]+)"/',htmlentities ( tep_image(DIR_WS_IMAGES . $product_info['products_image'],'','','','','',5), ENT_NOQUOTES), $image);  $m_source=str_replace('&','&',$image[1]); }
 echo '<a  rel="image_group" title="'.$title.'" href="' . ($m_source ? $m_source : DIR_WS_IMAGES . $product_info['products_image']) . '" alt="' . $product_info['products_name'] . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"', false, 5) . '<br /></a>'; 
              if(!$vertical_format) { echo ''; $row = 1; reset($products_image_array); foreach($products_image_array as $value) { 
						 if ($thumb) {					 
						 $source = ''; preg_match('/"([^"]+)"/',htmlentities ( tep_image(DIR_WS_IMAGES . $value,'','','','','',5), ENT_NOQUOTES), $image);  $source=str_replace('&','&',$image[1]); 
						 } 
						 echo '<a  rel="image_group" title="'.$title.'" href="' . ($source ? $source : DIR_WS_IMAGES . $value) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $value, $product_info['products_name'], TINY_IMAGE_WIDTH, TINY_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'; 

							++$row; if ($row > $image_group) { echo '<br />'; $row = 1; } } } 
							echo '</td>';
						 if($vertical_format) { echo '<td>'; $row = 1; reset($products_image_array); foreach($products_image_array as $value) { 
						 if ($thumb) {					 
						 $source = ''; preg_match('/"([^"]+)"/',htmlentities ( tep_image(DIR_WS_IMAGES . $value,'','','','','',5), ENT_NOQUOTES), $image);  $source=str_replace('&','&',$image[1]); 
						 } 
						 echo '<a  rel="image_group" title="'.$title.'" href="' . ($source ? $source : DIR_WS_IMAGES . $value) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $value, $product_info['products_name'], TINY_IMAGE_WIDTH, TINY_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br />' . '</a>'; 

								++$row; if ($row > $image_group) { echo '</td><td>'; $row = 1; } } echo '</td>'; } ?>


           </tr><?php  echo '<tr><td class="smallText">' . TEXT_CLICK_TO_ENLARGE . '</td></tr>'; ?>
         </table>
				</div>
				<!-- EOF Simple multi image addon -->

<?php
   }
?>
         <p><?php echo stripslashes($product_info['products_description']); ?></p>
<?php
   $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");
   $products_attributes = tep_db_fetch_array($products_attributes_query);
   if ($products_attributes['total'] > 0) {
?>
         <table border="0" cellspacing="0" cellpadding="2">
           <tr>
             <td class="main" colspan="2"><?php echo TEXT_PRODUCT_OPTIONS; ?></td>
           </tr>
<?php
     $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");
     while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
       $products_options_array = array();
       $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");
       while ($products_options = tep_db_fetch_array($products_options_query)) {
         $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);
         if ($products_options['options_values_price'] != '0') {
           $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
         }
       }

       if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) {
         $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];
       } else {
         $selected_attribute = false;
       }
?>
           <tr>
             <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>
             <td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td>
           </tr>
<?php
     }
?>
         </table>
<?php
   }
?>
       </td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
   $reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
   $reviews = tep_db_fetch_array($reviews_query);
   if ($reviews['count'] > 0) {
?>
     <tr>
       <td class="main"><?php echo TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; ?></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
   }

   if (tep_not_null($product_info['products_url'])) {
?>
     <tr>
       <td class="main"><?php echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false)); ?></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
   }

   if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {
?>
     <tr>
       <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></td>
     </tr>
<?php
   } else {
?>
     <tr>
       <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added'])); ?></td>
     </tr>
<?php
   }
?>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td class="main"><?php //echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td>
               <?php // BOF: MOD - EASY CALL FOR PRICE v1.4
// <td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>
<?php
if ($product_info['products_price'] == CALL_FOR_PRICE_VALUE){
?>
<td class="main" align="right"><a href="javascript:history.go(-1)"><?php echo tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE); ?></a></td>
<?php
} elseif($product_info['products_price'] == FREE_VALUE){
?>
<td class="main" align="right"><a href="javascript:history.go(-1)"><?php echo tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE); ?></a></td>
<?php
} else {
?>
<td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>
<?php
}
// EOF: MOD - EASY CALL FOR PRICE v1.4 ?>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
  <!--- BEGIN Header Tags SEO Social Bookmarks -->
     <?php if (HEADER_TAGS_DISPLAY_SOCIAL_BOOKMARKS == 'true')
      include(DIR_WS_MODULES . 'header_tags_social_bookmarks.php');
     ?>
     <!--- END Header Tags SEO Social Bookmarks --> 
     <tr>
       <td>
<?php
   if ((USE_CACHE == 'true') && empty($SID)) {
     echo tep_cache_also_purchased(3600);
   } else {
     include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
   }
 }
?>
       </td>
     </tr>
  <?php /*** Begin Header Tags SEO ***/ ?>
     <tr>
      <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
      <td class="smallText" align="center"><?php echo TEXT_VIEWING; ?> 
      <?php echo '<a title="' . $header_tags_array['title'] . '" href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_info['products_id'], 'NONSSL') . '"/# ' . $header_tags_array['title'] . '">' . $header_tags_array['title']; ?></a></td>
     </tr>
     <?php /*** End Header Tags SEO ***/ ?> 
   </table></form></td>
<!-- body_text_eof //-->
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
   </table></td>
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

Many Thanks if someone can help.

Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.

Link to comment
Share on other sites

Hi,

 

With lots of help from Multimixer I now have this working on my xampp trial store.

 

Before I copy the modded files to my live store I just need a couple of bits of more help.

 

1) do I have to modify paypal IPN at all to work with this?

 

2) Is there a way to make the filling in of text fields mandatory ? ie so a customer has to fill them in before he can order?

 

3) Is there a way (or another contribution) for a customer to select a quantity to order from the products page?

 

Almost There I think.

 

Many Thanks

Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.

Link to comment
Share on other sites

Hi,

 

Sorted out No 3 above by applying Product Quantity dropdown box contribution by Sam.

 

Still need some help with 1 & 2

 

Thanks

Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.

Link to comment
Share on other sites

Hi again,

 

I have now merged the changes into the paypal IPN module - seemed to slot in quite easily, and everything seems to wotk on xampp - so fingers crossed will be uploading to my live store today.

 

Making filling in the options field mandatory can wait a while as it seems to be a bit too complex for me at the moment.

 

Thanks

Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...