Jump to content
Latest News: (loading..)

Recommended Posts

I think you have things mixed up a bit. There is no help feature anymore.

Here the latest changes

ONLY FOR BOOTSTRAP VERSION!

This version is "NOT" for the normal osC 2.3.4 version!

For the normal osC 2.3.4 download the wdepot version from 29 Nov 2014 below.

 

All these new features are courtesy of De Dokta! So all credits for these new changes go to him.

Thank you J.J.!

 

What has changed? Here a short list;

 

- Replaced all instances of FILENAME_ and TABLE_ (filenames.php and database_tables.php will become obsolete.)

- SQL queries for install and uninstall are now integrated inside the new product_info module

- changes to reports.php are not necessary anymore

- removed wishlist help modal

- added new feature to wishlist.php to add and remove recipients by button click

 

This package includes also a upgrade manual for those of you that already have installed the previous version of Wishlist BS.

Please "read" and "follow" the instructions.

Just download this version here

 

http://addons.oscommerce.com/info/9313

 

and follow the install manual.

Edited by Tsimi

When you ask for help/support:

  • Always state your osCommerce version
  • If possible, list up installed add-ons
  • 3rd party templates are not supported in the forum

Latest osC: osCommerce CE (Community Edition aka. v2.3.4.1 Frozen)

 

Share this post


Link to post
Share on other sites

@@Tsimi @@De Dokta

@@Tsimi
 
Yes, you are right! :-
The only way to add a wishlist button to the product_listing seems to be to define a new case 'add_to_wishlist' in application_top:
 
