Jump to content



Photo
* * * * * 2 votes

Dangling Carrot (Free Gift/Discount Contrib)


  • Please log in to reply
305 replies to this topic

#61   cymonguk

cymonguk
  • Members
  • 549 posts
  • Real Name:Simon

Posted 27 April 2005 - 05:02

I just uploaded a new version that contains an infobox to display the gift items.  To update, just copy the infobox to the includes/boxes directory, add this to the includes/languages/english.php file

// free_gifts in includes/boxes/gifts/php
define('BOX_HEADING_GIFTS', 'Special Gifts');
and add this to the left or right column file
include(DIR_WS_BOXES . 'gifts.php');

Jack

<{POST_SNAPBACK}>


Sorry mate i may be confusing you here..

I can add the gifts into the backend no problem, remove them, edit etc..

The issue I get is when you try to "Add Gift" through the shopping cart. It recognises there is a free gift, but then wont allow me to add it.

It works fine if I set stock to Available, but not if I set to not Available
Hey its free!

#62   cymonguk

cymonguk
  • Members
  • 549 posts
  • Real Name:Simon

Posted 27 April 2005 - 06:25

Sorry mate i may be confusing you here..

I can add the gifts into the backend no problem, remove them, edit etc..

The issue I get is when you try to "Add Gift" through the shopping cart. It recognises there is a free gift, but then wont allow me to add it.

It works fine if I set stock to Available, but not if I set to not Available

<{POST_SNAPBACK}>


OK I have found my problem.

The product I want to use is an ebook, when I add any other gift it works fine, but as soon as I add a file as a product attribute it produces this error. I know this might not be your contrib but any ideas?
Hey its free!

#63   Jack_mcs

Jack_mcs
  • Members
  • 26,417 posts
  • Real Name:Jack York
  • Gender:Male
  • Location:Michigan

Posted 27 April 2005 - 13:07

Just to be clear, this is not my contribution. I simply made some changes to it.

As for your problem, I don't have an answer for you. I don't understand what you mean by "add a file as a product attribute ." But if you are talking about using a product that has attributes as a gift, I don't think that would matter. You should try isolating the problem. If you add a regular product and make it a gift you said it works. What happens then if you add an attribute to it? If it still works, go through each of the options for the two products (the one that works and the one that doesn't) and try setting them the same.

Jack

#64   cymonguk

cymonguk
  • Members
  • 549 posts
  • Real Name:Simon

Posted 27 April 2005 - 15:58

Just to be clear, this is not my contribution. I simply made some changes to it.

As for your problem, I don't have an answer for you.  I don't understand what you mean by "add a file as a product attribute ." But if you are talking about using a product that has attributes as a gift, I don't think that would matter.  You should try isolating the problem. If you add a regular product and make it a gift you said it works. What happens then if you add an attribute to it? If it still works, go through each of the options for the two products (the one that works and the one that doesn't) and try setting them the same.

Jack

<{POST_SNAPBACK}>



Sorry the product is an ebook and you can specify what the filename is in oscommerce through the attributes section. When I add this attribute to any gift product it stops the item from being added. Its blatantly a fault with something I am doing on the product.
Hey its free!

#65   irishmystic

irishmystic
  • Members
  • 28 posts
  • Real Name:Erin

Posted 06 May 2005 - 19:35

The issue I get is when you try to "Add Gift" through the shopping cart. It recognises there is a free gift, but then wont allow me to add it.

It works fine if I set stock to Available, but not if I set to not Available

<{POST_SNAPBACK}>


Hi all,
This is a great contribution and I just installed it today. Everything seems to be working fine and I love the carrot "just spend x dollars more to get the gift"!

However, I am having the same problem, as above, although I do not have any attribute contributions added.

If the item is marked out of stock in the admin, the items will show as free gifts in the admin and in the catalog, but when you click on the "add" button in the shopping cart nothing happens, it only refreshes the cart. The free items show that you have reached the threshold, etc, but the button only works, if the item is marked as in stock in the admin.

