Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Quotes


Jack_mcs

Recommended Posts

I definetly have all the edits, the also purchased products I had to use

 


$quotes = (defined('QUOTES_CATEGORY_NAME')) ? "  and p.quotes_email_address = '' " : '';

 

eliminating and p.customers_email_address = '' as this is not in my database appears to work fine in that any products purchased by a person show up as products also purchased but excludes the quote.

 

The issue is probably with the products listing module or something as mentioned above as when i changed the listing type bith displayed the product but the format in which they were listed changed, I am not sure where to edit it to get it to work but at least I know where the problem is now.

 

I only get this issue when i type in yourdomain.com/quotes-c-1.html gpoing back to look at my categories box to see if I have an issue there. as I would like the quotes category to show if the customer has an active quote.

 

 

Thanks again for another great mod.

 

Thanks

Getting better with mods but no programmer am I.

Link to comment
Share on other sites

  • 1 month later...
  • Replies 200
  • Created
  • Last Reply

Top Posters In This Topic

Hi First off lets say this is a great contribution does exactly what is say it should.

 

I have done several modifications to the coding to achieve what I needed and it all works great with one exception. I seemed to have knocked out the code somewhere on the quote hadler inside the admin section.

 

What I am getting is all notification e-mails are going to the same e-mail address. I can see the post change on the quote id but it does not seem to effect the send e-mail address. the code looks straight forward enough but does not work for me.

 

the code looks like this

 

else if (isset($_POST['send_email']) && substr($_POST['send_email'], "quote_") !== FALSE)

{

$customer_query = tep_db_query("select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_email_address LIKE '" . $_POST['email_address'] . "'");

$customer = tep_db_fetch_array($customer_query);

$to = $customer['customers_firstname'] . ' ' . $customer['customers_lastname'];

$to_email_address = $_POST['email_address'];

$subject = TEXT_QUOTE_READY;

$body = sprintf(TEXT_GREETING, $to) . "\n\n" . sprintf(TEXT_QUOTE_MESSAGE, HTTP_SERVER . DIR_WS_CATALOG . '/quotes.php') ."\n";

$from = STORE_OWNER;

$from_email_address = STORE_OWNER_EMAIL_ADDRESS;

 

tep_mail($to, $to_email_address, $subject, $body, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

 

$quoteID = substr($_POST['send_email'], strlen("quote_"));

tep_db_query("update " . TABLE_QUOTES . " set quote_notified = 1 where quote_id = " . $quoteID);

}

}

 

The output of $_POST is

 

action=process

ttl_quotes=4

notified=on

quote_id=44

[email protected]

send_email=quote_39

 

The send e-mail changed each time you select a different quote but the quote id and the e-mail address remain the same.

 

any ideas would be welcome

Link to comment
Share on other sites

  • 1 month later...

Hi, i hope you are well Jack_mcs!

 

Well, I'm starting with trying to make the modifications in the corresponding files from the start but then pulled me error in "product_info.php" I honestly just tried too many contributions for this method and I am a little tired of testing and that no suits my osCommerce, but hey that's not their problem ..

 

To begin using a translator jaja because my English and this is not going very well.

 

Well I started the amendments one by one in "product_info.php" and after finishing with a modification was control + R, for recharging, and until you reach this step was when I got the error:

 

