Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Get 1 Free


kymation

Recommended Posts

<snip>

I'm getting this output: "Special Offer: Buy 2 Get 0 Free!" even though my promotion is set to buy 2, get 1 free.

Any help would be great!

You have an extra variable in your sprintf. Try it this way:

	  echo '<p>' . sprintf (TEXT_GET_1_FREE_PROMOTION, $free_product['products_qualify_quantity'], $free_product['products_free_quantity']) . '</p>';

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

I have figured out how i can set all the products with a free products, used sql :D

 

But i see now when i have fixed this and tried to buy some products, that for each products i insert in the basket the gift also get included. Sow if i buys 5 various proucts i also get 5 gifts.

 

How can i manage sow that i only get one gift no matter how many products i buys?

 

Hope you can help me with this.

 

Best Regards

Thomas

 

 

I am trying to figure the same thing out as you. I am trying to get it so when a customer buys any 2 items they can choose an item priced lower than the lowest amount of the product they purchased. But I am trying to figure out how to get it to choose all the items in my database. We have over 2000 items.

 

Can you share with me how you did the sql to set all the products with a free products?

 

Thanks

Mike

Link to comment
Share on other sites

Hi

 

Great contribution so far but i stumbled upon an error :(

 

in checkout_process.php i get: Parse error: syntax error, unexpected '[', expecting ')' in /.../..../public_html/dev/checkout_process.php on line 237

 

Line 222 until 246 - line 237 is bold

 

    $products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";

// start Get 1 free
   // If this product qualifies for free product(s) add the free products
//    if (is_array ($free_product = $this->get1free ($products_id))) {
if (is_array ($free_product = $cart->get1free ($products_id))) {
     // Update products_ordered (for bestsellers list)
     //   Comment out the next line if you don't want free products in the bestseller list
     tep_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%d', $free_product['quantity']) . " where products_id = '" . tep_get_prid($free_product['id']) . "'");

     $sql_data_array = array('orders_id' => $insert_id,
                             'products_id' => $free_product['id'],
                             'products_model' => $free_product['model'],
                             [b]'products_name' => free_product['name'],[/b]
                             'products_price' => 0,
                             'final_price' => 0,
                             'products_tax' => '',
                             'products_quantity' => $free_product['quantity']
                            );
     tep_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);

     $total_weight += ($free_product['quantity'] * $free_product['weight']);
   }
// end Get 1 free
 }

 

 

does anyone know a fix for this?

Link to comment
Share on other sites

Try changing this

'products_name' => free_product['name'],

to this

'products_name' => $free_product['name'],

 

I'm no coder, but it looks like the $ is missing.

Currently running 76 contibutions.

Link to comment
Share on other sites

thnx m8,

 

Stupid that i haven't seen that myself :blink: (bangin head to the wall)

 

I made some changes and fixes to the package and released it under "Get 1 free 1.1b"

 

tested and it works like a charm.

 

 

Greetz

Edited by djbastard
Link to comment
Share on other sites

thnx m8,

 

Stupid that i haven't seen that myself :blink: (bangin head to the wall)

 

I made some changes and fixes to the package and released it under "Get 1 free 1.1b"

 

tested and it works like a charm.

Greetz

 

Thanks for the update and works like a charm for me also! :thumbsup:

Currently running 76 contibutions.

Link to comment
Share on other sites

thnx m8,

 

Stupid that i haven't seen that myself :blink: (bangin head to the wall)

 

I made some changes and fixes to the package and released it under "Get 1 free 1.1b"

 

tested and it works like a charm.

Greetz

 

Thanks for the update and works like a charm for me also! :thumbsup:

Currently running 76 contibutions.

Link to comment
Share on other sites

The Buy one Get one Free is what I need. I just need it to work. My Store is now live!

 

Problems I'm having with this contribution:

 

1. The Free item never shows up in my cart. The description indicating that you get it free shows, but never it transfers to the cart.

2. Confirmation Emails are not sent to customer after account setup,

3. Confirmation Emails are not sent to customer after completion of checkout -except by Paypal.

4. Emails sent to customer from the Admin Orders panel are not recieved by the customer.

 

I must have done something wrong because the emails worked prior to the modification.

 

There no error messages displayed at anypoint of these processes.

I really need a fix!

Link to comment
Share on other sites

The Buy one Get one Free is what I need. I just need it to work. My Store is now live!

 

Problems I'm having with this contribution:

 

1. The Free item never shows up in my cart. The description indicating that you get it free shows, but never it transfers to the cart. Q: should there be an image as well?

2. Confirmation Emails are not sent to customer after account setup,

3. Confirmation Emails are not sent to customer after completion of checkout -except by Paypal.

4. Emails sent to customer from the Admin Orders panel are not recieved by the customer.

 

I must have done something wrong because the emails worked prior to the modification.

 

There no error messages displayed at anypoint of these processes.

I really need a fix!

Link to comment
Share on other sites

Item 1 Fixed! :rolleyes: I really needed to put an expiration date in that field. It won't link to cart if left blank.

:'( Still don't know why emails not working. going to revert back to previous Saved Backup & move from there.