Right before:  case 'notify' :         if (tep_session_is_registered('customer_id')) {
insert:

/*Wish List */
     case 'add_to_wishlist' : if (isset($_GET['products_id'])) {
                               if (tep_has_product_attributes($_GET['products_id'])) {
                               tep_redirect(tep_href_link('product_info.php', 'products_id=' . $_GET['products_id']));
                                } else {
                               $wishList->add_wishList($_GET['products_id'], $wishList->get_quantity($_GET['products_id'])+1);
                               }
                              }
                              tep_redirect(tep_href_link('wishlist.php', tep_get_all_get_params($parameters)));
                              break;
/* /Wish List End */                         

And then in product_listing add something like:       

 $prod_list_contents .= '       <div class="col-xs-6">' . tep_draw_button(TEXT_ADD_WISHLIST, 'glyphicon glyphicon-heart', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=add_to_wishlist&products_id=' . $listing['products_id']), NULL, NULL, 'btn-default btn-sm') . '</div>';

Works for me on bs-gold........

 

J.J.

 

 

Does this code works also for other models (new products, recently viewed)?

Share this post


Link to post
Share on other sites

@@gvv

 

Yes! For includes/modules/new_products.php e.g. it should be something like this:

 

                      $new_prods_content .= tep_draw_button(TEXT_ADD_WISHLIST, 'glyphicon glyphicon-heart', tep_href_link('wishlist.php', tep_get_all_get_params(array('action')) . 'action=add_to_wishlist&products_id=' . $new_products['products_id']), NULL, NULL, 'btn-default btn-sm');

 

Add it where you want the wishlist button to appear. And in other modules similar....

 

J.J.
 

Share this post


Link to post
Share on other sites

@@Tsimi I'm moving data over from my 2.3.4 store to my BS install today... planning to go live tomorrow and have an issue with the wishlist...

 

I've imported my data over into the new table structure that was implemented with the content module... However can't seem to get the imported wishlist data to display (new wishlist data seems to work fine). Not only that... when I visit any customer wishlist by logging in as them (for imported data) at wishlist.php. I get "No Products in the Wishlist" AND the data (that was imported) is deleted from the wishlist table.

 

Note the imported data is missing the following (because it was created under the old structure); customers_wishlist_quantity, final_price & customers_wishlist_date_added. However, even if I populate these manually, prior to visiting the wishlist the data is still deleted.

 

Any ideas would be greatly appreciated (w00t) (w00t) (w00t)

 

I wonder if there could be an issue with this code (although I'm not sure I understand it)?

/*******************************************************************
****************** DELETE PRODUCT FROM WISHLIST ********************
*******************************************************************/

  if (isset($_POST['add_wishprod'])) {
  	if (isset($_POST['wlaction']) && $_POST['wlaction'] == 'delete') {
	  	foreach ($_POST['add_wishprod'] as $key => $value) {
		  	if ($key == $value) $wishList->remove($value);
		  }
			tep_redirect(tep_href_link('wishlist.php')); // reload updated wish list
	  }
  }

Below is my table structure... I don't believe I've changed anything (I've compared it with WinMerge);

CREATE TABLE IF NOT EXISTS `customers_wishlist` (
  `customers_wishlist_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `customers_id` int(10) unsigned NOT NULL DEFAULT '0',
  `products_id` tinytext COLLATE utf8_unicode_ci NOT NULL,
  `customers_wishlist_quantity` int(2) NOT NULL,
  `final_price` decimal(15,4) DEFAULT NULL,
  `customers_wishlist_date_added` char(8) COLLATE utf8_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`customers_wishlist_id`),
  KEY `idx_wishlist_customers_id` (`customers_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=8064 ;
Edited by greasemonkey

Share this post


Link to post
Share on other sites

@@greasemonkey

 

Hi Scott

 

You said "old data"? Old data from which wishlist addon exactly?

Edited by Tsimi

When you ask for help/support:

  • Always state your osCommerce version
  • If possible, list up installed add-ons
  • 3rd party templates are not supported in the forum

Latest osC: osCommerce CE (Community Edition aka. v2.3.4.1 Frozen)

 

Share this post


Link to post
Share on other sites

@@Tsimi the "old data" from my old wishlist that I've imported into the new wish list tables

 

Step by step.... Exported "old data" from "old wish list addon". Upgraded/installed new wishlist addon... installed box and content modules... Imported "old data" into "newly created" wishlist and wishlist attributes tables.

 

Make sense?

 

Then if I visit any customer wishlist that (that was imported... new wishlist are fine) that data is deleted from the table.

 

By the way... its not the block of code I posted above.... i'm going through each block of code now to see if I can find where it could be removing/updating or deleting data

Edited by greasemonkey

Share this post


Link to post
Share on other sites

@@greasemonkey

 

We are talking past each other here. :D

I meant the old wishlist that you had is an older version then my BS stuff right?

So it must be a wdepot version right?

The upgrade instructions I mentioned in the latest BS version was/is not meant to upgrade from a non-BS version to BS.

It was meant to be an upgrade from my first BS version to the latest.

 

I have never looked at any older version except for the wdepot version from 29 Nov 2014


When you ask for help/support:

  • Always state your osCommerce version
  • If possible, list up installed add-ons
  • 3rd party templates are not supported in the forum

Latest osC: osCommerce CE (Community Edition aka. v2.3.4.1 Frozen)

 

Share this post


Link to post
Share on other sites

@@Tsimi yes you are correct.... I did move the data ONLY from the wdepot version... to your "pre" content module version.... and then used your upgrade instructions. I didn't notice in testing if your older versions was having the same issue.

 

I've found the bits causing it to delete in the class file... Just not sure why yet.... or if its "me"... :D :D :D :D :D

// reset per-session list contents, but not the database contents
      $this->reset(false);

      $products_query = tep_db_query("select products_id, customers_wishlist_quantity from customers_wishlist where customers_id = '" . (int)$customer_id . "'");
      while ($products = tep_db_fetch_array($products_query)) {
        $this->contents[$products['products_id']] = array('qty' => $products['customers_wishlist_quantity']);
// attributes
        $attributes_query = tep_db_query("select products_options_id, products_options_value_id from customers_wishlist_attributes where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products['products_id']) . "'");
        while ($attributes = tep_db_fetch_array($attributes_query)) {
          $this->contents[$products['products_id']]['attributes'][$attributes['products_options_id']] = $attributes['products_options_value_id'];
        }
      }

      $this->cleanup();

just testing something. I'll be back in a min.

Share this post


Link to post
Share on other sites

@@Tsimi ok I'm lost.... any help you can provide would be appreciated....

 

I'm not sure if this is something I've caused or created with another addon...

 

Here is what I've figured out so far;

 

1) if comment out line 58 from the class file it does not delete as suggested above.

   //   $this->cleanup();

the class file is (except for your work to removed the . TABLE_....) identical....

 

2) the tables; customers_wishlist_quantity, final_price & customers_wishlist_date_added need to be populated with "something" for this to work.... not a big issue.... I did an update script to populate a date, price and qty.... So this is fixed....

Share this post


Link to post
Share on other sites

@@gvv

 

Yes! For includes/modules/new_products.php e.g. it should be something like this:

 

                      $new_prods_content .= tep_draw_button(TEXT_ADD_WISHLIST, 'glyphicon glyphicon-heart', tep_href_link('wishlist.php', tep_get_all_get_params(array('action')) . 'action=add_to_wishlist&products_id=' . $new_products['products_id']), NULL, NULL, 'btn-default btn-sm');

 

Add it where you want the wishlist button to appear. And in other modules similar....

 

J.J.

 

this code works!

in products_info.php I have set (in admin panel wishlist options) after adding to wishlist stay on products info page. So clients can looking further.. .Maybe here are possible any code change for not redirecting to wishlist.php?

Share this post


Link to post
Share on other sites

@@greasemonkey

 

Can you provide me with a link or version to that wishlist addon that you had installed "previously" so that I can try to recreate the problem.


When you ask for help/support:

  • Always state your osCommerce version
  • If possible, list up installed add-ons
  • 3rd party templates are not supported in the forum

Latest osC: osCommerce CE (Community Edition aka. v2.3.4.1 Frozen)

 

Share this post


Link to post
Share on other sites

@@gvv

 

Can you try this?

 

$new_prods_content .= tep_draw_button(TEXT_ADD_WISHLIST, 'glyphicon glyphicon-heart', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=add_to_wishlist&products_id=' . $new_products['products_id']), NULL, NULL, 'btn-default btn-sm');
 


When you ask for help/support:

  • Always state your osCommerce version
  • If possible, list up installed add-ons
  • 3rd party templates are not supported in the forum

Latest osC: osCommerce CE (Community Edition aka. v2.3.4.1 Frozen)

 

Share this post


Link to post
Share on other sites

Good morning..... @@Tsimi thank you very kindly again....

 

this is the addon from my current 2.3.4 store http://addons.oscommerce.com/info/8665

 

I've taken the data from this addon and imported into the tables created in your addon.

 

Below is the table structure in BS... Just in case I've screwed something up...

CREATE TABLE IF NOT EXISTS `customers_wishlist` (
  `customers_wishlist_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `customers_id` int(10) unsigned NOT NULL DEFAULT '0',
  `products_id` tinytext COLLATE utf8_unicode_ci NOT NULL,
  `customers_wishlist_quantity` int(2) NOT NULL,
  `final_price` decimal(15,4) DEFAULT NULL,
  `customers_wishlist_date_added` char(8) COLLATE utf8_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`customers_wishlist_id`),
  KEY `idx_wishlist_customers_id` (`customers_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=8063 ;

Share this post


Link to post
Share on other sites

@@greasemonkey

 

I'm still gonna need a history date of that version. There are so many.

What I want/need to do is install your old version into a normal 2.3.4 shop, create a wishlist and then import that data to my latest BS version.


When you ask for help/support:

  • Always state your osCommerce version
  • If possible, list up installed add-ons
  • 3rd party templates are not supported in the forum

Latest osC: osCommerce CE (Community Edition aka. v2.3.4.1 Frozen)

 

Share this post


Link to post
Share on other sites

Thank you Lambros.

 

Here is the table structure from my 2.3.4 current store - I don't think I've screwed anything up here... but just in case...

 

I've added your new columns - to make it easier to import into the new structure.


CREATE TABLE IF NOT EXISTS `customers_wishlist` (
  `customers_wishlist_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `customers_id` int(13) NOT NULL DEFAULT '0',
  `products_id` text COLLATE utf8_unicode_ci NOT NULL,
  `customers_wishlist_quantity` int(2) NOT NULL,
  `final_price` decimal(15,4) NOT NULL,
  `customers_wishlist_date_added` char(8) CHARACTER SET utf8 NOT NULL,
  PRIMARY KEY (`customers_wishlist_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=8068 ;

So the data from the old DB was imported into the new structure using;

INSERT INTO `customers_wishlist` (`customers_wishlist_id`, `customers_id`, `products_id`, `customers_wishlist_quantity`, `final_price`, `customers_wishlist_date_added`) VALUES
(1, 8, '625', 0, '0.0000', ''),
......................

Share this post


Link to post
Share on other sites

@@greasemonkey

 

Hi Scott

 

OK, so I took a look at it and you are right. When I import the DB from the old wishlist to the new one and then login with the customer account that has the same customer_id as the wishlist then the wishlist gets erased.

I think I also found out why this is happening.

In the latest wishlist version there is the field customers_wishlist_quantity which was not there in the previous versions. So what you basically get when you import your old wishlist data is wishlists with products in them with a quantity of 0.

Now let's look at the classes file and specifically the cleanup funtion. There it says...

    function cleanup() {
      global $customer_id;

      reset($this->contents);
      while (list($key,) = each($this->contents)) {
        if ($this->contents[$key]['qty'] < 1) {
          unset($this->contents[$key]);
// remove from database
          if (tep_session_is_registered('customer_id')) {
            tep_db_query("delete from customers_wishlist where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($key) . "'");
            tep_db_query("delete from customers_wishlist_attributes where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($key) . "'");
          }
        }
      }
    }

this part is very interesting

        if ($this->contents[$key]['qty'] < 1) {

so if the quantity is 0 then it will delete the product from the database.

So i tested my theory and it seems to be right.

 

When I import the old wishlist database data and then directly login to the customer account "before" filling the missing info like customers_wishlist_quantity then it erases everything. BUT! if i upload the old database data and then right away fill in at least a customers_wishlist_quantity of 1 to all products and then login the wishlist is there with all it's product in it.

So if you fill in the missing info first and then login you should be OK.

 

Does what I just explained make sense?

Edited by Tsimi

When you ask for help/support:

  • Always state your osCommerce version
  • If possible, list up installed add-ons
  • 3rd party templates are not supported in the forum

Latest osC: osCommerce CE (Community Edition aka. v2.3.4.1 Frozen)

 

Share this post


Link to post
Share on other sites

@@Tsimi yep.... that works.... you just have to be sure the qty field is populated prior to visiting wishlist.php.

 

Maybe the right thing would be to have the default structure to "null" in the qty? Not sure if that would work....

 

Or maybe a simple warning in the instructions (if you feel like there will be others "like me") to run a script UPDATE the qty column to "1"?

Share this post


Link to post
Share on other sites

@@Tsimi

@@gvv

 

Can you try this?

 

$new_prods_content .= tep_draw_button(TEXT_ADD_WISHLIST, 'glyphicon glyphicon-heart', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=add_to_wishlist&products_id=' . $new_products['products_id']), NULL, NULL, 'btn-default btn-sm');
 

No, this code also redirects to wishlist.php.

Share this post


Link to post
Share on other sites

@@gvv

 

Try this: In application_top.php in  - case 'add_to_wishlist' - replace: 

                              tep_redirect(tep_href_link('wishlist.php', tep_get_all_get_params($parameters)));
                              break;
/* /Wish List End */                         

with:

                              if(WISHLIST_REDIRECT ==  'Yes') tep_redirect(tep_href_link('wishlist.php', tep_get_all_get_params($parameters)));
                              break;
/* /Wish List End */                         

Share this post


Link to post
Share on other sites

I thought that code was added...at least it shows in my files...?? I will update the install manual.


When you ask for help/support:

  • Always state your osCommerce version
  • If possible, list up installed add-ons
  • 3rd party templates are not supported in the forum

Latest osC: osCommerce CE (Community Edition aka. v2.3.4.1 Frozen)

 

Share this post


Link to post
Share on other sites

Hi Tsimi,

I installed wishlist but now I have a problem.

In admin I put the button (Display Wish List After Adding Product) on no.

So when you click on the add to wishlist button the product is going in the wishlist.

b.t.w. I have also a glyphicon on the navbar.

so far so good.

 

now the problem.

if you click on add to the wishlist you must receive a message added to wish list.

I do not get this message.​

 

also in the navbar he must also add the product in the glyphicon (like 1,2,3) that he does not.

 I hope you can help me out, because I can't figure it out after 3 day's :(

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

×