Any ideas, anyone?

One more thing, I just noticed. The items cannot be removed (deleted) from my admin, at all. That is certainly not a huge issue, as I can delete them from the table easy enough. Just thought I would mention it.

The download I used is the most recent 1.7


As it is, I can probably use this as is. It is a great contribution! The items are linkable in the shopping cart and I can give a brief description and mention that these are "specials" and may not be purchased by themselves.

If anyone has any thoughts on what we may have done wrong with the admin or cart, I am all eyes. /wink.gif' class='bbc_emoticon' alt=';)' />

Peace,
Erin.

#66   Snowman

Snowman
  • Members
  • 645 posts
  • Real Name:Banned
  • Location:Coleraine, VIC, Australia

Posted 07 May 2005 - 05:34

Im wondering if somone can help me with a weird issue with this mod.

ive got it all setup however /admin/gift_add.php doesnt show any products in the drop down box.

anyone have any ideas as to why this would be???

#67   irishmystic

irishmystic
  • Members
  • 28 posts
  • Real Name:Erin

Posted 07 May 2005 - 12:59

Im wondering if somone can help me with a weird issue with this mod.

ive got it all setup however /admin/gift_add.php doesnt show any products in the drop down box.

anyone have any ideas as to why this would be???

<{POST_SNAPBACK}>

Hi Snowman,
I did not quite understand this, myself, at first. I have another mod that requires the product begin with gift, as well, but the "model" rather than the name.

This mod requires the NAME begin with Gift, Like "Gift - Free Rose Quartz", or something like that. You can duplicate any item you like and rename it to "Gift ~ whatever", and it should appear in the box. It does not matter what the "model" is, just the product name.

If you do have products already called Gift something, then I don't have any help to offer you.

Hope this helps!

Peace,
Erin /biggrin.gif' class='bbc_emoticon' alt=':D' />

#68   henk3001

henk3001
  • Members
  • 24 posts
  • Real Name:henk
  • Location:Netherlands

Posted 25 May 2005 - 14:21

Hi nice contrib, but how can you make this work "just spend x dollars more to get the gift"!

Henk

#69   henk3001

henk3001
  • Members
  • 24 posts
  • Real Name:henk
  • Location:Netherlands

Posted 25 May 2005 - 15:05

Hi nice contrib, but how can you make this work "just spend x dollars more to get the gift"!

Henk

<{POST_SNAPBACK}>


Sorry it works /biggrin.gif' class='bbc_emoticon' alt=':D' /> the $near_limit is 20

Edited by henk3001, 25 May 2005 - 15:05.


#70   knokenet

knokenet
  • Members
  • 38 posts
  • Real Name:knokenet

Posted 26 May 2005 - 21:25

Hey,

Followed the whole thread, but still no solution for the admin side. Cannot update, edit or delete selected products.

One more thing:
When going over the threshold, the 'buy now' image appears. I'd also like to link the product's image to its product's info page, so people will have some idea of what gift they are getting.
I'm using the latest version, 1.7.

Any ideas???

#71   irishmystic

irishmystic
  • Members
  • 28 posts
  • Real Name:Erin

Posted 27 May 2005 - 13:00

Solved my own problem.  I have the Price Break per product Mod and it uses a PriceFormatter.php function called from get_products()  to query the product list and format prices.  The products query included a WHERE clause that excluded the products_status='0'.  I modified it to do a join on the free_gifts table and see if the product existed.  Everything is working fine now.

<{POST_SNAPBACK}>



Hi Scott,
I am having the same problem with the price break mod and gift items not showing up in the cart when a price break item is there. Could you post your fix?
I am still learning php and am afraid I might just break it.... /whistling.gif' class='bbc_emoticon' alt=':-"' />
Thanks, for your help!

Peace,
Erin

#72   rebelina

rebelina
  • Members
  • 22 posts
  • Real Name:Rebecca

Posted 28 May 2005 - 22:29

Hey,