Link to comment
Share on other sites

Items 2.3.4 all settled. :thumbsup:

I've seen lots of posts with similiar problems (E-Mail) and I tried many suggestions but to no avail. What worked and what I recommend as a start is to down load the Email_Test contribution from the contributions page(s). Follow the instructions supplied or read posts on how it works. Basically, the test will tell you if the Email problem is on the Oscommerce side or with your hosting company. In my case the problem was with my host. I contacted them and the next day my emails were working again. Just like that! They didn't explain what they did, but somehow and for some reason they blocked emails sent from my Oscommerce shop.

 

I lost a couple nights of sleep tweeking this topic's contribution and all prior contributions I added. This process was very frustrating not to mention time consuming as I my site was not 100%. However, I'm happy now.

 

If reading this saves someone else time that is even better for us all! I don't mean to take the focus off this contribution's topic which is working as designed in my store. Great Job! :D

 

Checkout my Sneaker Collectors Collections Site: It Must Be The Shoes

Edited by fonkjam
Link to comment
Share on other sites

  • 4 weeks later...

Hi,

 

First I want to thank kymation for this very nice contrib. :thumbsup:

Maybe I have found a small bug when adding products over the cart.

 

Following Case:

Running a Special limited offer like: Buy 2 Product-Y and get 1 Product-Y for free!

and a Special limited offer: Buy 2 Product-Z and get 1 Product-Z for free!

 

1. I add 1 x Product-Y to cart over product_info.php

2. I add 1 x Product-Z to cart over product_info.php

3. All seems to be OK

4. Now changing quantity from Product-Y in cart to 2 pcs. to get the free Product-Y and pressing update

5. A free product-Y has been added automatically to the cart - all is correct

6. Now changing quantity from Product-Z in cart to 2 pcs. to get the other free Product-Z and pressing update

7. and now the bug happens

8. The free Product-Y has been automatically removed from cart and the quantity from Product-Y has been set back to 1 pcs.,

9. The free product-Z has been correctly added to the cart and the quantity of Product-Z has been set to 2 pcs..

 

Did anyone have the same problem or did anyone have a workaround for this problem.

 

Thanks for any help!

Link to comment
Share on other sites

<snip>

Did anyone have the same problem or did anyone have a workaround for this problem.

 

Thanks for any help!

You're right, that does seem to be a bug. This is undoubtedly a result of my trying to be sneaky and hiding the free products from the customer (so they can't run up the free quantity without buying the non-free products.) I'm beginning to think that this design was a bad idea. Oh well, I'll see if I can figure out what's going on with this one.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

I have had a look at the use.txt file but I am unable to carry out any of the tasks as when I am in the admin console and have clicked on Catalog & Get 1 Free all I get is the following message:

 

1146 - Table 'hoopsdir_i497osc.get_1_free' doesn't exist

 

select count(*) as total from products p, get_1_free g1f, products_description pd where p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = g1f.products_id

 

[TEP STOP]

 

I was presuming that this was happening as I had not set up the table? im a bit of a newbie to this so I've never had to set up a new table before.

 

Im a bit confused as to what to do with the get_1_free SQL File.

Edited by keo77
Link to comment
Share on other sites

I have had a look at the use.txt file but I am unable to carry out any of the tasks as when I am in the admin console and have clicked on Catalog & Get 1 Free all I get is the following message:

 

1146 - Table 'hoopsdir_i497osc.get_1_free' doesn't exist

<snip>

That's your problem; you need to install the table before it will work. Most hosting services have some form of database manager, usually phpMyAdmin. If your host doesn't provide a database manager, or you are running your own system, go get a copy of phpMyAdmin and install it. This will allow you to upload and run the SQL file included in the distribution, or copy the SQL code from the file and paste it into a window and execute it. The exact details will vary depending on which database manager you are using and which version. Hosting services usually have instructions on using their tools, and there is good support for phpMyAdmin. Post again if you are still having problems and we'll figure it out.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

I'm experiencing the same problem.

I don't know what is causing the failed file uploads. That's the second time this has happened to this Contribution. In any case, I've added version 1.2 to the stack. I downloaded and checked it and it appears to be OK, so please post here or PM me if it's not.

 

This is a rollup of the bugfixes posted here (the same as 1.1b) and a copy of Ed's customer notification modifications file, so everything is in one package.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Dear sir,

Really thank you for this very nice contrib.

 

I found some problem seems like bug in the /catalog/shopping_cart.php also.

 

I created a buy 1 product-A can get a Free-product-B

wheh I add the product-A to the shopping_cart,it's normal.

(please see the pic1.jpg)

pic1.jpg

 

But bug happen when I change the product-A's quantity to 2 in the shopping_cart.

It show the two Free-product-B in the shopping_cart,

and the most important , please see the second Free-product-B's price,it shows it's real price $30 not $0

(please see the pic2.jpg)

pic2.jpg

Sir,can you help fix this problem

Link to comment
Share on other sites

This problem has been mentioned before. I now think that a complete rewrite will be needed to cover all of the problems with this method. I don't have time to do this right now, but I will work on it as soon as I have time.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

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