Jump to content

Recommended Posts

This contribution allows visitors to request a quote from the shop. The shop owner will be notified by email and can view the quote request in admin. A custom quote can then be added via the products section and the quote will appear on the site in that customers quote section. It can then be ordered as a regular product by the customer. The quotes are only visible to the customer they are meant for and the shop owner.

 

Jack

Edited by Jack_mcs

Share this post


Link to post
Share on other sites

Jack,

 

(Limited feedback)

 

Very interesting contribution - I've spend all about 10 minutes installing this on a heavily modified OSC 2.2a installation and it works almost flawless. At least all the functionality is in place from the customers end.

 

The customer is able to request a quote on a single product (not what's actually in the shopping cart). After an admin creates the quote it is available for the customer to see and he/she is able to proceed through the whole checkout process. Great!

 

(First impressions)

Some things I have not seen happen yet (and I must admit I have not gone through every line of code from the admin side yet):

 

1. the customer does not get notified when a quote has been created (not even sure if that is an option; if not, I can add that easily if required)

2. multiple products can not be added to the quote yet (again, should not be an issue for us either)

3. you have some kickass contributions and you are a great asset to the OSC community!

 

If I find anything else to add (codewise or comments) I will send them your way for your perusal.

 

 

-Wlad.

Share this post


Link to post
Share on other sites

1 - The customer notification isn't automatic. The only way to do that would be to add that when the product is created but if you are like me, I usually need to edit a product at least once and that would create a problem. If you go to the admin->Quotes page after the product has been created, there is a radio button there that, when clicked, will send an email to the customer letting them know their quote if ready.

 

2 - The option on the request a quote page will add all of the items in the shop cart when clicked. The quote message isn't remembered if the person goes to another page since it doesn't require a login. I thought about making it remembered but that begins to overly complicate the code and thought it best to see what happens in real shops first.

 

3 - Thanks for the feedback and kind words.

 

Jack

Share this post


Link to post
Share on other sites

In regards to the customer notification, I think that's probably a good option to not have it send out automatically. I just did not see an option from the front-end on where that could be done. At least on my side (unless my browser isn't handling it right) the notification parts are not functional. I'm not too worried about it as it's probably just a minor tweak.

 

This is what I've done so far - I'll send it to you first and you can decide if you want to add it to your package.

 