Followed the whole thread, but still no solution for the admin side. Cannot update, edit or delete selected products.

<snip>
I'm using the latest version, 1.7.

<{POST_SNAPBACK}>


I'm having exactly the same problem - cannot update, edit or delete gifts on the admin side. I can insert new ones.

Anybody got a solution? Great contribution btw.

- Rebecca

Edited by rebelina, 28 May 2005 - 22:29.


#73   Jack_mcs

Jack_mcs
  • Members
  • 26,417 posts
  • Real Name:Jack York
  • Gender:Male
  • Location:Michigan

Posted 29 May 2005 - 00:59

I have uploaded a new version.

- Added link to the displayed image
- Added code to ignore out of stock gift products

To update from a previous version, code in catalog/shopping_cart.php and boxes/gifts.php was changed.

Jack

Edited by Jack_mcs, 29 May 2005 - 01:00.


#74   Jack_mcs

Jack_mcs
  • Members
  • 26,417 posts
  • Real Name:Jack York
  • Gender:Male
  • Location:Michigan

Posted 29 May 2005 - 01:03

I'm having exactly the same problem - cannot update, edit or delete gifts on the admin side.  I can insert new ones.

Anybody got a solution? Great contribution btw.

- Rebecca

<{POST_SNAPBACK}>

I can't see a problem with the admin section. Do you get any kind of indication at all when you try to edit/delete an gift. Also, I assume you are speaking about when you try to do this in admin->catalog->Gifts. Is that correct?

Jack

#75   misa

misa
  • Members
  • 169 posts
  • Real Name:Rob

Posted 29 May 2005 - 07:46

Im wondering if somone can help me with a weird issue with this mod.

ive got it all setup however /admin/gift_add.php doesnt show any products in the drop down box.

anyone have any ideas as to why this would be???


Same problem here.

#76   Jack_mcs

Jack_mcs
  • Members
  • 26,417 posts
  • Real Name:Jack York
  • Gender:Male
  • Location:Michigan

Posted 30 May 2005 - 00:06

Same problem here.

<{POST_SNAPBACK}>

