Jump to content


Corporate Sponsors


Latest News: (loading..)

* * * * * 1 votes

Get 1 Free


345 replies to this topic

#81 thedream

  • Community Member
  • 64 posts
  • Real Name:Marc-André
  • Location:The Barbades

Posted 09 November 2007, 18:14

Thanks for replying. I set always 100 on the maximum free products, even if I have 35 products on stock.
Any ideas?
osCommerce 2.2 MS2 in 6 languages
TVA Intracomm
Numbers of visitors online
Who's online Enhancement
....

#82 Roaddoctor

  • Community Member
  • 643 posts
  • Real Name:David Jennings
  • Gender:Not Telling
  • Location:Texas

Posted 09 November 2007, 18:25

View Postkymation, on Nov 9 2007, 12:06 PM, said:

What do you have Maximum Free Products set to? This would be the expected behavior if it is set to 1. See the use.txt file in the distribution for more information.

Regards
Jim
oops sorry Jim, i answered too quick without looking
-Dave

#83 gregy

  • Community Member
  • 678 posts
  • Real Name:Gregor
  • Gender:Male
  • Location:Slovenia, Celje

Posted 09 November 2007, 18:48

View Postkymation, on Nov 9 2007, 06:47 PM, said:

Different version of MySQL or phpMyAdmin? I tested this using a couple different versions, but you may have something else, or some setting is different. Try running it without the part in quotes in the error message. Those should be default settings anyway.

Regards
Jim