From the admin side: when an admin creates the quote it prepopulates the necessary fields in the quote (new product sku, old price, description(s) etc). I still have clean out some of my code as it includes over 30 different fields per product listing in use by this specific OSC implementation and I have no clue what the original categories.php file was like. I guess it would be easier for redistribution and compatibility if I used a pristine installation. If only I had an extra 4 hours per day :(

 

Now that I think about it, the change I made above will only work for 1 (unique) product - Right now it only populates the quote with the first product from the list so my change is pretty much useless for multples (1 blue widget, 1 green widget and 1 red widget). Was your vision of the quote (admin side) to function as a package deal in the case of multiple products?

 

Anyway, that's one of the changes I made so far.

Edited by foodawgmi

Share this post


Link to post
Share on other sites

There should only be one product in admin per quote. If someone asks for a quote on 3 blue widgets and 9 red ones, then there would be one product covereing the cost of all 12 widgets. If the same cusotmer then requests a quote for 7 black widgets, that would be another product since it is a different quote request.

 

Jack

Share this post


Link to post
Share on other sites
There should only be one product in admin per quote. If someone asks for a quote on 3 blue widgets and 9 red ones, then there would be one product covereing the cost of all 12 widgets. If the same cusotmer then requests a quote for 7 black widgets, that would be another product since it is a different quote request.

 

Jack

 

You're right. I think I'll just leave off my additions This contribution works best as is. Since I put it up on a live store (early this morning), and within 6 hours we've had a little over 13 quote requests and only 2 of them included 2 products or more and everything went fine. Right now I'm only making the quote option visible to users with a certain amount of purchases over a specific dollar amount. With some more testing I'll open it up to the general public.

Share this post


Link to post
Share on other sites

Nice Add-on Jack I have it installed. I just have one problem that could take me sometime to find why it is. on the admin page in the tools/quotes page I have this on top

Array

(

)

I will have to do some looking to see where those are coming from or what is not closed off anymore. I am hoping because it is in the admin section that will give me a clue.

Pat

Share this post


Link to post
Share on other sites

That's debug code I forgot to remove. To fix it, edit the admin/quotes.php file and delete these lines

  ?> <pre> <?php
print_r($_POST);
?> </pre> <?php

 

Jack

Share this post


Link to post
Share on other sites

Yet another useful contribution from you Jack! Thank You!

 

In catalog/request-a-quote.php where the javascript begins the code reads at line 88:

 

$script .= "\n" .' if (ckbox_status == true) {' . "\n" . ' var lcValues = ';

 

Perhaps it would rather be:

 

$script .= "\n" .' if (ckbox_status == true) {' . "\n" . ' var lcValues = ""';

Share this post


Link to post
Share on other sites

Hi there Jack, If I develope a form and attempt to do the php and sql to go with it would you help me integrate it with this add-on. I am learning PHP and SQL so it will be a challenge. I have a shop that does screen printing among other things. customers need to be able to request a quote but they need to be able to input colors, manufaturers for t-shirts and also ink colors they will also need to be able to upload graphics for their quote. I think I can do most I just dont know how to integrate it with oscommerce and quotes.

Pat

Share this post


Link to post
Share on other sites

No, I'm sorry, but that would require far to much time for free support.

 

Jack

Share this post


Link to post
Share on other sites

Hi Jack

 

Thanks for a great contribution.

 

All appears to be working except the radio button to notify the customer is greyed out, the quote is available to the customer on the front end, but unfortunately I have no way of notifying them.

 

Any Ideas ?

 

Mick.

Share this post


Link to post
Share on other sites
Hi Jack

 

Thanks for a great contribution.

 

All appears to be working except the radio button to notify the customer is greyed out, the quote is available to the customer on the front end, but unfortunately I have no way of notifying them.

 

Any Ideas ?

 

Mick.

 

Hi MickA

 

In admin/quotes.php look for two instances of the word disabled (around line 170) and change to enabled. That's what I did when I tested this contribution, then you'll be able to use the notify function.

Share this post


Link to post
Share on other sites
Hi MickA

 

In admin/quotes.php look for two instances of the word disabled (around line 170) and change to enabled. That's what I did when I tested this contribution, then you'll be able to use the notify function.

 

Thanks Jack That worked.

Share this post


Link to post
Share on other sites

While I'm at it. I tested with IE yesterday and got two error messages. Now I have viewed the same through firebug and the information is a bit more elaborated. When I load the page catalog/request-a-quote.php, firebug says:

syntax error

var lcValues = ;\n line 16

 

And if I tick the check box while not logged in, this error is thrown:

url.substr is not a function LoadCartContents(); line 2

 

I'd like to get rid of these errors or maybe suppress/hide them from showing.

Share this post


Link to post
Share on other sites
While I'm at it. I tested with IE yesterday and got two error messages. Now I have viewed the same through firebug and the information is a bit more elaborated. When I load the page catalog/request-a-quote.php, firebug says:

 

And if I tick the check box while not logged in, this error is thrown:

 

I'd like to get rid of these errors or maybe suppress/hide them from showing.

For the first eror, in request-a-quote.php find this code

  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 .= '"ID: " + "' . $inCartArray[$i]['id'] . '" + "\nName: " + "' .  $inCartArray[$i]['name'] . '"';
 $script .= ' + "\nPrice: " + "' .  $inCartArray[$i]['final_price'] . '"';

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

and replace it with this

  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 .= '"ID: " + "' . $inCartArray[$i]['id'] . '" + "\nName: " + "' .  $inCartArray[$i]['name'] . '"';
   $script .= ' + "\nPrice: " + "' .  $inCartArray[$i]['final_price'] . '"';

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

I am not seeing the second error and don't see anything wrong with the code so I don't have a fix for that problem.

 

Jack

Share this post


Link to post
Share on other sites

Thank you, Jack! It worked and apparently took care of the second error also, at least it is gone now!

Share this post


Link to post
Share on other sites

Hi Jack,

 

In filenames there's a file name that references a file called quotes-closed.php. I can't seem to find it in the contribution package. Could you please provide this file as well?

 

I've played with the contribution a bit and it seems to function well, which is no surprise!

 

However I got an impulse to enter a non-existing product_id in product_info.php. In the browser it looks like this: http://www.mydomain.com/fanny-p-92.html which shows the product Fanny in a perfect rendered page. If I change the id to let's say 929 instead of 92 it makes havok with the page's layout.

 

These modules/texts appears, which they shoudn't

  • product_tabs.php (module)
  • TEXT_WHY_CHOOSE_OUR_COMPANY (well, the corresponding defined text, that is!)
  • TEXT_NO_YOUTUBE_VIDEO_AVAILABLE
  • TEXT_DATE_ADDED
  • products_in_category.php (module)
  • FILENAME_PRODUCT_SPECIALS (module)

I can see that the contribution plays with an if statement and the customers e-mail address in order to hide or show things, i.e:

 

	  <?php
			  /*** Begin Quotes ***/
			   if (! tep_not_null($customers['customers_email_address'])) {
			  ?>
 some code

 <?php
			   }
			  /*** End Quotes ***/
			  ?>

 

Would you mind give a few hints on how to go about the unwanted list I mentioned above?

 

(Btw I tested with the product_info.php from the package and with that file all works, the same goes for my product_info.php prior to the modifications from this contribution, so it boils down to handle the listed stuff above.)

 

Best Regards!

kbking

Edited by kbking

Share this post


Link to post
Share on other sites

The quotes_closed file was in a previous version but was removed in this one since the quotes page allows switching. I just forgot to remove that entry.

 

This contribution doesn't have anything to do without how the normal code works so the problems you see when changing the products ID has to do with your shop.

 

Please feel free to provide whaever suggestions you like.

 

Jack

Share this post


Link to post
Share on other sites

This may be a stupid question but should there not be a form or something for a customer to fill out when requesting a quote? All i get when I click on the quote category is there are no products to list in this category. How do customers know what products they can get a quote from. I can add products like normal but it asks me for price date available and date quote ends. Are there any directions on how to use this fine add-on?

Pat

Share this post


Link to post
Share on other sites

When you click on Quoes, it takes you to a page that has this text on it

To request a Quote, please click here.

 

Jack

Share this post


Link to post
Share on other sites

That is something I am missing then. I am not taken to that page. I will check the install to see if I forgot something. The only thing different that the regular install was the mod. you made due to the HTC add-on I also have. I will let you know after I redo the install

Pat

Share this post


Link to post
Share on other sites

Jack this line in includes/boxes/information.php /*** Begin Quotes ***/

'<a href="' . tep_href_link(FILENAME_QUOTES) . '">' . BOX_INFORMATION_QUOTES . '</a>');;

/*** End Quotes ***/

is that suppose to end with two semi colons:

Share this post


Link to post
Share on other sites
That is something I am missing then. I am not taken to that page.

That line of text is part of one of the included files so I can't see how it isn't there. If it is there and just isn't working, then the definition for the file may be missing.

 

is that suppose to end with two semi colons:

No, but it shouldn't cause any problems.

 

Jack

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×