To try to isolate this problem, find this section of code in admin/gifts.php (starts at line 47)
$freeGifts = array();
  $gift_list_query = tep_db_query("SELECT p.products_id, pd.products_id, pd.products_name FROM products p, products_description pd WHERE pd.language_id = '".$languages_id."'
 	 AND p.products_id = pd.products_id AND pd.products_name LIKE 'Gift%' ORDER BY pd.products_name ASC");
  while ($gift_list = tep_db_fetch_array($gift_list_query)) 
   $freeGifts[] = array('id' => $gift_list['products_name'], 'text' => $gift_list['products_name']);
and replace it with this code
 $freeGifts = array();
  $gift_list_query = tep_db_query("SELECT p.products_id, pd.products_id, pd.products_name FROM products p, products_description pd WHERE pd.language_id = '".$languages_id."'
 	 AND p.products_id = pd.products_id AND pd.products_name LIKE 'Gift%' ORDER BY pd.products_name ASC");
  echo 'There are '. tep_db_num_rows($gift_list_query) . ' gift products<br><br>';
  while ($gift_list = tep_db_fetch_array($gift_list_query))
  { 
  echo 'Adding ' . $gift_list['products_name'].'<br>';
   $freeGifts[] = array('id' => $gift_list['products_name'], 'text' => $gift_list['products_name']);
   }
Save the file and go to admin->catalog->gifts. What do you see displayed at the top of the page?

Jack

#77   misa

misa
  • Members
  • 169 posts
  • Real Name:Rob

Posted 30 May 2005 - 05:47

How is the best way to insert gifts, because the only possibity now is to plase "gift" in front off the product name and that's not so nice.

And I can't put it out off stock, when I do that I don't see the gift anymore, anyone with an idea?

#78   knokenet

knokenet
  • Members
  • 38 posts
  • Real Name:knokenet

Posted 30 May 2005 - 08:26

To try to isolate this problem, find this section of code in admin/gifts.php (starts at line 47)

$freeGifts = array();
  $gift_list_query = tep_db_query("SELECT p.products_id, pd.products_id, pd.products_name FROM products p, products_description pd WHERE pd.language_id = '".$languages_id."'
  	AND p.products_id = pd.products_id AND pd.products_name LIKE 'Gift%' ORDER BY pd.products_name ASC");
  while ($gift_list = tep_db_fetch_array($gift_list_query)) 
   $freeGifts[] = array('id' => $gift_list['products_name'], 'text' => $gift_list['products_name']);
and replace it with this code
 $freeGifts = array();
  $gift_list_query = tep_db_query("SELECT p.products_id, pd.products_id, pd.products_name FROM products p, products_description pd WHERE pd.language_id = '".$languages_id."'
  	AND p.products_id = pd.products_id AND pd.products_name LIKE 'Gift%' ORDER BY pd.products_name ASC");
  echo 'There are '. tep_db_num_rows($gift_list_query) . ' gift products<br><br>';
  while ($gift_list = tep_db_fetch_array($gift_list_query))
  { 
  echo 'Adding ' . $gift_list['products_name'].'<br>';
   $freeGifts[] = array('id' => $gift_list['products_name'], 'text' => $gift_list['products_name']);
   }
Save the file and go to admin->catalog->gifts.  What do you see displayed at the top of the page?

Jack

<{POST_SNAPBACK}>



Thank you for the updates!
Still, cannot update, delete, edit...

#79   knokenet

knokenet
  • Members
  • 38 posts
  • Real Name:knokenet

Posted 30 May 2005 - 08:30

To try to isolate this problem, find this section of code in admin/gifts.php (starts at line 47)

$freeGifts = array();
  $gift_list_query = tep_db_query("SELECT p.products_id, pd.products_id, pd.products_name FROM products p, products_description pd WHERE pd.language_id = '".$languages_id."'
  	AND p.products_id = pd.products_id AND pd.products_name LIKE 'Gift%' ORDER BY pd.products_name ASC");
  while ($gift_list = tep_db_fetch_array($gift_list_query)) 
   $freeGifts[] = array('id' => $gift_list['products_name'], 'text' => $gift_list['products_name']);
and replace it with this code
 $freeGifts = array();
  $gift_list_query = tep_db_query("SELECT p.products_id, pd.products_id, pd.products_name FROM products p, products_description pd WHERE pd.language_id = '".$languages_id."'
  	AND p.products_id = pd.products_id AND pd.products_name LIKE 'Gift%' ORDER BY pd.products_name ASC");
  echo 'There are '. tep_db_num_rows($gift_list_query) . ' gift products<br><br>';
  while ($gift_list = tep_db_fetch_array($gift_list_query))
  { 
  echo 'Adding ' . $gift_list['products_name'].'<br>';
   $freeGifts[] = array('id' => $gift_list['products_name'], 'text' => $gift_list['products_name']);
   }
Save the file and go to admin->catalog->gifts.  What do you see displayed at the top of the page?

Jack

<{POST_SNAPBACK}>



Thanks for the v1.8 updates.
Still cannot edit, delete or update products...

#80   irishmystic

irishmystic
  • Members
  • 28 posts
  • Real Name:Erin

Posted 30 May 2005 - 13:50

Save the file and go to admin->catalog->gifts.  What do you see displayed at the top of the page?

Jack

<{POST_SNAPBACK}>


Hi Jack and everyone,
I have also had this problem (can't update, edit, or delete gifts from the admin) since I first added the contribution version 1.7.

When I changed the code in gift_add.php in the admin section, here is what shows (whether I hit the update, edit, or delete button):

There are 2 gift products

Adding Gift - FREE Rose Quartz
Adding Gift -1 oz. Jasmine


However, there is only one gift showing on the list, the other is only a possible addition (if that makes a difference).

Thanks for any help!

Peace,
Erin