no way i can pass that error :(

phpmyadmin 2.6.1
mysql 3.23

#84 kymation

  • Community Sponsor
  • 5,658 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 10 November 2007, 00:33

View Postgregy, on Nov 9 2007, 11:48 AM, said:

no way i can pass that error :(

phpmyadmin 2.6.1
mysql 3.23
I didn't test with anything older than 4.2.x, so that could be the problem. Try creating the table with phpMyAdmin using the SQL in the distribution for the column specs. That should work for any version.

Regards
Jim
My Addons

Banners Box 2.3.1 Support
Categories Accordion Box 2.3.1 Support
Categories Images Box 2.2x 2.3.1 Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box 2.3.1 Support
Get 1 Free 2.2x Support
Include HTML and Text Boxes 2.2x
jQuery Banner Rotator 2.2x 2.3.1 Support
Modular Front Page 2.3.1 Support
Modular SEO Header Tags 2.3.1 Support
More Pics 2.2x Support
MVS 2.2x Support
osC Catalog 2.2x Support
PDF Datasheet 2.3.1 Support
Price Updater 2.2x
Products Specifications 2.2x 2.3.1 Development Version Support Bugs/Suggestions
Request a Review 2.2x - 2.3.1 Support
Similar Products Box 2.2x
Theme Switcher 2.3.1 Support

#85 thedream

  • Community Member
  • 64 posts
  • Real Name:Marc-André
  • Location:The Barbades

Posted 11 November 2007, 14:47

Hi Jim.

My purpose is just to answer to my clients who don't understand why the don't have the ratio of the free product ordered, as the logical: for example I order 2 I get 1 free, I order 4, I get 2 free, etc. There is a ratio thing. For the moment if they order 2, 3, 4 or more they get only 1. They don't understand.
So I am trying to respect your code as "buy x get y free", but if you order 3 x, you wil get 3 more free products...
I have made the following changes:
$output = array ( 'id' => $get_1_free['products_free_id'],
							  //'quantity' => $free_quantity,
							  'quantity' => floor($products_quantity*($get_1_free['products_free_quantity']/$get_1_free['products_qualify_quantity'])),
							  'name' => $products_free['products_name'],
							  'model' => $products_free['products_model'],
							  'image' => $products_free['products_image'],
							  //'weight' => $products_free['products_weight']
							  'weight' => $products_free['products_weight']*floor($products_quantity*($get_1_free['products_free_quantity']/$get_1_free['products_qualify_quantity']))
							);
It's working, except for one thing. when you do an update of the quantity on the products qualified for the free product, a new free product with its normal price is added to the cart, and I don't know how to correct this.
This code take the entire part of the ration with the setup made in the Get 1 free admin. With the ability to have:
buy 1 get 0 free,
buy 2 get 1 free (the ratio),
buy 3 get 1 free,
buy 4 get 2 free (a multiple of the ratio [qty*(qty free/Qty qualified)],
etc...

Am I wrong or not? We just have to find how to correct the resulting bug.
osCommerce 2.2 MS2 in 6 languages
TVA Intracomm
Numbers of visitors online
Who's online Enhancement
....

#86 kymation

  • Community Sponsor
  • 5,658 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 11 November 2007, 18:20

I don't see the reason for this change. The original version works fine on several different stores. Please go to Admin > Catalog > Get 1 Free, click the Edit button for your product, then copy all of the settings into a post here.

The update bug is well known. Unfortunately I don't have a fix that doesn't involve rewriting most of this contribution. My regular work has been keeping me too busy to do more than plan out this major revision.

Regards
Jim
My Addons

Banners Box 2.3.1 Support
Categories Accordion Box 2.3.1 Support
Categories Images Box 2.2x 2.3.1 Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box 2.3.1 Support
Get 1 Free 2.2x Support
Include HTML and Text Boxes 2.2x
jQuery Banner Rotator 2.2x 2.3.1 Support
Modular Front Page 2.3.1 Support
Modular SEO Header Tags 2.3.1 Support
More Pics 2.2x Support
MVS 2.2x Support
osC Catalog 2.2x Support
PDF Datasheet 2.3.1 Support
Price Updater 2.2x
Products Specifications 2.2x 2.3.1 Development Version Support Bugs/Suggestions
Request a Review 2.2x - 2.3.1 Support
Similar Products Box 2.2x
Theme Switcher 2.3.1 Support

#87 Jesse J

  • Community Member
  • 46 posts
  • Real Name:Mad Thinker

Posted 13 November 2007, 02:04

Hi Jim,
Can you clarify the feature set on your mod for me?

I have a client who sells greeting cards, and his goal is Buy any 5 cards get 1 free. Can it work for buy X number of any of the selected products? or is it only buy x # of this item get 1 free.

Furthermore is it possible to give the customer a choice of the free product?

Thanks! :thumbsup:

#88 kymation

  • Community Sponsor
  • 5,658 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 13 November 2007, 03:38

View PostJesse J, on Nov 12 2007, 07:04 PM, said:

Hi Jim,
Can you clarify the feature set on your mod for me?

I have a client who sells greeting cards, and his goal is Buy any 5 cards get 1 free. Can it work for buy X number of any of the selected products? or is it only buy x # of this item get 1 free.

Furthermore is it possible to give the customer a choice of the free product?

Thanks! :thumbsup:
Sorry, but no to both questions. There is at least one contribution that allows you to select a free product if the cart total is over a certain amount, but none that I know of based on quantity. Perhaps the one I linked to could be modified to do what you want.

Regards
Jim
My Addons

Banners Box 2.3.1 Support
Categories Accordion Box 2.3.1 Support
Categories Images Box 2.2x 2.3.1 Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box 2.3.1 Support
Get 1 Free 2.2x Support
Include HTML and Text Boxes 2.2x
jQuery Banner Rotator 2.2x 2.3.1 Support
Modular Front Page 2.3.1 Support
Modular SEO Header Tags 2.3.1 Support
More Pics 2.2x Support
MVS 2.2x Support
osC Catalog 2.2x Support
PDF Datasheet 2.3.1 Support
Price Updater 2.2x
Products Specifications 2.2x 2.3.1 Development Version Support Bugs/Suggestions
Request a Review 2.2x - 2.3.1 Support
Similar Products Box 2.2x
Theme Switcher 2.3.1 Support

#89 thedream

  • Community Member
  • 64 posts
  • Real Name:Marc-André
  • Location:The Barbades

Posted 13 November 2007, 07:54

Here is the page for a product.

Product:   	Anneau
Quantity to Qualify:	  2
Maximum Free Products:	  100
Free Product:	  Anneau 2
Free Product Quantity:	  1
Expiry Date:	  Calendar

The dream
osCommerce 2.2 MS2 in 6 languages
TVA Intracomm
Numbers of visitors online
Who's online Enhancement
....

#90 Jesse J

  • Community Member
  • 46 posts
  • Real Name:Mad Thinker

Posted 13 November 2007, 16:00

Thanks a lot guys.. this isn't quite what the client is looking for but I will offer it.

#91 kymation

  • Community Sponsor
  • 5,658 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 13 November 2007, 16:42

View Postthedream, on Nov 13 2007, 12:54 AM, said:

Here is the page for a product.

Product:   	Anneau
Quantity to Qualify:	  2
Maximum Free Products:	  100
Free Product:	  Anneau 2
Free Product Quantity:	  1
Expiry Date:	  Calendar

The dream
That should work without any modification. Oh well, if it does what you want, then make the changes that you posted.

Regards
Jim
My Addons

Banners Box 2.3.1 Support
Categories Accordion Box 2.3.1 Support
Categories Images Box 2.2x 2.3.1 Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box 2.3.1 Support
Get 1 Free 2.2x Support
Include HTML and Text Boxes 2.2x
jQuery Banner Rotator 2.2x 2.3.1 Support
Modular Front Page 2.3.1 Support
Modular SEO Header Tags 2.3.1 Support
More Pics 2.2x Support
MVS 2.2x Support
osC Catalog 2.2x Support
PDF Datasheet 2.3.1 Support
Price Updater 2.2x
Products Specifications 2.2x 2.3.1 Development Version Support Bugs/Suggestions
Request a Review 2.2x - 2.3.1 Support
Similar Products Box 2.2x
Theme Switcher 2.3.1 Support

#92 someone_else

  • Community Member
  • 1 posts
  • Real Name:michael

Posted 14 November 2007, 08:11

Hello Jim,

can you tell me please which version to install?

Actually i dont know what version will work in the way it should so maybe a hint of the inventor woul be nice for me to find out.

Thank you very much.
Michael

#93 kymation

  • Community Sponsor
  • 5,658 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 14 November 2007, 17:48

View Postsomeone_else, on Nov 14 2007, 01:11 AM, said:

Hello Jim,

can you tell me please which version to install?

Actually i dont know what version will work in the way it should so maybe a hint of the inventor woul be nice for me to find out.

Thank you very much.
Michael
1.2a is the best currently available. There is a known bug (which is discussed above) but most people consider it usable as is. It's up to you whether it is acceptable to you. The bug is not likely to get fixed until I have time for a complete rewrite.

Regards
Jim
My Addons

Banners Box 2.3.1 Support
Categories Accordion Box 2.3.1 Support
Categories Images Box 2.2x 2.3.1 Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box 2.3.1 Support
Get 1 Free 2.2x Support
Include HTML and Text Boxes 2.2x
jQuery Banner Rotator 2.2x 2.3.1 Support
Modular Front Page 2.3.1 Support
Modular SEO Header Tags 2.3.1 Support
More Pics 2.2x Support
MVS 2.2x Support
osC Catalog 2.2x Support
PDF Datasheet 2.3.1 Support
Price Updater 2.2x
Products Specifications 2.2x 2.3.1 Development Version Support Bugs/Suggestions
Request a Review 2.2x - 2.3.1 Support
Similar Products Box 2.2x
Theme Switcher 2.3.1 Support

#94 atti

  • Community Member
  • 3 posts
  • Real Name:atti

Posted 19 November 2007, 11:40

View Postkymation, on Nov 14 2007, 08:48 PM, said:

1.2a is the best currently available. There is a known bug (which is discussed above) but most people consider it usable as is. It's up to you whether it is acceptable to you. The bug is not likely to get fixed until I have time for a complete rewrite.

Regards
Jim

Hello!

Regarding this bug, I've notes it that when the free products's products_status = 0 then it works well. It doesn't exists a 'quick fix' for this problem, only the whole rewriting? I assume that when updating the shopping cart, there is a check for products_status. At that point could be a check as well if it's a free product (let's say that put an extra info to the shopping cart product, to know that it's about a free product).

Thx.

#95 atti

  • Community Member
  • 3 posts
  • Real Name:atti

Posted 19 November 2007, 13:11

View Postkymation, on Mar 31 2007, 06:02 AM, said:

Yes, that's a bug. I've been looking for a solution but I don't have much time to work on this right now. It's definitely on the bug list though.

Regards
Jim


Hi there!

Here's a quick fix for the "added again the free product but with full price" problem:

There are small modification in 3 files, highlited in red.


classes/shopping_cart.php, function get_products()


// Get 1 free
if (is_array ($free_product = $this->get1free ($products_id))) {
// Add the free product to the shopping cart (Customer cannot alter this)
$products_array[] = array('id' => $free_product['id'],
'name' => $free_product['name'],
'model' => $free_product['model'],
'image' => $free_product['image'],
'price' => 0,
'quantity' => $free_product['quantity'],
'weight' => $free_product['weight'],
'final_price' => 0,
'tax_class_id' => $products['products_tax_class_id'],
'attributes' => '',
'free' => 1
);
} //if (is_array
// end Get 1 free


--------------------------------------------------------------------------------------------------
shopping_cart.php

$info_box_contents[$cur_row][] = array('params' => 'class="productListing-data"',
'text' => $products_name);

$info_box_contents[$cur_row][] = array('align' => 'center',
'params' => 'class="productListing-data" valign="top"',
'text' => tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4"') . tep_draw_hidden_field('products_id[]', $products[$i]['id']) . tep_draw_hidden_field('free[]', $products[$i]['free']) );

$info_box_contents[$cur_row][] = array('align' => 'right',
'params' => 'class="productListing-data" valign="top"',
'text' => '<b>' . $currencies->display_price($products[$i]['final_price'], tep_get_tax_rate($products[$i]['tax_class_id']), $products[$i]['quantity']) . '</b>');
}

new productListingBox($info_box_contents);
--------------------------------------------------------------------------------------------------


application_top.php, case 'update_product' section:

$isFree = $HTTP_POST_VARS['free'][$i];
if ($isFree != 1)
{

$cart->add_cart($HTTP_POST_VARS['products_id'][$i], $HTTP_POST_VARS['cart_quantity'][$i], $attributes, false);
}


That's it, it works for me.

#96 kymation

  • Community Sponsor
  • 5,658 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 21 November 2007, 03:01

View Postatti, on Nov 19 2007, 06:11 AM, said:

Hi there!

Here's a quick fix for the "added again the free product but with full price" problem:
<code snipped>
That's it, it works for me.
Thanks for the patch. That does the job nicely. I was thinking of something much more complicated. Typical; I tend to over-design things.

Now I just need to package up all of the fixes everyone has contributed and put out a new release. If anyone knows of more bugs, now would be a great time to speak up.

Regards
Jim
My Addons

Banners Box 2.3.1 Support
Categories Accordion Box 2.3.1 Support
Categories Images Box 2.2x 2.3.1 Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box 2.3.1 Support
Get 1 Free 2.2x Support
Include HTML and Text Boxes 2.2x
jQuery Banner Rotator 2.2x 2.3.1 Support
Modular Front Page 2.3.1 Support
Modular SEO Header Tags 2.3.1 Support
More Pics 2.2x Support
MVS 2.2x Support
osC Catalog 2.2x Support
PDF Datasheet 2.3.1 Support
Price Updater 2.2x
Products Specifications 2.2x 2.3.1 Development Version Support Bugs/Suggestions
Request a Review 2.2x - 2.3.1 Support
Similar Products Box 2.2x
Theme Switcher 2.3.1 Support

#97 donkassim

  • Community Member
  • 11 posts
  • Real Name:Don Kassim
  • Location:Tanzania

Posted 22 November 2007, 15:09

hello

why do i get this error on product_info : Warning: sprintf() [function.sprintf]: Too few arguments

would appreciate the help

#98 kymation

  • Community Sponsor
  • 5,658 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 22 November 2007, 17:51

View Postdonkassim, on Nov 22 2007, 08:09 AM, said:

hello

why do i get this error on product_info : Warning: sprintf() [function.sprintf]: Too few arguments

would appreciate the help
The stock version has the correct arguments. Did you make some changes?

Regards
Jim
My Addons

Banners Box 2.3.1 Support
Categories Accordion Box 2.3.1 Support
Categories Images Box 2.2x 2.3.1 Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box 2.3.1 Support
Get 1 Free 2.2x Support
Include HTML and Text Boxes 2.2x
jQuery Banner Rotator 2.2x 2.3.1 Support
Modular Front Page 2.3.1 Support
Modular SEO Header Tags 2.3.1 Support
More Pics 2.2x Support
MVS 2.2x Support
osC Catalog 2.2x Support
PDF Datasheet 2.3.1 Support
Price Updater 2.2x
Products Specifications 2.2x 2.3.1 Development Version Support Bugs/Suggestions
Request a Review 2.2x - 2.3.1 Support
Similar Products Box 2.2x
Theme Switcher 2.3.1 Support

#99 kymation

  • Community Sponsor
  • 5,658 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 22 November 2007, 21:43

And the new version is up. It's just a rollup of all the patches since 1.2, so those who have been keeping up here can safely ignore it. If you haven't already patched your copy, or if you're having problems, you might want to go get this new version.

As always, please post here if you find any bugs or if you have problems installing this.

Regards
Jim
My Addons

Banners Box 2.3.1 Support
Categories Accordion Box 2.3.1 Support
Categories Images Box 2.2x 2.3.1 Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box 2.3.1 Support
Get 1 Free 2.2x Support
Include HTML and Text Boxes 2.2x
jQuery Banner Rotator 2.2x 2.3.1 Support
Modular Front Page 2.3.1 Support
Modular SEO Header Tags 2.3.1 Support
More Pics 2.2x Support
MVS 2.2x Support
osC Catalog 2.2x Support
PDF Datasheet 2.3.1 Support
Price Updater 2.2x
Products Specifications 2.2x 2.3.1 Development Version Support Bugs/Suggestions
Request a Review 2.2x - 2.3.1 Support
Similar Products Box 2.2x
Theme Switcher 2.3.1 Support

#100 consolidated

  • Community Member
  • 54 posts
  • Real Name:Mark Dutton

Posted 23 November 2007, 17:07

Hi there,

I like the idea of your Add-On. However, when I tried to manually install the add-on it went wrong and did not work, so I reverted to a previously saved version of my site. However, when I reverted the changed files, I get the following error message where the application_bottom.php file should be displayed...any suggestions from anyone would be much appreciated.



1146 - Table 'toptoners.TABLE_COUNTER' doesn't exist

select startdate, counter from TABLE_COUNTER

[TEP STOP]



Thank you.

Mark

Edited by Jan Zonjee, 27 November 2007, 21:51.