------------------------------------------------------------
FIND (around line 76 in product_info.php);

 if ($product_check['total'] < 1) {

ADD ABOVE:

 /*** Begin Quotes ***/
 if ($invalidCust == 'true') {
?>
      <tr>
       <td><h1><?php echo HEADING_INVALID_CUSTOMER; ?></h1></td>
		</tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td class="main"><?php echo TEXT_INVALID_CUSTOMER; ?></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 {
 /*** End Quotes ***/
------------------------------------------------------------

 

And here's the error, which I mention to go to the web:

 

Parse error: syntax error, unexpected $end in /home/a9351687/public_html/product_info.php on line 358

 

Best of all is that only tested and I'd like to create my osCommerce with Quote ways to answer customer and then the total cost.

 

LinksWeb:

http://kachiris.net23.net/

 

Thanks for your time, and I hope your answer :)

Link to comment
Share on other sites

Well I started the amendments one by one in "product_info.php" and after finishing with a modification was control + R, for recharging, and until you reach this step was when I got the error:

 

 

Best of all is that only tested and I'd like to create my osCommerce with Quote ways to answer customer and then the total cost.

There's an included file with changes already made. You can use it, if your shop hasn't changed, or use a compare program to compare the two.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

A new version has been uploaded with these changes:

 

- Added product quantity count to the product request page.

- Added instructions for changing Sitemap SEO and All Products SEO so quotes are not displayed. If you have other such contributions, they will need to be edited also.

- Added option to request a quote page to allow selecting products from a popup.

- Added code for Version Checker (Version Checker needs to be installed separately).

- Changed request a quote page so attribute names are shown instead of attributes ID's.

- Changed code in product_info.php to a case-insensitve compare of the email addresses.

- Changed code on request a quote page so the message isn't lost on error.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

A new version has been uploaded with these changes:

 

- Added product quantity count to the product request page.

- Added instructions for changing Sitemap SEO and All Products SEO so quotes are not displayed. If you have other such contributions, they will need to be edited also.

- Added option to request a quote page to allow selecting products from a popup.

- Added code for Version Checker (Version Checker needs to be installed separately).

- Changed request a quote page so attribute names are shown instead of attributes ID's.

- Changed code in product_info.php to a case-insensitve compare of the email addresses.

- Changed code on request a quote page so the message isn't lost on error.

 

 

Hi Jack,

 

found them at the sitemap instructions at the end of the readme file.

 

also the qty, I couldnt find, from previous dealings this line was missing:- $script .= ' + " ( QTY ' . $inCartArray[$i]['quantity'] . ' )" ';

from request a quote. the attributes name worked fine, just the qtys and final price didnt add up ie two products only getting unit price not 2 x product price

 

<?php
/*
 $Id: request-a-quote.php 1739 2010-06-20
 quotes Originally Created by: Jack_mcs - http://www.oscommerce-solution.com
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce
 Portions Copyright 2009 oscommerce-solution.com

 Released under the GNU General Public License
*/

 require('includes/application_top.php');
 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_REQUEST_A_QUOTE);
 require(DIR_WS_FUNCTIONS . FILENAME_QUOTES);

 $message = '';

 if (isset($_POST['action']) && $_POST['action'] == 'process_quote')
 {
    $name = tep_db_prepare_input($_POST['name']);
    $email_address = tep_db_prepare_input($_POST['email']);
    $message = $_POST['message'];

    $error = false;      
    if (! tep_not_null($name))
    {
      $error = true;
      $messageStack->add('request_quote', ENTRY_NAME_CHECK_ERROR);
    }

    if (!tep_validate_email($email_address)) 
    {
      $error = true;
      $messageStack->add('request_quote', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
    }     

    if (! tep_not_null($message))
    {
      $error = true;
      $messageStack->add('request_quote', ENTRY_MESSAGE_CHECK_ERROR);
    }

    if (! $error)
    {     
      $quote_id = tep_db_insert_id();
      tep_db_query("insert into " . TABLE_QUOTES . " (quote_id, quote_email_address, customers_name, quote_request, date_submitted) values ('" . (int)$quote_id . "', '" . $email_address . "', '" . $name . "', '" . $message . "', now())");

      $body = sprintf(TEXT_QUOTE_EMAIL_BODY, $name, "\n\n", stripslashes($message));
      tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, TEXT_QUOTE_EMAIL_SUBJECT, $body, $name, $email_address);
      tep_redirect(tep_href_link(FILENAME_REQUEST_A_QUOTE, 'action=success'));
    }
 }

 $custArray = array();
 if (tep_session_is_registered('customer_id'))
 {
   $customer_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "' LIMIT 1");
   $customer = tep_db_fetch_array($customer_query);
   $custArray['name'] = $customer['customers_firstname'] . ' ' . $customer['customers_lastname'];
   $custArray['email'] = $customer['customers_email_address'];
 }    


 // create javascript script code to pass cart contents
 $inCartArray = $cart->get_products();  

 $script = '<script type="text/javascript"> '. "\nfunction LoadCartContents(){";
 $script .= "\n" .' var ckbox_status = document.getElementById("loadcart").checked;'; 
 $script .= "\n" .' if (ckbox_status == true) {' . "\n" . ' var lcValues = ';

 if (count($inCartArray) > 0)
 {
   for ($i = 0; $i < count($inCartArray); ++$i)
   {
      $products_query = tep_db_query("select count(*) as quote from " . TABLE_PRODUCTS . " where products_id = '" . (int)$inCartArray[$i]['id'] . "' and quotes_id = 1 LIMIT 1");
      $products = tep_db_fetch_array($products_query);
      if ($products['quote'])  //skip quotes that might be in the cart
        continue;

      $script .= '"\n\n" + ';
      $script .= '"Product: " + "' . $inCartArray[$i]['name'] . '" + "' .  ' - ID: " + "' . $inCartArray[$i]['id'] . '" + " ( ' . GetAttributeText($inCartArray[$i]['attributes'], $languages_id) . ' )"' ;
$script .= ' + " ( QTY ' .  $inCartArray[$i]['quantity'] . ' )" ';    
$script .= ' + " - Price: " + "' .  $inCartArray[$i]['final_price'] . '"' ;

      if ($i < count($inCartArray) - 1)
       $script .= ' + ';
   }
 }
 else
   $script .= '""';

 $script .= ';' . "\n" . 'var prev_contents = document.getElementById("44").value;';

 $script .= ';' . "\n" . ' document.getElementById("44").value = (prev_contents + lcValues);' . "\n" . '}' . "\n" . ' else document.getElementById("44").value = ""; }';
 $script .= "\n" . '</script>' . "\n";

 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_REQUEST_A_QUOTE));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<?php echo $script;  ?>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- 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"><table border="0" width="100%" cellspacing="0" cellpadding="0">
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
           <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_specials.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>

     <!-- BEGIN QUOTE REQUEST SUCCESS -->
     <?php if (isset($_GET['action']) && ($_GET['action'] == 'success')) {?>
     <tr>
      <td><table border="0" width="100%" cellspacing="0" cellpadding="2">      
       <tr>
        <td class="main"><?php echo TEXT_QUOTE_SENT_SUCCESS; ?></td>
       </tr>
      </table></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 { ?>      
     <!-- END QUOTE REQUEST SUCCESS -->

     <tr>
      <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
       <tr>
        <td class="main"><?php echo TEXT_INFORMATION; ?></td>
       </tr>
      </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <?php
     if ($messageStack->size('request_quote') > 0) {
     ?>
      <tr>
       <td><?php echo $messageStack->output('request_quote'); ?></td>
      </tr>
      <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
      </tr>
     <?php
     }      
     ?>  

     <!-- BEGIN QUOTE REQUEST FORM -->
     <?php echo tep_draw_form('request_quote', tep_href_link(FILENAME_REQUEST_A_QUOTE), 'post', 'onSubmit="return true;" onReset="return true"') . tep_draw_hidden_field('action', 'process_quote'); ?>
     <tr>
      <td><table border="0" width="100%" cellspacing="0" cellpadding="2">      
       <tr>
        <td class="main" width="130"><?php echo ENTRY_NAME; ?></td>
        <td class="main"><?php echo tep_draw_input_field('name', $custArray['name'], 'maxlength="75"', false); ?> </td>
       </tr>
      </table></td>
     </tr>

     <tr>
      <td><table border="0" width="100%" cellspacing="0" cellpadding="2">      
       <tr>
        <td class="main" width="130"><?php echo ENTRY_EMAIL_ADDRESS; ?></td>
        <td class="main"><?php echo tep_draw_input_field('email', $custArray['email'], 'maxlength="90"', false); ?> </td>
       </tr>      
      </table></td>
     </tr>

     <tr>
      <td><table border="0" width="100%" cellspacing="0" cellpadding="2">      
       <tr>
        <td class="main" width="130" valign="top"><?php echo ENTRY_QUOTE_MESSAGE; ?>
         <p><INPUT TYPE="checkbox" NAME="loadcart" VALUE="" id="loadcart" onClick="LoadCartContents()"><span class="smallText"><?php echo TEXT_QUOTE_FILL_FROM_CART; ?></span></p>
         <p><input type=button name=choice onClick="window.open('quotes_popup_products.php','popuppage','width=500,height=200,top=100,left=100');" value="Add a Product"></p>          
        </td>
        <td class="main"><?php echo tep_draw_textarea_field('message', 'soft', 30, $message, 'id="44"', false); ?></td>
       </tr>      
      </table></td>
     </tr>

     <tr>
      <td><table border="0" width="100%" cellspacing="1" cellpadding="2">
       <tr>
        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
        <td align="right"><?php echo tep_image_submit('button_send_quote_request.gif', IMAGE_BUTTON_REQUEST_QUOTE); ?></td>
        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
       </tr>
      </table></td>
     </tr>

     </form>    
     <?php } ?>  
     <!-- END QUOTE REQUEST FORM -->

   </table></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'); ?>

 

is my request a quote file as finished.

Edited by johnnybebad

Getting better with mods but no programmer am I.

Link to comment
Share on other sites

I am using rrs_edgio feed for google base, and whilst i can exclude the quote product in admin by switching the rss feed off, I was wondering if we could ddefault it as off as done with the google feeder, its not a major rush as this works fine as is but I can see someone somewhere getting caught out possibly.

 

code below is from the file I think would be affected:-

 

<?php 
//require_once(DIR_WS_FUNCTIONS . 'google_base_functions.php');
$googlebase=true; //enable google base
$dryrunText=GOOGLE_DRY_RUN; //whether or not execute actual upload to both or stop at file generation
if ($dryrunText=='false')$dryrun=0;
if ($dryrunText=='true')$dryrun=1;
$limit=''; 
if (GOOGLE_LIMIT_COUNT != ''){
$limit=' LIMIT '.GOOGLE_LIMIT_COUNT; //nice to limit number of posts for debug delete for production
}
//CHANGE PARAMETERS BELOW///
$feedDirectory = "../feeds/"; //"CHANGEME-full-path-to-file-with-777-dir-and-file-permissions.yahoo-outfile.txt";
$siteUrl=HTTP_CATALOG_SERVER; //Your site URL i.e. http://www.mysite.com Site URL
$feedUrl=HTTP_CATALOG_SERVER.'/feeds/'; //URL to $OutFile i.e. http://www.mysite.com/feeds/ 
$imageUrl = HTTP_CATALOG_SERVER.'/images/'; //Base URL for images i.e. http://www.mysite.com/images/
$feedTitle=STORE_NAME.' '; //Feed Title i.e. My Company Feed
$feedDescription='Products available at '.STORE_NAME; //Feed Title i.e. My Company Name
// Change to 'false' to disable the use of SEO
define('SEO_ENABLED','true');
if(SEO_ENABLED=='true'){
  $productURL = 'product_info.php';   // ***** Revised for SEO
   $productParam = "products_id=";   // ***** Added for SEO
}else{
$productUrl = HTTP_CATALOG_SERVER.'/product_info.php?products_id='; //Base url for products
}

$languageGB='en-us';
$currency=GOOGLE_BASE_CURRENCY; //ISO Currency code i.e. GBP, EUR
$locationCity=''.GOOGLE_BASE_CITY.' '; //location of the producti.e. New York
$locationState=''.GOOGLE_BASE_COUNTY.' '; //State i.e. CA 
$locationZip=''.GOOGLE_BASE_POSTCODE.' '; //ZIP
$locationCountry='GB';//COUNTRY
$ttl=60; //Time to expiration in days minimum 30 max 90
$paymentAccepted=array('Cash','Visa','MasterCard','AmericanExpress'); // these values should be the same as on google base xml feed spec
$locationAddress=''.STORE_NAME_ADDRESS.' ';

//GOOGLE SPECIFIC Settings
$destination_file = $fileGoogle;  //the upload file name specified on google base
$ftp_server = "uploads.google.com" ; //google ftp server
$ftp_user_name = GOOGLE_BASE_FTPUSER; //ftp user name
$ftp_user_pass = GOOGLE_BASE_FTPPASS; //ftp password 

//echo $ftp_user_pass.'<br>'.$ftp_user_name;
$ftp_directory = ""; // leave blank 
//***********************
// This query is required if you want to use categories names as search and grouping tags in EDGEIO.COM serach engine//select categories, the categories names will be used as tags and keywords for listings
$result=tep_db_query("SELECT * FROM categories c, categories_description cd WHERE c.categories_id = cd.categories_id");
$categories=array();
while($row = tep_db_fetch_array($result)){	
$categories[$row['categories_id']]['name']=htmlspecialchars($row['categories_name']);	$categories[$row['categories_id']]['parent']=$row['parent_id'];
}
$categorytag=array();//now find path from this category to its parent and then to root so their names can be used as tags
foreach($categories as $key=>$value){	
$end=0;	
$tags=array($value['name']);	
$nextid=$value['parent'];	
do{	 	
if($nextid!=0){			
array_push($tags,$categories[$nextid]['name']);		
$nextid=$categories[$nextid]['parent'];		
}else{		 
$end=1;		
}	
}
while($end!=1);	
$categorytag[$key]=$tags;
}												
//******************************************************
//Retrieve all product/products_description information feel free to change this
$result=tep_db_query("select * from products p, products_description pd, products_to_categories ptc where p.products_id=pd.products_id and p.products_id=ptc.products_id and p.products_quantity>0 and pd.products_description !='' and p.products_status=1");	  

if(SEO_ENABLED=='true'){
 //********************
 // Modification for SEO
 // Since the ultimate SEO was only installed on the public side, we will include our files from there.
 require_once('../includes/configure.php');
 require_once('../includes/filenames.php');
 require_once('../includes/database_tables.php');
 $languages_id = 1;   // CHANGEME - Change this to the id of your language.  BY default 1 is english


 include_once('../' .DIR_WS_CLASSES . 'seo.class.php');
 $seo_urls = new SEO_URL($languages_id);

//rewind the datasetif($googlebase){/********************BUILD GOOGLE FILE********************/
$output='<?xml version="1.0" encoding="UTF-8" ?>'."\n";
$output.='<rss version="2.0" xmlns:g="http://base.google.com/ns/1.0">'."\n";
$output.='<channel>'."\n";
$output.='<title>'.
$feedTitle.'</title>'."\n";
$output.='<description>'.$feedDescription.'</description>'."\n";
$output.='<link>'.$siteUrl.'</link>'."\n";
while($row = tep_db_fetch_array($result)){	
$descript=$row['products_description'];
//$descript=str_replace('<BR>','<BR>',$descript);
$output.='	<item>'."\n";	
$output.='		<title>'.cleanText(xmlentities(strip_tags(str_replace('&','and',$row['products_name'])))) .'</title>'."\n";	
$output.='		<description>'.cleanText(xmlentities(str_replace('&','and',$descript)))."</description>\n";	
$output.='		<link>'.tep_href_link_seo('product_info.php', 'products_id=' . $row['products_id']) .'</link>'."\n"; 	
$output.='		<g:image_link>'.$imageUrl . $row['products_image'] .'</g:image_link>'."\n";	
$output.='		<guid isPermaLink="false">'.xmlentities($siteUrl.$row['products_id']).'</guid>'."\n";	
$output.='		<g:expiration_date>'.get_iso_8601_date(time() + ($ttl * 24 * 60 * 31)).'</g:expiration_date>'."\n";
$output.='		<g:condition>new</g:condition>'."\n";		
$output.='		<g:currency>'.$currency.'</g:currency>'."\n";	
$output.='		<g:price>'.number_format($row['products_price'], 2, '.', '').'</g:price>'."\n";	
$output.='		<g:upc>'.$row['products_model'].'</g:upc>'."\n";	
$output.='		<g:quantity>'.$row['products_quantity'].'</g:quantity>'."\n";	
foreach($paymentAccepted as $key=>$value){		
$output.='		<g:payment_accepted>'.$value.'</g:payment_accepted>'."\n";		
}	
$output.='		<g:location>'.xmlentities($locationCity.','.$locationState.','.$locationZip.','.$locationCountry).'</g:location>'."\n"; 
$output.='	</item>'."\n";}
$output.='</channel>'."\n";
$output.='</rss>'."\n";
if ( file_exists( $feedDirectory.$fileGoogle ) )unlink( $feedDirectory.$fileGoogle );
$fp = @fopen( $feedDirectory.$fileGoogle , "w" );
$fout = @fwrite( $fp , $output );
@fclose( $fp );
if(!$dryrun){  
$result=ftp_file( $ftp_server, $ftp_user_name, $ftp_user_pass, $feedDirectory.$fileGoogle, $ftp_directory, $destination_file, $fileGoogle );
if ($result==true)
echo "We have created and uploaded to Google Base $fileGoogle  file<br>";
}else{
if ($result==true) echo "You are currently on a dry run so $fileGoogle file has <b><u><i>NOT</i></u></b> uploaded to Google Base <br>";
}
} 

/********************************************THE END FOLKS*******************************************/


function canonical_url($url){  
$url = trim($url);  
if (substr($url,0,7)!="http://") $url = "http://".$url;    
$u = @parse_url($url);    
if (!$u) return "";    
if (!$u['path'] && !$u['query'] && !$u['fragment']) $url .= "/";    
return $url;
}
//Start FTP to Google Base
function ftp_file( $ftpservername, $ftpusername, $ftppassword, $ftpsourcefile, $ftpdirectory, $ftpdestinationfile, $fileGoogle ){	
// set up basic connection	
$conn_id = ftp_connect($ftpservername);	
if ( $conn_id == false )	
{	
echo "FTP open connection failed to $ftpservername <BR>Please try again in 15 minutes.\n" ;	
exit;
}		
// login with username and password	
$login_result = @ftp_login($conn_id, $ftpusername, $ftppassword);		
// check connection	
if ((!$conn_id) || (!$login_result)) {
echo "FTP connection has failed!<BR>\n";	
echo "Attempted to connect to " . $ftpservername . " for user " . $ftpusername . "<BR>\n";	
return false;	
} else {	
echo "Connected to " . $ftpservername . ", for user " . $ftpusername . "<BR>\n";	
}		
if ( strlen( $ftpdirectory ) > 0 )	{	
if (ftp_chdir($conn_id, $ftpdirectory )) {	
echo "Current directory is now: " . ftp_pwd($conn_id) . "<BR>\n";	
} else {	
echo "Couldn't change directory on $ftpservername<BR>\n";	
return false;	
}	
}
ftp_pasv ( $conn_id, true ) ;	// upload the file	
$upload = @ftp_put( $conn_id, $ftpdestinationfile, $ftpsourcefile, FTP_ASCII );		// check upload status	
if (!$upload) {	
echo "$ftpservername: FTP upload has failed to upload $fileGoogle - please resubmit!<BR>\n";	
return false;	
}
ftp_close($conn_id);	
return true;
}
function get_iso_8601_date($int_date) {   
//$int_date: current date in UNIX timestamp   
$date_mod = date('Y-m-d\TH:i:s', $int_date);   
$pre_timezone = date('O', $int_date);   
$time_zone = substr($pre_timezone, 0, 3).":".substr($pre_timezone, 3, 2);   
$date_mod .= $time_zone;   
return $date_mod;
}
function xmlentities($string) {   
return str_replace ( array ( '&', '"', "'", '<', '>', '?' , '©' ), array ( '&' , '"', ''' , '<' , '>', ''', '©' ), $string );
}
function cleanText($text)
{
// strip all non alphanum or -
$clean = utf8_encode(ereg_replace('/[^A-Za-z0-9\s\s+]/', '', utf8_decode($text)));
$clean = str_replace('Â','',$clean);
return $clean;
}	 
function tep_href_link_seo($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) {
    global $seo_urls;
    return $seo_urls->href_link($page, $parameters, $connection, $add_session_id);
 }
?>

Getting better with mods but no programmer am I.

Link to comment
Share on other sites

  • 1 month later...

I understand that only the products in quote category will have quotes activated on them. Is there a way of making this module work across all the categories?

The quotes category is just for displaying quotes. You can request a quote from any category.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

The quotes category is just for displaying quotes. You can request a quote from any category.

 

How can I make the quote category invisible?

 

The quote button does not appear on the products page at all? I installed it according to the instructions in version 1.2. I did get confused with some modifications due to using "Simple Multiple Images (Unlimited) with Fancy Popups V1.3.5" modification (and there being some conflicts with the modified lines of code), but no errors.

 

Could you tell me in a bit more detail how to make a product quote-able? From the end of the file modification (if that makes sense) because I have perhaps gone wrong somewhere.

 

Thank you so much.

 

p.s. Awesome mod! Can I donate at all?

Edited by stefandunn
Link to comment
Share on other sites

How can I make the quote category invisible?

It should not be visible as default. Be sure the name fo the quote category, which can be anything, exactly matches the setting in admin->Configuraiton->Quotes.

 

The quote button does not appear on the products page at all? I installed it according to the instructions in version 1.2. I did get confused with some modifications due to using "Simple Multiple Images (Unlimited) with Fancy Popups V1.3.5" modification (and there being some conflicts with the modified lines of code), but no errors.

That's correct. It shouldn't.

 

Could you tell me in a bit more detail how to make a product quote-able? From the end of the file modification (if that makes sense) because I have perhaps gone wrong somewhere.

A quote can be requested for any product. Clcik on the quote link and the the request a quote link (probably should be a direct link) and then add a product.

 

Thank you so much.

 

p.s. Awesome mod! Can I donate at all?

If you would like to donate, please do so here.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

It should not be visible as default. Be sure the name fo the quote category, which can be anything, exactly matches the setting in admin->Configuraiton->Quotes.That's correct. It shouldn't.A quote can be requested for any product. Clcik on the quote link and the the request a quote link (probably should be a direct link) and then add a product.

If you would like to donate, please do so here.

 

I have ensured the category matches the setting in admin->configuration->quotes and it's still visible.

 

I have a template which doesn't show the information box, how can I implement it elsewhere?

 

Is there a demonstration anywhere?

Link to comment
Share on other sites

I have ensured the category matches the setting in admin->configuration->quotes and it's still visible.

 

I have a template which doesn't show the information box, how can I implement it elsewhere?

 

Is there a demonstration anywhere?

The only thing that prevents the quotes category from displaying is the code that is added to the categoryies infobox. If you have added that code and the name is correct in admin, the only other thing I can think of that might prevent it from working correctly is if you have cache enabled. If so, try turning that off and refreshing your home page.

 

You'll need to add a link somewhere else on the page. The code for the link is in the package. You will need to figure out how to add it somewhere else.

 

I use it on my shop.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

I am now getting this error when submitting a quote:

 

"Warning: Cannot modify header information - headers already sent by (output started at /var/www/domains/wireitfree.co.uk/docs/shop_online/includes/functions/quotes.php:32) in /var/www/domains/wireitfree.co.uk/docs/shop_online/includes/functions/general.php on line 29"

 

How can I fix this?

Link to comment
Share on other sites

I am now getting this error when submitting a quote:

 

"Warning: Cannot modify header information - headers already sent by (output started at /var/www/domains/wireitfree.co.uk/docs/shop_online/includes/functions/quotes.php:32) in /var/www/domains/wireitfree.co.uk/docs/shop_online/includes/functions/general.php on line 29"

 

How can I fix this?

See the link in my signature for that problem.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

The link is redirecting me elsewhere which doesn't provide the information i need, sorry.

Please try it again. The layout of the page was changed which caused the wrong page to display. It should work now.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 2 weeks later...

Everything is installed correctly, except that new quotes, when created as products are instantly set to "Paid" even before I have notified the customer or anything. It's as if it's inserting the product as "paid" when created. Which file should I look at and which database tables are used to control this?

 

Thanks

Link to comment
Share on other sites

Everything is installed correctly, except that new quotes, when created as products are instantly set to "Paid" even before I have notified the customer or anything. It's as if it's inserting the product as "paid" when created. Which file should I look at and which database tables are used to control this?

Check the actual quote (product) in admin.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Hi Jack,

 

I wonder if you could possibly give me your view on the following:

 

I have been looking for some time for a way to raise an order into a customers account that allows him to log-into the site and go through the normal checkout process to pay. (see my post on the general forum) Here also looking for the ability to "tweek" the price of the items in his cart.

 

The quotes contribution seems to be 80% of what I am looking for. How difficult do you think it would be to allow this contribution to also be initiated directly from admin without a customer first requesting a quote?

 

What Im looking to do is to in effect raise an invoice on a customer for products at a given price, put them in his basket (or somewhere he can access to pay) then allow the OSC checkout process to take over to process the order and record the sale etc.

 

Sorry if off topic a bit.

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

I wonder if you could possibly give me your view on the following:

 

I have been looking for some time for a way to raise an order into a customers account that allows him to log-into the site and go through the normal checkout process to pay. (see my post on the general forum) Here also looking for the ability to "tweek" the price of the items in his cart.

 

The quotes contribution seems to be 80% of what I am looking for. How difficult do you think it would be to allow this contribution to also be initiated directly from admin without a customer first requesting a quote?

 

What Im looking to do is to in effect raise an invoice on a customer for products at a given price, put them in his basket (or somewhere he can access to pay) then allow the OSC checkout process to take over to process the order and record the sale etc.

I read that thread but don't understand the problem so I can't comment on it. But your last statement above sounds like what this contribution does except for processing the order, I think. If that is the problem, you can't do that, unless you keep creadit card numbers, I suppose. The closest you can come is to have a subscription setup for the customer, which probably creates more work than having them create a new order. But this isn't a subject for this thread so please move the discussion to the appropriate place.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 3 weeks later...

as was mentioned earlier - I am also having a problem with the delete button.

 

Fresh install of oscommerce v2.2 RC2

dropped in all the code changes from Quotes_V_1.2.zip

I coppied and pasted the text quotes.sql into phpmyadim 'run sql' window. <- could have this caused problems instead of importing the text file though 'import'?

 

I put stuff in my cart - press quote - coppy stuff form cart - enter name and email address - send request.

goto admin - click on quotes - quote is there. press delete - screen refreshes and quote is still there.

 

I tried some of the code changes from previous posts - nothing seems to work.

 

thanks for all your work!

sam

Link to comment
Share on other sites

Ok - the plot thickens... ;) Heh he he

 

The computer I was using has windows XP with IE8 (ver8.0.6001.18702)

 

I powered up my laptop with lucid running firefox 3.6.8 and the delete button works :)

 

Odd - maybe sheds some light on it?

 

thanks agian!

sam

Link to comment
Share on other sites

I put stuff in my cart - press quote - coppy stuff form cart - enter name and email address - send request.

goto admin - click on quotes - quote is there. press delete - screen refreshes and quote is still there.

 

I tried some of the code changes from previous posts - nothing seems to work.

You could try using the included categories file to see if the delete works with it.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

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...